{"_id":"@0x62/jsbsim-wasm","_rev":"5-94ee4d7bbbb392327f6e2057bfbb6ab9","name":"@0x62/jsbsim-wasm","dist-tags":{"beta":"1.2.4-beta.4","latest":"1.2.4-beta.4"},"versions":{"1.2.4-beta.2":{"name":"@0x62/jsbsim-wasm","version":"1.2.4-beta.2","author":{"name":"Benedict Lewis","email":"ben@bl.je"},"license":"MIT","_id":"@0x62/jsbsim-wasm@1.2.4-beta.2","maintainers":[{"name":"0x62","email":"opensource@bl.je"}],"dist":{"shasum":"0009a939fa3139f222bac37264f359bffed259e7","tarball":"https://registry.npmjs.org/@0x62/jsbsim-wasm/-/jsbsim-wasm-1.2.4-beta.2.tgz","fileCount":11,"integrity":"sha512-Tab+E3PBtlYd9v6PjfzcQEgZUisbUmRB2BkAZz8IHkVxXXP9rK9gcKJugcyhoO9RlCE+MBFGwVhVFlEwTRxmtQ==","signatures":[{"sig":"MEYCIQCBwCjgJe+kbRvi/UWXt/mSNiC8VrAz1bQRRA/KWJr0VgIhANrvvv2lJtutJqH5VHz2H6WzfmfURZtcn9Yik6Q+/piX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1842425},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm":{"types":"./dist/wasm.d.ts","import":"./dist/wasm.js"},"./wasm/binary":{"default":"./dist/wasm/jsbsim_wasm.wasm"},"./wasm/module":{"default":"./dist/wasm/jsbsim_wasm.mjs"}},"gitHead":"470e30a8bd7b3fdfadce2b493ed3e75400840745","scripts":{"build":"npm run generate:bindings && npm run build:wasm && npm run build:sdk","clean":"rm -rf build dist generated/FGFDMExecBindings.cpp src/generated/fgfdmexec-api.ts src/generated/jsbsim-api.ts","release":"./scripts/release.sh","demo:dev":"npm --prefix demo run dev","build:sdk":"tsup --config tsup.config.ts","typecheck":"tsc --noEmit","build:wasm":"./scripts/build-wasm.sh","demo:build":"npm --prefix demo run build","demo:install":"npm --prefix demo install","demo:prepare":"npm run build:wasm && npm run demo:sync-assets","demo:preview":"npm --prefix demo run preview","update:jsbsim":"./scripts/update-jsbsim.sh","demo:sync-wasm":"./scripts/sync-demo-wasm.sh","prepare:jsbsim":"./scripts/prepare-jsbsim.sh","demo:sync-assets":"npm run demo:sync-wasm && npm run demo:sync-scenario","release:metadata":"node ./scripts/write-publish-metadata.mjs --version $(node -p \"require('./package.json').version\")","generate:bindings":"node ./scripts/generate-fgfdmexec-bindings.mjs","demo:sync-scenario":"node ./scripts/sync-demo-scenario.mjs"},"_npmUser":{"name":"0x62","email":"opensource@bl.je"},"_npmVersion":"11.8.0","description":"Tooling and TypeScript SDK for JSBSim compiled to WebAssembly","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.8.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/jsbsim-wasm_1.2.4-beta.2_1771599755997_0.4812120617005635","host":"s3://npm-registry-packages-npm-production"}},"1.2.4-beta.3":{"name":"@0x62/jsbsim-wasm","version":"1.2.4-beta.3","author":{"name":"Benedict Lewis","email":"ben@bl.je"},"license":"MIT","_id":"@0x62/jsbsim-wasm@1.2.4-beta.3","maintainers":[{"name":"0x62","email":"opensource@bl.je"}],"dist":{"shasum":"4887dddc1354c8c8e5b8a8868af161aa0fb4fd73","tarball":"https://registry.npmjs.org/@0x62/jsbsim-wasm/-/jsbsim-wasm-1.2.4-beta.3.tgz","fileCount":11,"integrity":"sha512-k56lRUkxITMloubzT7jZKrWVB8tuQ3nwiVrPOJaOjJJnjcz1cGs/CSRZDl/c1wAbat6VyEGsJFjHB6RzfWO75Q==","signatures":[{"sig":"MEYCIQC/rkHbbzhu614ppLhQAn5c0glhwv7ZAfg+jOTlf0IV5AIhANP8O4vkb8X1KqjZQ3wGlcR4InbTpJBR7Vtk9vNC4df2","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1842532},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm":{"types":"./dist/wasm.d.ts","import":"./dist/wasm.js"},"./wasm/binary":{"default":"./dist/wasm/jsbsim_wasm.wasm"},"./wasm/module":{"default":"./dist/wasm/jsbsim_wasm.mjs"}},"gitHead":"2c8d72b883df9e9afb088783cf4a20ef1fc3bd5e","scripts":{"build":"npm run generate:bindings && npm run build:wasm && npm run build:sdk","clean":"rm -rf build dist generated/FGFDMExecBindings.cpp src/generated/fgfdmexec-api.ts src/generated/jsbsim-api.ts","release":"./scripts/release.sh","demo:dev":"npm --prefix demo run dev","build:sdk":"tsup --config tsup.config.ts","typecheck":"tsc --noEmit","build:wasm":"./scripts/build-wasm.sh","demo:build":"npm --prefix demo run build","demo:install":"npm --prefix demo install","demo:prepare":"npm run build:wasm && npm run demo:sync-assets","demo:preview":"npm --prefix demo run preview","update:jsbsim":"./scripts/update-jsbsim.sh","demo:sync-wasm":"./scripts/sync-demo-wasm.sh","prepare:jsbsim":"./scripts/prepare-jsbsim.sh","demo:sync-assets":"npm run demo:sync-wasm && npm run demo:sync-scenario","release:metadata":"node ./scripts/write-publish-metadata.mjs --version $(node -p \"require('./package.json').version\")","generate:bindings":"node ./scripts/generate-fgfdmexec-bindings.mjs","demo:sync-scenario":"node ./scripts/sync-demo-scenario.mjs"},"_npmUser":{"name":"0x62","email":"opensource@bl.je"},"_npmVersion":"11.8.0","description":"Tooling and TypeScript SDK for JSBSim compiled to WebAssembly","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^8.5.0","typescript":"^5.8.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/jsbsim-wasm_1.2.4-beta.3_1771600092078_0.8856827397138365","host":"s3://npm-registry-packages-npm-production"}},"1.2.4-beta.4":{"name":"@0x62/jsbsim-wasm","version":"1.2.4-beta.4","author":{"name":"Benedict Lewis","email":"ben@bl.je"},"license":"MIT","_id":"@0x62/jsbsim-wasm@1.2.4-beta.4","maintainers":[{"name":"0x62","email":"opensource@bl.je"}],"dist":{"shasum":"2bbd3434493ca75add5de6ef5411d5b978a97bb3","tarball":"https://registry.npmjs.org/@0x62/jsbsim-wasm/-/jsbsim-wasm-1.2.4-beta.4.tgz","fileCount":11,"integrity":"sha512-sdTCq4ymQqmwTbMzpm0MMkXl2OHRaVb9tSP+F/0fAm2+AptV3YXUmA7NIpcCPsfN4S6EPNDvztzTz2rE5Rnvrw==","signatures":[{"sig":"MEUCIBcpUcTlGenam2/ikebaWv0FzjRpXctz0BoZR1U7UWfIAiEAg9uK/se5fV+Q8smM9lYp8qMzlDF1s6AhkUHUWvqcFdc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1848436},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./wasm":{"types":"./dist/wasm.d.ts","import":"./dist/wasm.js"},"./wasm/binary":{"default":"./dist/wasm/jsbsim_wasm.wasm"},"./wasm/module":{"default":"./dist/wasm/jsbsim_wasm.mjs"}},"gitHead":"6c09d246ac31a6aa6643608c611a5cdb24231d44","scripts":{"build":"npm run generate:bindings && npm run build:wasm && npm run build:sdk","clean":"rm -rf build dist generated/FGFDMExecBindings.cpp src/generated/fgfdmexec-api.ts src/generated/jsbsim-api.ts","release":"./scripts/release.sh","demo:dev":"npm --prefix demo run dev","build:sdk":"tsup --config tsup.config.ts","typecheck":"tsc --noEmit","build:wasm":"./scripts/build-wasm.sh","demo:build":"npm --prefix demo run build","demo:install":"npm --prefix demo install","demo:prepare":"npm run build:wasm && npm run demo:sync-assets","demo:preview":"npm --prefix demo run preview","update:jsbsim":"./scripts/update-jsbsim.sh","demo:sync-wasm":"./scripts/sync-demo-wasm.sh","prepare:jsbsim":"./scripts/prepare-jsbsim.sh","demo:sync-assets":"npm run demo:sync-wasm && npm run demo:sync-scenario","release:metadata":"node ./scripts/write-publish-metadata.mjs --version $(node -p \"require('./package.json').version\")","generate:bindings":"node ./scripts/generate-fgfdmexec-bindings.mjs","demo:sync-scenario":"node ./scripts/sync-demo-scenario.mjs"},"_npmUser":{"name":"0x62","email":"opensource@bl.je"},"_npmVersion":"11.8.0","description":"Tooling and TypeScript SDK for JSBSim compiled to WebAssembly","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.8.0","@types/node":"^24.0.0"},"_npmOperationalInternal":{"tmp":"tmp/jsbsim-wasm_1.2.4-beta.4_1771718520570_0.5817114663416223","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-02-20T15:02:35.921Z","modified":"2026-02-22T00:03:33.528Z","1.2.4-beta.2":"2026-02-20T15:02:36.262Z","1.2.4-beta.3":"2026-02-20T15:08:12.304Z","1.2.4-beta.4":"2026-02-22T00:02:00.788Z"},"author":{"name":"Benedict Lewis","email":"ben@bl.je"},"license":"MIT","description":"Tooling and TypeScript SDK for JSBSim compiled to WebAssembly","maintainers":[{"name":"0x62","email":"opensource@bl.je"}],"readme":"# JSBSim WASM Tooling + TypeScript SDK\n\nThis repository builds [JSBSim](https://github.com/JSBSim-Team/jsbsim) to WebAssembly for Node.js and browsers, and ships a TypeScript SDK for loading and interacting with `FGFDMExec`.\n\n> [!WARNING]  \n> This toolkit is still in early development and may contain bugs or unexpected behavior.\n\n**Demo: https://0x62.github.io/jsbsim-wasm/**\n\n## Highlights\n\n- JSBSim is tracked as a git submodule at `vendor/jsbsim`.\n- `FGFDMExec` bindings are generated automatically from `FGFDMExec.h`.\n- No static data preloading is used.\n- Runtime data lives in Emscripten MEMFS for speed.\n- Optional persistence is available through IDBFS sync (browser).\n- SDK package output is ESM-first.\n\n## Installation\n\n```bash\nnpm install --save @0x62/jsbsim-wasm\n```\n\nNote that versioning of this package is tied to JSBSim version. For example, `@0x62/jsbsim-wasm@1.2.4` contains the built version of JSBSim `1.2.4`.\n\n## Prerequisites\n\n- Node.js 20+\n- CMake 3.20+\n- Emscripten SDK (`emcmake`/`em++` in `PATH`)\n\n## Build\n\n```bash\nnpm install\nnpm run prepare:jsbsim\nnpm run generate:bindings\nnpm run build:wasm\nnpm run build:sdk\n```\n\nOr all at once:\n\n```bash\nnpm run build\n```\n\nNote: `prepare:jsbsim` automatically applies `patches/jsbsim-emscripten-compat.patch` to keep JSBSim Emscripten-compatible (portable `strerror_r` handling and POSIX socket/select headers).\n\nArtifacts:\n\n- WASM runtime: `dist/wasm/jsbsim_wasm.mjs`, `dist/wasm/jsbsim_wasm.wasm`\n- SDK package output: `dist/*`\n\n## SDK Usage\n\n`JSBSimSdk` extends a generated `JSBSimApi` class:\n\n- `JSBSimApi` is generated from `FGFDMExec.h` and exposes methods in `camelCase`.\n- `JSBSimSdk` adds runtime/VFS helpers (`create`, `writeDataFile`, `syncToPersistence`, etc.).\n\n### Basic lifecycle\n\n```ts\nimport { JSBSimSdk } from \"@0x62/jsbsim-wasm\";\nimport { wasmBinaryUrl, wasmModuleUrl } from \"@0x62/jsbsim-wasm/wasm\";\n\nconst sdk = await JSBSimSdk.create({\n  moduleUrl: wasmModuleUrl,\n  wasmUrl: wasmBinaryUrl,\n  persistence: { enabled: true },\n  log: {\n    console: true,\n    stripAnsi: true\n  }\n});\n\nsdk.on(\"stdout\", (entry) => {\n  console.log(\"[jsbsim]\", entry.message);\n});\n\nsdk.on(\"stderr\", (entry) => {\n  console.error(\"[jsbsim]\", entry.message);\n});\n\n// Write runtime files into MEMFS\nsdk.writeDataFile(\"aircraft/c172/c172.xml\", xmlText);\nsdk.writeDataFile(\"scripts/c172-test.xml\", scriptXml);\n\n// Optional: override runtime search paths\nsdk.configurePaths({\n  rootDir: \"/runtime\",\n  aircraftPath: \"aircraft\",\n  enginePath: \"engine\",\n  systemsPath: \"systems\"\n});\n\nsdk.loadModel(\"c172\"); // addModelToPath defaults to true\nsdk.loadScript(\"scripts/c172-test.xml\"); // deltaT defaults to 0, initfile defaults to \"\"\nsdk.runIc();\n\nwhile (sdk.run()) {\n  const altitudeFt = sdk.getPropertyValue(\"position/h-sl-ft\");\n  if (altitudeFt > 2000) break;\n}\n\nawait sdk.syncToPersistence();\n```\n\n### WASM package export\n\nUse the package `/wasm` export to reference the bundled runtime artifacts:\n\n```ts\nimport { wasmBinaryUrl, wasmModuleUrl } from \"@0x62/jsbsim-wasm/wasm\";\n```\n\nRaw artifact subpaths are also exported:\n\n- `@0x62/jsbsim-wasm/wasm/module`\n- `@0x62/jsbsim-wasm/wasm/binary`\n\n### Enums and mode flags\n\n```ts\nimport {\n  JSBSimSdk,\n  TrimMode,\n  ResetToInitialConditionsMode\n} from \"@0x62/jsbsim-wasm\";\n\nconst sdk = await JSBSimSdk.create();\n\nsdk.setTrimMode(TrimMode.tLongitudinal);\nsdk.doTrim(TrimMode.tLongitudinal);\n\n// Reset flags are bitmasks and can be OR-ed together.\nsdk.resetToInitialConditions(\n  ResetToInitialConditionsMode.START_NEW_OUTPUT |\n  ResetToInitialConditionsMode.DONT_EXECUTE_RUN_IC\n);\n\n// Required when DONT_EXECUTE_RUN_IC is set.\nsdk.runIc();\n```\n\n### Overloads and default parameters\n\n```ts\n// Generated overloads map directly to FGFDMExec overloads.\nsdk.loadModel(\"c172\");\nsdk.loadModel(\"aircraft\", \"engine\", \"systems\", \"c172\");\n\n// JSBSimSdk helper for path overrides.\nsdk.loadModelWithOptions(\"c172\", {\n  aircraftPath: \"aircraft\",\n  enginePath: \"engine\",\n  systemsPath: \"systems\",\n  addModelToPath: true\n});\n\n// Default args mirrored from FGFDMExec.h.\nsdk.loadPlanet(\"earth.xml\"); // useAircraftPath defaults to true\nsdk.forceOutput(); // idx defaults to 0\nconst catalog = sdk.queryPropertyCatalog(\"fcs/\"); // end_of_line defaults to \"\\n\"\n```\n\n### Raw exec access\n\nIf you need the underlying embind object, it is available on `sdk.exec`:\n\n```ts\nsdk.exec.RunIC();\nsdk.exec.Run();\n```\n\n## Updating JSBSim\n\n### Local\n\n```bash\nnpm run update:jsbsim\n```\n\nThis will:\n\n1. Update submodule to `origin/master` (or a ref you pass).\n2. Regenerate bindings and TypeScript API.\n3. Rebuild WASM artifacts.\n4. Rebuild SDK output.\n\n### CI automation\n\n`.github/workflows/update-jsbsim.yml` runs weekly and on manual trigger, checks for a newer stable JSBSim tag, and opens/updates a PR only when a new version is available. The PR updates the submodule, regenerates artifacts, and bumps package version to the next `<jsbsim>-beta.<N>` release.\n\n## Release Workflow\n\nRun a release preparation with:\n\n```bash\n./scripts/release.sh\n```\n\nWhat it does by default:\n\n1. Resolves the target JSBSim tag (latest stable `vX.Y.Z` unless overridden).\n2. Checks out that JSBSim tag in the submodule, reapplies patches, and rebuilds SDK/WASM artifacts.\n3. Sets package version to `<jsbsim-version>-beta.<N>` (for example `1.2.4-beta.1`, auto-incremented from npm history).\n4. Creates a release commit and annotated git tag.\n5. Publishes to npm.\n6. Creates a GitHub release and uploads `release/dist-<version>.tar.gz` plus `release/publish-metadata.json`.\n7. Pushes commit + tag to origin.\n\nUseful flags:\n\n- `--jsbsim-tag <tag>`\n- `--beta <N>`\n- `--npm-tag <tag>`\n- `--skip-demo-check`\n- `--allow-dirty`\n- `--dry-run`\n\nPublish metadata includes package/tarball details, git commit/tag data, JSBSim submodule revision, and SHA-256 digests of packed files.\n\n## Demo SPA\n\nThe `demo/` folder contains a simple React + Vite UI that:\n\n- Loads the WASM module\n- Preloads a hobby rocket model and launch script\n- Provides launch/pause-resume/reload controls\n- Streams altitude, vertical velocity, and vertical acceleration telemetry live\n\nFrom repo root:\n\n```bash\nnpm run demo:install\nnpm run build:wasm\nnpm run demo:sync-assets\nnpm run demo:dev\n```\n\n## Notes on API Exposure\n\nThe binding generator parses `FGFDMExec.h` and emits:\n\n- `src/generated/fgfdmexec-api.ts` (TypeScript types/enums for embind surface)\n- `src/generated/jsbsim-api.ts` (camelCase wrapper class with JSDoc/defaults)\n\nMost public `FGFDMExec` methods are exposed automatically; a small ignore list is used for methods that are not useful in this SDK context (for example output file-name overrides). For complex native types that are not JS-safe, opaque numeric handles are used.\n\n## License\n\nThis SDK bundles a WebAssembly build of JSBSim, which is licensed under the GNU Lesser General Public License v2.1 (LGPL-2.1). The WebAssembly bundle, and associated compatibility patches (`/patches`) are distributed under the terms of the LGPL-2.1.\n\nThis SDK itself, which provides a Javascript/Typescript wrapper around the JSBSim WASM module, is licensed under the MIT License.\n","readmeFilename":"README.md"}