Emitter usage
Emitter usage
Section titled “Emitter usage”- Via the command line
tsp compile . --emit=@typespec/http-server-js- Via the config
emit: - "@typespec/http-server-js"The config can be extended with options as follows:
emit: - "@typespec/http-server-js"options: "@typespec/http-server-js": option: valueEmitter options
Section titled “Emitter options”emitter-output-dir
Section titled “emitter-output-dir”Type: absolutePath
Defines the emitter output directory. Defaults to {output-dir}/@typespec/http-server-js
See Configuring output directory for more info
express
Section titled “express”Type: boolean
If set to true, the emitter will generate a router that exposes an Express.js middleware function in addition to the ordinary Node.js HTTP server router.
If this option is not set to true, the expressMiddleware property will not be present on the generated router.
datetime
Section titled “datetime”Type: "temporal-polyfill" | "temporal" | "date-duration"
The type of datetime models to use for TypeSpecs DateTime and Duration types.
omit-unreachable-types
Section titled “omit-unreachable-types”Type: boolean
By default, the emitter will create interfaces that represent all models in the service namespace. If this option is set to true, the emitter will only emit those types that are reachable from an HTTP operation.
no-format
Section titled “no-format”Type: boolean
If set to true, the emitter will not format the generated code using Prettier.