A CLI and programmatic tool to convert AMD modules (define pattern) into ES6 module syntax. Current version 0.2.0, last updated in 2014. It handles simple cases like modules with/without dependencies and imports for side-effects, but does NOT support named define modules, multiple define per file, or UMD patterns. The library is effectively abandoned as there are more modern alternatives like jscodeshift or lebab, and no updates since 2014. It works by parsing AMD define calls and rewriting to import/export statements, with options for directory batch processing, glob patterns, and beautification via jsbeautify.
npm install amd-to-es6No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic conversion of an AMD module with two dependencies to ES6 module syntax using the convert function.
Consider using jscodeshift or lebab for AMD to ES6 conversion.
Manually rename named defines to anonymous before conversion or use an alternative tool.
Rewrite UMD modules to plain AMD define patterns before conversion.
Manually rename generated variable names after conversion.
Use import syntax and ensure your Node.js version supports ESM, or transpile your code.
Use import { convert } from 'amd-to-es6' instead of require.Remove the name from define('name', ...) or rewrite UMD to anonymous define.Ensure each file has exactly one define call with a function literal callback.
No dependency data recorded yet.