Comparing version 5.0.0 to 5.1.0
# History | ||
## v5.1.0 April 7, 2015 | ||
- Added `spawnNodeModule` | ||
## v5.0.0 April 7, 2015 | ||
@@ -4,0 +7,0 @@ - Removed `requireFresh(path)` instead use the [requirefresh](https://npmjs.org/package/requirefresh) package |
// Generated by CoffeeScript 1.9.1 | ||
(function() { | ||
var TaskGroup, base, extractOptsAndCallback, isWindows, ref, ref1, safefs, safeps, typeChecker, | ||
slice = [].slice; | ||
slice = [].slice, | ||
hasProp = {}.hasOwnProperty; | ||
@@ -787,2 +788,41 @@ safeps = null; | ||
return this; | ||
}, | ||
spawnNodeModule: function() { | ||
var arg, args, command, i, key, len, next, opts, pathUtil, type, value; | ||
args = 1 <= arguments.length ? slice.call(arguments, 0) : []; | ||
pathUtil = require('path'); | ||
opts = { | ||
cwd: process.cwd() | ||
}; | ||
for (i = 0, len = args.length; i < len; i++) { | ||
arg = args[i]; | ||
type = typeof arg; | ||
if (Array.isArray(arg)) { | ||
opts.args = arg; | ||
} else if (type === 'object') { | ||
if (arg.next != null) { | ||
next = arg.next; | ||
delete arg.next; | ||
} | ||
for (key in arg) { | ||
if (!hasProp.call(arg, key)) continue; | ||
value = arg[key]; | ||
opts[key] = value; | ||
} | ||
} else if (type === 'function') { | ||
next = arg; | ||
} else if (type === 'string') { | ||
opts.name = arg; | ||
} | ||
} | ||
if (opts.name) { | ||
command = [opts.name].concat(opts.args || []); | ||
} else { | ||
command = opts.args || []; | ||
} | ||
delete opts.name; | ||
delete opts.args; | ||
command[0] = pathUtil.join(opts.cwd, 'node_modules', '.bin', command[0]); | ||
safeps.spawn(command, opts, next); | ||
return this; | ||
} | ||
@@ -789,0 +829,0 @@ }; |
{ | ||
"title": "Safe PS", | ||
"name": "safeps", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Work with processes safely and easily with Node.js", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/bevry/safeps", |
61336
823