Installation
Requirements
Section titled “Requirements”- Node.js 22 or later
- Package manager: npm, pnpm, or yarn
CLI — global install
Section titled “CLI — global install”Install the CLI globally to use fhir-test-data as a command anywhere:
pnpm add -g fhir-test-datanpm install -g fhir-test-datayarn global add fhir-test-dataVerify the install:
fhir-test-data --versionLibrary — project dependency
Section titled “Library — project dependency”Add as a development dependency when using the TypeScript API in test suites or build scripts:
pnpm add -D fhir-test-datanpm install --save-dev fhir-test-datayarn add --dev fhir-test-dataPackage exports
Section titled “Package exports”The package exposes two entry points:
| Import path | Contents |
|---|---|
fhir-test-data | Core types, all builder factories, locale utilities |
fhir-test-data/faults | injectFaults, FAULT_TYPES, fault type definitions |
import { createPatientBuilder } from "fhir-test-data";import { injectFaults, FAULT_TYPES } from "fhir-test-data/faults";