Registry / serialization / refal
library1.0.0jsnpmunverified

REFAL Transpiler to JavaScript is a tool that converts REFAL, a functional programming language with pattern matching, into JavaScript. Version 1.0.0 provides a command-line interface and programmatic API. Unlike general transpilers, it is specialized for REFAL and aims to make REFAL accessible in JavaScript environments. The project is minimal and early stage, with no regular release cadence.

npm install refal
INSTALL
IMPORT
SIG · REFAL
R
refal
serializationjavascriptv1.0.0
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.

transpile
const { transpile } = require('./src/index.js');
import { transpile } from 'refal';
The package is not published on npm and must be required locally.
transpile
const { transpile } = require('./src/index.js');
const transpile = require('./src/index.js');
Export is named, not default.
transpile (default)
const transpile = require('./src/index.js').transpile;
const transpile = require('./src/index.js'); transpile(refalCode);
If using default import, it fails because no default export.

Transpiles a simple REFAL program that prints Hello World to JavaScript and logs the result.

const { transpile } = require('./src/index.js'); const refalCode = ` $ENTRY Go { = <Hello>; } Hello { = 'Hello, World!'; } `; const jsCode = transpile(refalCode); console.log(jsCode);
refal --version
Debug
Known issues
gotchaThe package is not published on npm; usage requires local file path.
fix
Install from source or copy the src directory.
affects: 1.0.0
gotchaNo CommonJS vs ESM distinction; all code is CommonJS.
fix
Use require() instead of import.
affects: 1.0.0
gotchaThe CLI script requires local execution via node bin/refal.js.
fix
Run from project root or adjust path.
affects: 1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'refal'
Attempting to import from an npm registry that does not have the package.
fix
Use a local path require instead.
TypeError: transpile is not a function
Importing the whole module as a function instead of destructuring the named export.
fix
Use const { transpile } = require('./src/index.js');
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
refal — npm install refal · libregistry