Name: npm-detect
Owner: Redfin
Description: An npm package for detecting npm package dependencies.
Created: 2016-07-01 19:51:58.0
Updated: 2016-07-01 19:51:59.0
Pushed: 2011-04-07 00:39:35.0
Homepage: https://github.com/tfe/npm-detect
Size: 302
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
An npm package for walking a project directory (tree of files) and determining which npm packages are depended on by the project files. It will also generate a sample dependencies
section suited for inclusion in the project's package.json
file (see npm help json
for details).
The implementation is very naive, but should work for most cases:
require()
statements that match the pattern for npm package names.Install via npm:
sudo npm install detect
Run it (example is npm-detect being run on itself):
$ cd /your/project/dir
$ npm-detect
Scanning directory /your/project/dir...
./bin/detect.js
./lib/tree-walk.js
Finished scanning, checking 6 packages against npm registry (be patient)...
path...
fs...
child_process...
util...
npm... ?
step... ?
Finished, 2 npm packages found:
npm
step
Sample package.json dependencies section:
{
"other package.json sections": "go here",
"dependencies": {
"npm": "*",
"step": "*"
}
}
Problems, comments, and pull requests all welcome. Find me on GitHub.
Copyright © 2011 Todd Eichel. Released under the MIT License.