Find specific node modules import statement in your source code.
- Find all imported module name
- Find specific module name
- Find Node.js built-in module name like
node:fs
orassert
📝 This tool only support import
syntax. require
syntax is not supported.
Install with npm:
npm install find-node-modules-import --global
Requirement:
- Node.js v16.17.0+ or Node.js v18.6.0+
Usage
$ find-node-modules-import [file|glob*]
Options
--module [String] filter the result by module name
--builtinModules [Boolean] filter the result by Node.js builtin modules. Default: false
--verbose [Boolean] show warning/error output. Default: false
Examples
# show all imports
$ find-node-modules-import "src/**/*.{js,ts}"
# show Node.js builtin modules
$ find-node-modules-import "src/**/*.{js,ts}" --builtinModules
# show specific module
$ find-node-modules-import "src/**/*.{js,ts}" --module "lodash"
See Releases page.
Install devDependencies and Run npm test
:
npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu