Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dargs

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dargs - npm Package Compare versions

Comparing version 5.0.1 to 5.1.0

9

index.js

@@ -14,3 +14,3 @@ 'use strict';

const makeArg = (key, val) => {
key = '--' + key.replace(/[A-Z]/g, '-$&').toLowerCase(); // eslint-disable-line prefer-template
key = '--' + (opts.allowCamelCase ? key : key.replace(/[A-Z]/g, '-$&').toLowerCase());

@@ -36,2 +36,3 @@ if (opts.useEquals) {

// TODO: use for-of loop and Object.entries when targeting Node.js 6
Object.keys(input).forEach(key => {

@@ -86,7 +87,7 @@ const val = input[key];

extraArgs.forEach(extraArgVal => {
args.push(String(extraArgVal));
});
for (const x of extraArgs) {
args.push(String(x));
}
return args;
};
{
"name": "dargs",
"version": "5.0.1",
"version": "5.1.0",
"description": "Reverse minimist. Convert an object of options into an array of command-line arguments.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -123,4 +123,6 @@ # dargs [![Build Status](https://travis-ci.org/sindresorhus/dargs.svg?branch=master)](https://travis-ci.org/sindresorhus/dargs)

Setting this to `false` makes it return the key and value as separate array items instead of using a `=` separator in one item. This can be useful for tools that doesn't support `--foo=bar` style flags. For example:
Setting this to `false` makes it return the key and value as separate array items instead of using a `=` separator in one item. This can be useful for tools that doesn't support `--foo=bar` style flags.
###### Example
```js

@@ -142,5 +144,22 @@ console.log(dargs({foo: 'bar'}, {useEquals: false}));

##### allowCamelCase
Type: `boolean`<br>
Default: `false`
By default, camelCased keys will be hyphenated. Enabling this will bypass the conversion process.
###### Example
```js
console.log(dargs({fooBar: 'baz'}));
//=> ['--foo-bar', 'baz']
console.log(dargs({fooBar: 'baz'}, {allowCamelCase: true}));
//=> ['--fooBar', 'baz']
```
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
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