The preserves-schema-ts program reads Preserves Schema DSL input files. For each input file, it produces a TypeScript source file of the same name but with .ts in place of .prs.


Install node.js v12 or newer. Then, yarn global add @preserves/schema.


Usage: preserves-schema-ts [options] [input...]

Compile Preserves schema definitions to TypeScript

  input                      Input directory, optionally with :<glob> on the end

  --xref <glob>              Cross-reference other textual Preserves schema definitions
                             (default: [])
  --output <directory>       Output directory for modules
  --stdout                   Prints each module to stdout one after the other instead
                             of writing them to files in the `--output` directory
  --core <path>              Import path for @preserves/core
                             (default: "@preserves/core")
  --watch                    Watch base directory for changes
  --traceback                Include stack traces in compiler errors
  --module <namespace=path>  Additional Namespace=path import (default: [])
  -h, --help                 display help for command