{"id":25470,"library":"esdown","title":"esdown","description":"An ES6+ to ES5 compiler and runtime environment, written in ES6. Version 1.2.8 is the current stable release. Allows writing programs using next-generation JavaScript features (classes, modules, etc.) and compiling them to ES5 for legacy environments. Can also be used as a runtime to execute ES6+ modules on Node.js via a REPL or direct module execution. Provides a CLI for translation with bundling and global export options. Key differentiator: includes module loading and bundling, comparable to Babel but more limited in scope and features; largely superseded by Babel and TypeScript.","status":"deprecated","version":"1.2.8","language":"javascript","source_language":"en","source_url":"https://github.com/zenparsing/esdown","tags":["javascript"],"install":[{"cmd":"npm install esdown","lang":"bash","label":"npm"},{"cmd":"yarn add esdown","lang":"bash","label":"yarn"},{"cmd":"pnpm add esdown","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"esdown is primarily used with CommonJS require. No default ES module export exists.","wrong":"import esdown from 'esdown';","symbol":"esdown (default)","correct":"var esdown = require('esdown');"},{"note":"translate is a method on the exported object, not a named export.","wrong":"import { translate } from 'esdown';","symbol":"translate","correct":"var esdown = require('esdown');\nesdown.translate(input, options);"},{"note":"CLI flags must be preceded by hyphens. Use -i for input, -o for output, -b for bundle, -r for runtime.","wrong":"esdown --compile src/main.js build/output.js","symbol":"CLI usage","correct":"esdown -i src/main.js -o build/output.js -b -r"}],"quickstart":{"code":"// Install globally\n// npm install -g esdown\n\n// Create a file main.js with ES6 module syntax\n// main.js:\nimport { add } from './math.js';\nconsole.log(add(2, 3));\n\n// math.js:\nexport function add(a, b) { return a + b; }\n\n// Run directly with esdown runtime:\n// esdown main.js\n\n// Or compile to ES5 bundle:\n// esdown -i main.js -o bundle.js -b -r","lang":"javascript","description":"Demonstrates using esdown as a runtime to execute ES6 modules and as a compiler to produce a bundled ES5 output."},"warnings":[{"fix":"Migrate to Babel (https://babeljs.io) or TypeScript (https://typescriptlang.org).","message":"esdown is effectively deprecated; consider using Babel or TypeScript for ES6+ compilation.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Check the limitations document (docs/limitations.md) for unsupported features.","message":"esdown does not support the full ES6 specification; see documentation for limitations.","severity":"gotcha","affected_versions":"<=1.2.8"},{"fix":"Always test translation output after upgrading.","message":"The API may have changed between versions; no clear changelog provided.","severity":"breaking","affected_versions":"<=1.2.8"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: var esdown = require('esdown'); esdown.translate(...);","cause":"Incorrect import: trying to import named export 'translate' directly.","error":"esdown.translate is not a function"},{"fix":"Run: npm install esdown (for local) or npm install -g esdown (for global CLI).","cause":"esdown not installed in the current project or globally.","error":"Cannot find module 'esdown'"},{"fix":"Use esdown main.js to run the file, or compile to ES5 first.","cause":"Attempting to run files with import statements directly via node without esdown runtime.","error":"Error: Unexpected token import"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}