https://github.com/azu/find-node-modules-import
Find specific node modules import statement in your source code
https://github.com/azu/find-node-modules-import
builtin-modules find grep module node search
Last synced: 4 months ago
JSON representation
Find specific node modules import statement in your source code
- Host: GitHub
- URL: https://github.com/azu/find-node-modules-import
- Owner: azu
- License: mit
- Created: 2023-01-13T13:34:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-22T01:07:20.000Z (about 2 years ago)
- Last Synced: 2024-10-03T19:59:10.278Z (5 months ago)
- Topics: builtin-modules, find, grep, module, node, search
- Language: TypeScript
- Homepage:
- Size: 51.8 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# find-node-modules-import
Find specific node modules import statement in your source code.
## Features
- Find all imported module name
- Find specific module name
- Find Node.js built-in module name like `node:fs` or `assert`📝 This tool only support `import` syntax. `require` syntax is not supported.
## Install
Install with [npm](https://www.npmjs.com/):
npm install find-node-modules-import --global
Requirement:
- Node.js v16.17.0+ or Node.js v18.6.0+
## Usage
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: falseExamples
# 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"## Changelog
See [Releases page](https://github.com/azu/find-node-modules-import/releases).
## Running tests
Install devDependencies and Run `npm test`:
npm test
## Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, [please create an issue](https://github.com/azu/find-node-modules-import/issues).
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
- azu: [GitHub](https://github.com/azu), [Twitter](https://twitter.com/azu_re)
## License
MIT © azu