find-in-npm-pack

1.0.1 • Public • Published

npm version CircleCI semantic-release styled with prettier Commitizen friendly

find-in-npm-pack

Description

A CLI tool that searches for text strings inside npm packages tar files.

installation

with npm:

  npm install find-in-npm-pack --save-dev

with yarn:

  yarn add find-in-npm-pack --dev

Usage

npm-find-in-files mysecret1 mysecret2

It is recommended to use this CLI tool inside a npm script which is executed during your CI build.

How it works

  1. Runs npm pack in the cwd to create the output tar file.
  2. Scans the output tar file and collect a list of the files it contains.
  3. Reads each of the contained files, and search for the text strings.
    • Note that the files are read directly from the file system, not the tar file.
  4. If an issue was detected print to stderr and exit with exitcode 1
  5. Will always delete the output tar file before closing the process.

Limitations

  • Searches for text strings verbatim, no support for regular expressions.
  • Has a side effect of creating and immediately deleting the npm pack output tar file.
  • Implemented as sync operations.
  • Assumes the contents of the tar file are text files in UTF-8 encoding.

Readme

Keywords

Package Sidebar

Install

npm i find-in-npm-pack

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.45 kB

Total Files

4

Last publish

Collaborators

  • bd82