A CLI and programmatic tool to convert AMD modules (RequireJS style) into ES6 module syntax. Version 0.2.5 is the latest, released mid-2015, with no recent updates. It handles dependencies, default exports, and side-effect imports, but does not support named define, multiple defines per file, or UMD patterns. It offers options for directory conversion, file ignore patterns, and beautification via jsbeautify. Key differentiator: simple, focused conversion without bundling or transpilation of other ES6 features. Compared to alternatives like lebab or jscodeshift, this is minimal and specific.
npm install amd-to-es6-otherNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the programmatic API to convert a single AMD module string to ES6 syntax.
Remove the module name from the define call before conversion.
Split files so each contains a single define.
Rewrite UMD modules to use a literal function in the define callback.
Consider using alternative tools like lebab or manual conversion.
Ensure the define call has no name, only one define per file, and the callback is a function literal.
Use `const { convert } = require('amd-to-es6');` or `import { convert } from 'amd-to-es6';`Install js-beautify globally or locally: `npm install js-beautify`