JavaScript/TypeScript Support

Facility supports tools and libraries for using JavaScript and/or TypeScript with Facility Service Definitions.

Tools

Generate a JavaScript or TypeScript client or server for your Facility Service Definition by doing one of the following:

  • Use the Facility Editor. Enter an API definition in the left pane, choose the “JavaScript” or “TypeScript” generator, review the generated files, and click Download.
  • Run the fsdgenjs tool on the command line or in a build script.
  • Use the Facility.CodeGen.JavaScript .NET library (NuGet Package) in your own build tool.

fsdgenjs

fsdgenjs is a command-line tool that generates JavaScript or TypeScript for a Facility Service Definition.

Install fsdgenjs as documented from its NuGet package.

fsdgenjs generates files for client, Express server, and types and supports the standard command-line options as well as the following additional command-line options:

  • --module <name>: Sets the name of the generated module.
  • --typescript: Generates TypeScript rather than JavaScript.
  • --express: Generates an Express server.