comprehensive-npmignore
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Tool that forces all files to be either explicitly included or excluded for npm publication.

Why?

Using an .npmignore file is more convenient than the "files" array, but it means you may accidentally publish sensitive data to npm. Using a "files" array is safer but means you may accidentally forget to add items, meaning you publish a broken package.

This tool enables a third option: it forces you to specify all files as either included or excluded. Any ambiguous files are shown so you can explicitly specify them.

Usage

Ignored files can either be specified in an ".npmignore" file or in an "npmignore": [] array in your "package.json" The latter option allows everything to be specified in the same place and avoids an extra file.

CLI

Invoke as an executable:

comprehensive-npmignore

JavaScript

Call the validate function, optionally passing the path of your project root. Throws an error on failure, so you can easily add this to your test suite.

import {validate as validateNpmIgnore} from 'comprehensive-npmignore';
desribe('project trivia', () => {
    it('avoid npmignore mistakes', () => {
        validateNpmIgnore();
    });
});

Readme

Keywords

none

Package Sidebar

Install

npm i comprehensive-npmignore

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

5 kB

Total Files

4

Last publish

Collaborators

  • cspotcode