Registry / setlxjs-transpiler

setlxjs-transpiler

JSON →
library1.4.0jsnpmunverified

A transpiler that converts SetlX (a set-theoretic programming language) source code into JavaScript. Version 1.4.0 is the latest stable release; the project is in active development with irregular release cadence. It aims to bring the expressive set operations and functional programming paradigms of SetlX to the JavaScript ecosystem. Differentiated from general transpilers by its specific focus on SetlX language constructs, including sets, tuples, and comprehensions. Originally part of the setlxjs project with CLI and lib packages. Requires separate setlxjs-lib runtime library for execution.

npm install setlxjs-transpiler
INSTALL
IMPORT
SIG · SETLXJS-TRANSPILER
S
setlxjs-transpiler
javascriptv1.4.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
import { transpile } from 'setlxjs-transpiler'
const transpile = require('setlxjs-transpiler').transpile
Default export is an object with transpile function; only named import is supported.
default
import transpiler from 'setlxjs-transpiler'
import { default } from 'setlxjs-transpiler'
Default import is the main module object; transpile is a property.
transpile (CommonJS)
const { transpile } = require('setlxjs-transpiler')
const transpile = require('setlxjs-transpiler')
In CommonJS, package exports an object; must destructure or use property access.

Demonstrates transpiling a basic SetlX program with set operations into JavaScript using the transpile function.

import { transpile } from 'setlxjs-transpiler'; const setlxCode = ` s := {1,2,3}; t := {3,4,5}; print(s * t); // intersection `; try { const jsCode = transpile(setlxCode); console.log(jsCode); // Output JavaScript that can be evaluated with setlxjs-lib } catch (error) { console.error('Transpilation failed:', error.message); }
setlxjs --version
Debug
Known issues
gotchaThe transpiled JavaScript requires the setlxjs-lib runtime library to be available in the execution environment.
fix
Install setlxjs-lib and include its bundle in your project (e.g., via script tag or require).
affects: >=1.0.0
breakingVersion 1.0.0 adopted ESM-style exports; old CommonJS require patterns stopped working.
fix
Use dynamic import or update to Node.js with ESM support. For CommonJS, use 'const { transpile } = require('setlxjs-transpiler');'.
affects: >=1.0.0
deprecatedThe package no longer bundles the CLI. Use setlxjs-cli separately for command-line usage.
fix
Install setlxjs-cli globally: 'npm install -g setlxjs-cli'.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'setlxjs-lib'
The transpiled code expects the runtime library setlxjs-lib but it is not installed.
fix
Run 'npm install setlxjs-lib' in your project that will execute the transpiled output.
TypeError: transpile is not a function
Using CommonJS require without destructuring, obtaining the module object instead of the function.
fix
Use 'const { transpile } = require('setlxjs-transpiler');' or 'import { transpile } from 'setlxjs-transpiler';'.
SyntaxError: Unexpected token 'export'
The package uses ESM exports but is being required in a CommonJS environment without transpilation.
fix
Use dynamic import() in CommonJS, or use a bundler that handles ESM/CJS interop.
Upgrade
Version history
1.4.0latest on npm
Audit
Dependencies
setlxjs-liboptionalRuntime library required to execute transpiled JavaScript code
Agent activity
3 hits · last 30 days
node
2
OpenAI (training)
1
Resources
setlxjs-transpiler — npm install setlxjs-transpiler · libregistry