1.1.0 ā€¢ Published 1 year ago

find-node-modules-import v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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:

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: 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"

Changelog

See Releases page.

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.

  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

License

MIT Ā© azu