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

spawn-args

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spawn-args - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

10

index.js

@@ -1,2 +0,3 @@

module.exports = function(args){
module.exports = function(args, opts){
opts = opts || {}
args = args || '';

@@ -67,3 +68,10 @@ var arr = [];

if(opts.removequotes){
arr = arr.map(function(arg){
if(arg.match(/\s/)) return arg
return arg.replace(/^"|"$/g, "");
});
}
return arr;
}

2

package.json
{
"name": "spawn-args",
"version": "0.0.4",
"version": "0.1.0",
"description": "Turn a string of command line options into an array for child_process.spawn",

@@ -5,0 +5,0 @@ "main": "index.js",

spawn-args
==========
![Build status](https://api.travis-ci.org/binocarlos/yoda.png)
![Build status](https://api.travis-ci.org/binocarlos/spawn-args.png)

@@ -31,2 +31,3 @@ Turn a string of command line options into an array for child_process.spawn

*/
```

@@ -33,0 +34,0 @@ ## license

@@ -35,2 +35,15 @@ var parse = require('../');

})
it('should remove quotes if passed a config', function() {
var string = '--host "hello.com" --fruit "apples oranges"'
var keepquotes = parse(string)
var removequotes = parse(string, {
removequotes:true
})
keepquotes[1].should.equal('"hello.com"')
keepquotes[3].should.equal('"apples oranges"')
removequotes[1].should.equal('hello.com')
removequotes[3].should.equal('"apples oranges"')
})
})
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