Skip to main content
Version: v0.1.7

Installation

Prerequisites​

  • Node.js 22 or later. CI tests on Node.js 22, 24, and 26.
  • A package manager: npm, pnpm, or Yarn.

Install the package and the parsers you need​

@cosyte/synth builds each format through its sibling parser, and each parser is an optional peer dependency. Install the package with the parsers for the formats you generate:

npm install @cosyte/synth @cosyte/hl7
You importInstall alongside @cosyte/synth
@cosyte/synthnothing: the seeded generator, the value providers, and the checks
@cosyte/synth/hl7@cosyte/hl7
@cosyte/synth/fhir@cosyte/fhir
@cosyte/synth/ccda@cosyte/ccda
@cosyte/synth/x12@cosyte/x12
@cosyte/synth/ncpdp@cosyte/ncpdp
@cosyte/synth/astm@cosyte/astm
@cosyte/synth/deid@cosyte/deid, @cosyte/hl7, @cosyte/fhir, @cosyte/ccda, @cosyte/x12, and @cosyte/ncpdp

The deid subpath loads all five parsers it pairs as soon as it is imported, so all five must be installed even if you call only one of its loops. Each parser peer is declared at ^0.1, and @cosyte/deid at ^0.1.5 || ^0.2.0, so either release line installs beside it.

To install every format at once:

npm install @cosyte/synth @cosyte/hl7 @cosyte/fhir @cosyte/ccda @cosyte/x12 @cosyte/ncpdp @cosyte/astm @cosyte/deid

The package has no third-party runtime dependencies. It ships ESM and CommonJS builds, each with its own type declarations, so import and require both work without configuration.

Check the install​

import { VERSION } from "@cosyte/synth";

typeof VERSION; // => "string"

VERSION is the version of the package you installed, written from its manifest at release. The check asserts its type rather than its value so this page never names a version.

To check a format subpath, generate one artifact from it:

import { generateAdt, roundTrip } from "@cosyte/synth/hl7";

roundTrip(generateAdt({ seed: 1 })).specClean; // => true

If the import fails with "Cannot find module", the parser for that subpath is missing; see Troubleshooting.

Next​

The Quickstart generates a first message, draws a synthetic value, and builds a reproducible corpus.