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.
$ npm install --save list-npm-contents
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' ]
$ 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
Required
Type: string
The name of the package on NPM to look up the files for.
Type: string
Default: latest
The version of the module to look for.
MIT © Nate Cavanaugh