{"id":25609,"library":"fsh-sushi","title":"SUSHI (FSH Compiler)","description":"SUSHI (SUSHI Unshortens Short Hand Inputs) is a reference implementation compiler for FHIR Shorthand (FSH), a domain-specific language for defining FHIR Implementation Guides. Current stable version is 3.19.0, released with monthly cadence. Key differentiators: first-class support for FHIR R4/R4B/R5, dependency aliasing (since v3.16.0), multiline strings in invariants and mapping comments (v3.18.0), and integration with IG Publisher. Primarily used via CLI (`sushi build`). Ships TypeScript types.","status":"active","version":"3.19.0","language":"javascript","source_language":"en","source_url":"https://github.com/fhir/sushi","tags":["javascript","typescript"],"install":[{"cmd":"npm install fsh-sushi","lang":"bash","label":"npm"},{"cmd":"yarn add fsh-sushi","lang":"bash","label":"yarn"},{"cmd":"pnpm add fsh-sushi","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Resolves FHIR package dependencies from registry","package":"fhir-package-loader","optional":true},{"reason":"Utility library used internally","package":"lodash","optional":true},{"reason":"HTTP client for network requests","package":"axios","optional":true}],"imports":[{"note":"ESM-only since v3; CLI usage does not require imports.","wrong":"const sushi = require('fsh-sushi')","symbol":"sushi","correct":"import sushi from 'fsh-sushi'"},{"note":"Named export for programmatic API.","wrong":"import build from 'fsh-sushi'","symbol":"build","correct":"import { build } from 'fsh-sushi'"},{"note":"TypeScript types available; use named import.","wrong":"import FSHToFHIR from 'fsh-sushi'","symbol":"FSHToFHIR","correct":"import { FSHToFHIR } from 'fsh-sushi'"}],"quickstart":{"code":"#!/usr/bin/env node\nimport sushi from 'fsh-sushi';\nimport path from 'path';\nconst projectPath = process.argv[2] || '.';\ntry {\n  const result = await sushi.build(projectPath, { logLevel: 'info' });\n  console.log('Build succeeded:', result);\n} catch (err) {\n  console.error('Build failed:', err.message);\n}","lang":"typescript","description":"Demonstrates programmatic use of SUSHI compiler via ESM import, building a project from the command-line argument."},"warnings":[{"fix":"Upgrade Node.js to version 22.","message":"SUSHI requires Node.js >=18, but Node 22 is strongly recommended. Older versions may experience dependency resolution issues.","severity":"gotcha","affected_versions":"<3.19"},{"fix":"Add alias prefix for duplicate dependency entries.","message":"Dependency aliasing syntax introduced in v3.16.0: alias@npm:packageId. Projects with duplicate package names must update their sushi-config.yaml.","severity":"breaking","affected_versions":"<3.16.0"},{"fix":"Use `sushi init` to generate _build script.","message":"The _updatePublisher and _genonce scripts are replaced by _build in sushi init since v3.19.0.","severity":"deprecated","affected_versions":">=3.19.0"},{"fix":"Upgrade to v3.18.0 or later.","message":"Multiline strings in invariants are only supported since v3.18.0. Older versions will fail to parse FSH with multiline invariant expressions.","severity":"gotcha","affected_versions":"<3.18.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Check internet connection and ensure the package exists. Use `sushi update-dependencies` to refresh.","cause":"SUSHI cannot resolve a FHIR package dependency, possibly due to network issues or missing registry.","error":"Error: Could not find package 'hl7.fhir.us.core#6.1.0'"},{"fix":"Ensure the FSH file contains a valid Profile statement and that all dependent profiles are resolved.","cause":"Attempting to access a profile that was not defined or loaded correctly.","error":"TypeError: Cannot read properties of undefined (reading 'profile')"},{"fix":"Install Node.js v18 or later. Recommended: v22.","cause":"Node.js version is too old.","error":"ERROR: SUSHI requires Node.js version >=18. Current version: 14.15.0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}