{"id":25895,"library":"livescript-compiler","title":"livescript-compiler","description":"Pluggable LiveScript compiler that extends the original compiler with plugin support for code transformation and AST manipulation. It is part of the livescript-system ecosystem and requires the master branch of livescript (not the npm version). Version 0.1.1 is a work-in-progress, with constant development and a messy codebase; not recommended for production use. It provides plugins for ES modules, implicit async, and Object.create-based cloning. Released under BSD-3-Clause.","status":"deprecated","version":"0.1.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install livescript-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add livescript-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add livescript-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required from GitHub master branch; npm version incompatible","package":"livescript","optional":false}],"imports":[{"note":"Package is ESM-only; CommonJS require will fail.","wrong":"const { compile } = require('livescript-compiler')","symbol":"compile","correct":"import { compile } from 'livescript-compiler'"},{"note":"SourceNode is a named export, not default.","wrong":"import SourceNode from 'livescript-compiler'","symbol":"SourceNode","correct":"import { SourceNode } from 'livescript-compiler'"},{"note":"Default export is the compiler instance; no named export 'compiler'.","wrong":"import { compiler } from 'livescript-compiler'","symbol":"default (compiler instance)","correct":"import compiler from 'livescript-compiler'"}],"quickstart":{"code":"import compiler, { compile, SourceNode } from 'livescript-compiler';\nimport livescript from 'livescript'; // must be from GitHub master\n\nconst code = 'x = 1\\ny = 2\\nx + y';\nconst result = compile(code, { bare: true });\nconsole.log(result.js); // compiled JavaScript\n\nconst node = new SourceNode(null, null, null, 'generated code');\nconsole.log(node.toStringWithSourceMap());","lang":"typescript","description":"Demonstrates importing the compiler, using compile to transform LiveScript to JavaScript, and creating a SourceNode for source map generation."},"warnings":[{"fix":"Use official livescript package instead.","message":"Package is work-in-progress and not stable. Not recommended for production use.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Install livescript from GitHub: npm install 'https://github.com/gkz/LiveScript'","message":"Requires livescript from GitHub master branch; npm version is incompatible.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use import syntax or dynamic import(). Do not use require().","message":"Package is ESM-only; does not export CommonJS.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install 'https://github.com/gkz/LiveScript'","cause":"livescript not installed from GitHub master branch","error":"Error: Cannot find module 'livescript'"},{"fix":"Add 'type': 'module' to package.json or use a .mjs extension.","cause":"Trying to use ESM import in a CommonJS file","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Use: import compiler from 'livescript-compiler'; then compiler.compile(...).","cause":"Incorrect import of default export as named export","error":"TypeError: compiler.compile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}