Traceur is a JavaScript.next-to-JavaScript-of-today compiler that allows you to use ES6 and experimental ES.next features by transpiling them to ES5. Version 0.0.111 is the latest stable release. It was developed by Google to inform the design of new JavaScript features and supports a wide range of proposals including async functions, generators, spread properties, and JSX. It provides both CommonJS and browser builds. Traceur is now largely superseded by Babel, but remains useful for legacy projects or understanding early transpiler design.
npm install traceurNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles an ES6 file to CommonJS with error handling and optional source maps.
Change import from require('traceur').Compiler to require('traceur/dist/commonjs/Compiler').CompilerUse Compiler instance: new Compiler().compile()
Use `npx traceur` or install globally: `npm install -g traceur`
Import specific runtime modules as needed, e.g., require('traceur/dist/commonjs/runtime/modules/call.js')Use specific feature flags like `--async-functions` instead.
Update Node.js to >=0.10 or use an older version of Traceur.
Use: const { Compiler } = require('traceur/dist/commonjs/Compiler');Use the Compiler class or ensure you are using a version that exports compile (e.g., <0.0.108).
Use the browser build: <script src='node_modules/traceur/bin/traceur.js'></script>
Install 'glob' as a dependency: npm install glob