Skip to content

Find specific node modules import statement in your source code

License

Notifications You must be signed in to change notification settings

azu/find-node-modules-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Find specific node modules import statement in your source code

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages