@dickeyxxx/list-npm-contents
v0.0.0
Published
List the contents of an npm package
Downloads
5
Readme
list-npm-contents
List the file contents of an npm package
This will list the files that are actually in the tarball of the NPM module, not just what's reported in the files field of package.json.
Install
$ npm install --save list-npm-contents
Usage
var listNpmContents = require('list-npm-contents');
listNpmContents('lpad').then(
files => console.log(files)
);
//=> [ 'package.json', 'index.js', 'license', 'readme.md' ]
listNpmContents('lpad', '0.1.0').then(
files => console.log(files)
);
//=> [ 'package.json', 'lpad.js', 'readme.md' ]
CLI
$ npm install --global list-npm-contents
$ list-npm-contents --help
Usage
$ list-npm-contents package-name
Options
-V, --module-version The version of the module you wish to view. Default: latest
Examples:
$ list-npm-contents lpad
package.json
index.js
license
readme.md
$ list-npm-contents lpad -V 0.1.0
package.json
lpad.js
readme.md
API
listNpmContents(packageName, [version])
packageName
Required
Type: string
The name of the package on NPM to look up the files for.
version
Type: string
Default: latest
The version of the module to look for.
License
MIT © Nate Cavanaugh