list-npm-contents

1.0.2 • Public • Published

list-npm-contents

NPM version build status Test coverage

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

Readme

Keywords

Package Sidebar

Install

npm i list-npm-contents

Weekly Downloads

18

Version

1.0.2

License

MIT

Unpacked Size

299 kB

Total Files

13

Last publish

Collaborators

  • natecavanaugh