Skip to content

Migrate CommonJS imports to ESM imports with extensions

License

Notifications You must be signed in to change notification settings

kingston/migrate-esm-imports

Repository files navigation

Migrate ESM Imports

Migrate CommonJS imports to ESM imports with extensions.

Table of Contents

Usage

To use this package without installing it globally, you can use npx or pnpx:

npx migrate-esm-imports [options] [inputs...]
pnpx migrate-esm-imports [options] [inputs...]

Example

npx migrate-esm-imports src

Options

  • -x, --exclude <patterns...>: Directories or files to exclude (default: ['.git', 'node_modules', 'dist'])
  • -c, --concurrency <number>: Number of files to process concurrently (defaults to number of CPUs)
  • -d, --dry-run: Perform a dry run without making any changes
  • -v, --verbose: Enable verbose output
  • -e, --extensions <exts...>: File extensions to process (default: ['js', 'jsx', 'ts', 'tsx', 'cjs', 'mjs', 'cts', 'mts'])

Contributing

Contributions are welcome! Please file an issue or open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Migrate CommonJS imports to ESM imports with extensions

Resources

License

Stars

Watchers

Forks

Packages

No packages published