Socket
Socket
Sign inDemoInstall

find-in-npm-pack

Package Overview
Dependencies
8
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    find-in-npm-pack

searches for exact text inside npm pack's tar file result


Version published
Maintainers
1
Install size
452 kB
Created

Readme

Source

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.

Keywords

FAQs

Last updated on 18 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc