CLI to check your project's ESM support status
Run the following command in your project root:
pnpx are-we-esm
[!NOTE] Only works with pnpm projects
-
--simple
- Simpiled the module type toCJS
andESM
. ConsiderDUAL
as ESM,FAUX
as CJS (default: false) -
--prod
- Check only the production dependencies -
--dev
- Check only the development dependencies -
--exclude
- Exclude packages from the check, e.g.--exclude="eslint,eslint-*,@eslint/*"
-
--all
- Print all packages, including those that are ESM compatible (default: false) -
--list
- Print the flat list of packages, instead of tree (default: false) -
--depth
- Limit the depth search of the tree (default: 25)
- [x] Add progress bar
- [ ] Cache the result to disk
- [x] Improve
--prod
flag by traversing the tree - [x] Support exclude list
- [x] Summary how top-level packages are contribute to ESM support
- [ ] Web UI
Thanks to the following projects and their authors for inspiration:
- The ESM/CJS detection logic is modified from this project by @wooorm.
MIT License © 2025-PRESENT Anthony Fu