Socket
Socket
Sign inDemoInstall

exargs

Package Overview
Dependencies
3
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    exargs

Argument expansion utility.


Version published
Maintainers
1
Install size
702 kB
Created

Readme

Source

exargs

Expand your arguments, expand your mind.

Basically a cli wrapper for dargs that allows you to easily externalize arguments and flags for passing to cli's that don't support .*rc or other configuration files.

Installation

npm install --save-dev exargs
# or
yarn add exargs

Usage

This utility depends on argument expansion in order to work properly.

// package.json

{
  "scripts": {
    "start:long": "mycmd --with=alot,of,arguments,oh,so,long --why=do,i,have,all,of,this,in,here --what=have,i,done,to,deserve,this",
    "start:short": "mycmd $(exargs .mycmdrc)"
  }
}
// .mycmdrc

{
  "with": "alot,of,arguments,oh,so,long",
  "why": "do,i,have,all,of,this,in,here",
  "what": "have,i,done,to,deserve,this"
}

Options

All of the options accepted by dargs can be passed to exargs. The only way to pass these options currently is to add a $ property to the configuration file you have specified.

// .mycmdrc

{
  "$": {
    "combine": ["property"]
  },

  "property": ["one", "two"]
}

There are also some options added to make exargs more configurable:

  • combine Array - specify fields which should be rolled up into a single string to avoid dargs generating multiple arguments.
combine

Without combine:

{
  "with": ["alot", "of", "arguments", "oh", "so", "long"]
}

// yields: --with=alot --with=of --with=arguments --with=oh --with=so --with=long

With combine:

{
  "$": {
    "combine": ["with"]
  },
  "with": ["alot", "of", "arguments", "oh", "so", "long"]
}

// yields: --with=alot --with=of --with=arguments --with=oh --with=so --with=long

FAQs

Last updated on 26 Jun 2019

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