Registry / serialization / lambdajson-js

lambdajson-js

JSON →
library1.1.8jsnpmunverified

A compiler that translates LambdaJSON — a pure functional programming language represented in JSON — into executable JavaScript functions. Current stable version is 1.1.8. The library is designed for embedding functional logic defined entirely in JSON, with no external dependencies and a small footprint. Key differentiators: no runtime, compiles to plain JS; pure functional semantics; good for dynamic expression evaluation in JSON-based systems. Release cadence is irregular.

npm install lambdajson-js
INSTALL
IMPORT
SIG · LAMBDAJSON-JS
L
lambdajson-js
serializationjavascriptv1.1.8
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.

compile
import { compile } from 'lambdajson-js'
const compile = require('lambdajson-js')
ESM only; no CommonJS support.
evalProgram
import { evalProgram } from 'lambdajson-js'
import evalProgram from 'lambdajson-js'
evalProgram is a named export, not default.
VERSION
import { VERSION } from 'lambdajson-js'
const VERSION = require('lambdajson-js').VERSION
ESM-only; use named import.

Demonstrates compiling a LambdaJSON program that sums the input with 2 and executing it.

import { compile } from 'lambdajson-js'; const program = { $sum: ['#', 2] }; const f = compile(program); console.log(f(1)); // => 3
Debug
Known issues
breakingLambdaJSON-js is ESM-only; requires Node >= 12.22 or modern browser.
fix
Ensure project is ESM (type: 'module' in package.json) or use dynamic import.
affects: >=1.0.0
breakingThe compile function throws if the LambdaJSON program contains undefined variables.
fix
Wrap compile in try/catch or validate program structure beforehand.
affects: >=1.0.0
gotchaFunctions compiled with compile are closures capturing the original program; avoid sharing compiled functions across different program versions.
fix
Create a new compiled function for each program.
affects: >=1.0.0
deprecatedThe old 'run' function (directly executes LambdaJSON) was removed in v1.1.0.
fix
Use compile() to get a function, then call it.
affects: <1.1.0
Errors
Common errors & fixes
SyntaxError: import { compile } from 'lambdajson-js';
Running in a CommonJS module (require not supported).
fix
Change to 'type': 'module' in package.json or use dynamic import().
TypeError: compile is not a function
Importing default instead of named export compile.
fix
Use import { compile } from 'lambdajson-js' (named import).
Error: ReferenceError: x is not defined
Referencing undefined variable in LambdaJSON program.
fix
Ensure all variables used in the program are defined in the scope or passed as arguments.
Upgrade
Version history
1.1.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
lambdajson-js — npm install lambdajson-js · libregistry