New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

npm-config-arguments

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-config-arguments

Parses npm_config env variables and assigns them to argv - useful for 'npm run' commands

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
341
decreased by-25.55%
Maintainers
1
Weekly downloads
 
Created
Source

npm-config-arguments

If you're using npm to write command line tools, you might want to pass arguments to your tools. By default, all arguments passed to a npm run command are passed to npm, but not to the underlying process. This module parses all arguments passed to npm, optionally removes all known environment variables, and passes them on to your process.

Or, a better example with code:

// package.json
"scripts": {
  "my-command": "node my-script.js"
}

To pass arguments to process.argv for use with yargs, commander, or any other tool, you'd have to run npm run my-command -- --myArgument. Using this module removes the need to include the extra --, you can just call npm run my-command --myArgument instead.

Usage

import assignConfigToArgs from 'npm-config-arguments'

assignConfigToArgs();

Or, if you're using ES5:

var assignConfigToArgs = require('npm-config-arguments').assignConfigToArgs;

assignConfigToArgs();

Options

Include all known npm config variables

assignConfigToArgs({ includeAllKnown: true });

Exclude all known npm config variables expect for the specified one (npm_config_tag)

assignConfigToArgs({ include: ['tag'] });

License

MIT, see LICENSE for details.

Keywords

FAQs

Package last updated on 03 Aug 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc