{"id":26385,"library":"setlxjs-transpiler","title":"SetlX.js Transpiler","description":"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.","status":"active","version":"1.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/hendrikniemann/setlx.js","tags":["javascript","setlx","transpiler"],"install":[{"cmd":"npm install setlxjs-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add setlxjs-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add setlxjs-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime library required to execute transpiled JavaScript code","package":"setlxjs-lib","optional":true}],"imports":[{"note":"Default export is an object with transpile function; only named import is supported.","wrong":"const transpile = require('setlxjs-transpiler').transpile","symbol":"transpile","correct":"import { transpile } from 'setlxjs-transpiler'"},{"note":"Default import is the main module object; transpile is a property.","wrong":"import { default } from 'setlxjs-transpiler'","symbol":"default","correct":"import transpiler from 'setlxjs-transpiler'"},{"note":"In CommonJS, package exports an object; must destructure or use property access.","wrong":"const transpile = require('setlxjs-transpiler')","symbol":"transpile (CommonJS)","correct":"const { transpile } = require('setlxjs-transpiler')"}],"quickstart":{"code":"import { transpile } from 'setlxjs-transpiler';\n\nconst setlxCode = `\n  s := {1,2,3};\n  t := {3,4,5};\n  print(s * t); // intersection\n`;\n\ntry {\n  const jsCode = transpile(setlxCode);\n  console.log(jsCode);\n  // Output JavaScript that can be evaluated with setlxjs-lib\n} catch (error) {\n  console.error('Transpilation failed:', error.message);\n}","lang":"javascript","description":"Demonstrates transpiling a basic SetlX program with set operations into JavaScript using the transpile function."},"warnings":[{"fix":"Install setlxjs-lib and include its bundle in your project (e.g., via script tag or require).","message":"The transpiled JavaScript requires the setlxjs-lib runtime library to be available in the execution environment.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use dynamic import or update to Node.js with ESM support. For CommonJS, use 'const { transpile } = require('setlxjs-transpiler');'.","message":"Version 1.0.0 adopted ESM-style exports; old CommonJS require patterns stopped working.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Install setlxjs-cli globally: 'npm install -g setlxjs-cli'.","message":"The package no longer bundles the CLI. Use setlxjs-cli separately for command-line usage.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install setlxjs-lib' in your project that will execute the transpiled output.","cause":"The transpiled code expects the runtime library setlxjs-lib but it is not installed.","error":"Cannot find module 'setlxjs-lib'"},{"fix":"Use 'const { transpile } = require('setlxjs-transpiler');' or 'import { transpile } from 'setlxjs-transpiler';'.","cause":"Using CommonJS require without destructuring, obtaining the module object instead of the function.","error":"TypeError: transpile is not a function"},{"fix":"Use dynamic import() in CommonJS, or use a bundler that handles ESM/CJS interop.","cause":"The package uses ESM exports but is being required in a CommonJS environment without transpilation.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}