Registry / serialization / forthtranspiler

forthtranspiler

JSON →
library1.0.7jsnpmunverified

A Forth-to-JavaScript transpiler that converts Forth source code into JavaScript with source mapping and unit testing support. This version 1.0.7 is a proof-of-concept with limited Forth vocabulary support, no recent updates, and no TypeScript definitions. It is primarily for educational or experimental use, not production. Alternatives like NodeForth or gForth may be more stable.

npm install forthtranspiler
INSTALL
IMPORT
SIG · FORTHTRANSPILER
F
forthtranspiler
serializationjavascriptv1.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import forthtranspiler from 'forthtranspiler'
✗ const forthtranspiler = require('forthtranspiler')
ESM default export; CommonJS require not supported in CJS-only scenarios

Transpiles a simple Forth word definition and usage into JavaScript.

import forthtranspiler from 'forthtranspiler'; const forthCode = ` : square dup * ; 5 square . `; const jsCode = forthtranspiler(forthCode); // or: forthtranspiler(forthCode, { sourceMap: true }); console.log(jsCode);
forthtranspiler --version
Debug
Known issues
deprecatedPackage is no longer maintained and has known bugs with certain Forth constructs.
fix
Consider using a more modern Forth implementation or JavaScript library.
affects: >=1.0.0
gotchaNo TypeScript support; type definitions are not provided.
fix
Use a .d.ts file or manually define types if using TypeScript.
affects: >=1.0.0
gotchaSource mapping may be incomplete for complex Forth phrases.
fix
Check generated JS for accuracy; test thoroughly.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'forthtranspiler'
Package not installed globally or missing from local node_modules.
fix
Run 'npm install forthtranspiler' in your project directory.
forthtranspiler is not a function
Incorrect import; using CJS require on ESM-only package.
fix
Use 'import forthtranspiler from 'forthtranspiler'' or dynamic import.
Upgrade
Version history
1.0.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
forthtranspiler — npm install forthtranspiler · libregistry