Comparing version 9.3.0 to 10.0.0-next.1589186443.1aa76e74e7a40c5ca0133de097a162852622782d
# History | ||
## v10.0.0 2020 May 11 | ||
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) | ||
- Minimum required node version changed from `node: >=8` to `node: >=10` to keep up with mandatory ecosystem changes | ||
## v9.3.0 2019 December 10 | ||
@@ -4,0 +9,0 @@ |
@@ -8,3 +8,3 @@ <!-- LICENSEFILE/ --> | ||
<ul><li>Copyright © 2013+ <a href="http://bevry.me">Bevry Pty Ltd</a></li> | ||
<li>Copyright © 2011-2012 <a href="http://balupton.com">Benjamin Lupton</a></li></ul> | ||
<li>Copyright © 2011-2012 <a href="https://balupton.com">Benjamin Lupton</a></li></ul> | ||
@@ -11,0 +11,0 @@ and licensed under: |
{ | ||
"title": "Safe PS", | ||
"name": "safeps", | ||
"version": "9.3.0", | ||
"version": "10.0.0-next.1589186443.1aa76e74e7a40c5ca0133de097a162852622782d", | ||
"description": "Work with processes safely and easily with Node.js", | ||
@@ -9,9 +9,13 @@ "homepage": "https://github.com/bevry/safeps", | ||
"keywords": [ | ||
"child_process", | ||
"closeProcess", | ||
"esnext", | ||
"exec", | ||
"node", | ||
"openProcess", | ||
"process", | ||
"ps", | ||
"process", | ||
"openProcess", | ||
"closeProcess", | ||
"spawn", | ||
"exec", | ||
"child_process" | ||
"typed", | ||
"types" | ||
], | ||
@@ -46,16 +50,19 @@ "badges": { | ||
"wishlistURL": "https://bevry.me/wishlist", | ||
"travisTLD": "com" | ||
"travisTLD": "com", | ||
"githubUsername": "bevry", | ||
"githubRepository": "safeps", | ||
"githubSlug": "bevry/safeps", | ||
"npmPackageName": "safeps" | ||
} | ||
}, | ||
"funding": "https://bevry.me/fund", | ||
"author": "2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me), 2011-2012 Benjamin Lupton <b@lupton.cc> (http://balupton.com)", | ||
"author": "2013+ Bevry Pty Ltd <us@bevry.me> (http://bevry.me), 2011-2012 Benjamin Lupton <b@lupton.cc> (https://balupton.com)", | ||
"maintainers": [ | ||
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)" | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
], | ||
"contributors": [ | ||
"Benjamin Lupton <b@lupton.cc> (http://balupton.com)", | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)", | ||
"Gio d'Amelio <giodamelio@gmail.com> (https://github.com/giodamelio)", | ||
"Sean Fridman <mail@seanfridman.com> (http://seanfridman.com)", | ||
"Steve Mc <contact@stevemcarthur.co.uk> (http://www.stevemcarthur.co.uk)", | ||
"dependabot-preview[bot] (http://github.com/apps/dependabot-preview)" | ||
"Sean Fridman <mail@seanfridman.com> (https://github.com/sfrdmn)", | ||
"Steve Mc <contact@stevemcarthur.co.uk> (https://github.com/SteveMcArthur)" | ||
], | ||
@@ -70,7 +77,7 @@ "bugs": { | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
"editions": [ | ||
{ | ||
"description": "esnext source code with require for modules", | ||
"description": "ESNext source code for Node.js with Require for modules", | ||
"directory": "source", | ||
@@ -84,3 +91,3 @@ "entry": "index.js", | ||
"engines": { | ||
"node": "8 || 10 || 12" | ||
"node": "10 || 12 || 13 || 14" | ||
} | ||
@@ -93,20 +100,21 @@ } | ||
"extract-opts": "^4.3.0", | ||
"safefs": "^5.4.0", | ||
"taskgroup": "^6.4.0", | ||
"typechecker": "^6.2.0" | ||
"safefs": "^5.5.0", | ||
"taskgroup": "^6.5.0", | ||
"typechecker": "^6.4.0" | ||
}, | ||
"devDependencies": { | ||
"assert-helpers": "^5.8.0", | ||
"@bevry/update-contributors": "^1.4.0", | ||
"assert-helpers": "^6.2.0", | ||
"bevry-echo": "^1.1.0", | ||
"eslint": "^6.7.2", | ||
"eslint-config-bevry": "^2.3.0", | ||
"eslint-config-prettier": "^6.7.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"jsdoc": "^3.6.3", | ||
"kava": "^4.4.0", | ||
"eslint": "^7.0.0", | ||
"eslint-config-bevry": "^3.4.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"jsdoc": "^3.6.4", | ||
"kava": "^5.0.0", | ||
"minami": "^1.2.3", | ||
"prettier": "^1.19.1", | ||
"projectz": "^1.16.0", | ||
"prettier": "^2.0.5", | ||
"projectz": "^2.1.0", | ||
"surge": "^0.21.3", | ||
"valid-directory": "^1.5.0" | ||
"valid-directory": "^1.6.0" | ||
}, | ||
@@ -117,6 +125,7 @@ "scripts": { | ||
"our:deploy": "echo no need for this project", | ||
"our:meta": "npm run our:meta:docs && npm run our:meta:projectz", | ||
"our:meta": "npm run our:meta:contributors && npm run our:meta:docs && npm run our:meta:projectz", | ||
"our:meta:contributors": "npx @bevry/update-contributors", | ||
"our:meta:docs": "npm run our:meta:docs:jsdoc", | ||
"our:meta:docs:jsdoc": "rm -Rf ./docs && jsdoc --recurse --pedantic --access all --destination ./docs --package ./package.json --readme ./README.md --template ./node_modules/minami ./source && mv ./docs/$npm_package_name/$npm_package_version/* ./docs/ && rm -Rf ./docs/$npm_package_name/$npm_package_version", | ||
"our:meta:projectz": "projectz compile", | ||
"our:meta:docs:jsdoc": "rm -Rf ./docs && npx jsdoc --recurse --pedantic --access all --destination ./docs --package ./package.json --readme ./README.md --template ./node_modules/minami ./source && mv ./docs/$npm_package_name/$npm_package_version/* ./docs/ && rm -Rf ./docs/$npm_package_name/$npm_package_version", | ||
"our:meta:projectz": "npx projectz compile", | ||
"our:release": "npm run our:release:prepare && npm run our:release:check-changelog && npm run our:release:check-dirty && npm run our:release:tag && npm run our:release:push", | ||
@@ -133,4 +142,4 @@ "our:release:check-changelog": "cat ./HISTORY.md | grep v$npm_package_version || (echo add a changelog entry for v$npm_package_version && exit -1)", | ||
"our:verify:directory": "npx valid-directory", | ||
"our:verify:eslint": "eslint --fix --ignore-pattern '**/*.d.ts' --ignore-pattern '**/vendor/' --ignore-pattern '**/node_modules/' --ext .mjs,.js,.jsx,.ts,.tsx ./source", | ||
"our:verify:prettier": "prettier --write ./source/**", | ||
"our:verify:eslint": "npx eslint --fix --ignore-pattern '**/*.d.ts' --ignore-pattern '**/vendor/' --ignore-pattern '**/node_modules/' --ext .mjs,.js,.jsx,.ts,.tsx ./source", | ||
"our:verify:prettier": "npx prettier --write .", | ||
"test": "node ./source/test.js" | ||
@@ -137,0 +146,0 @@ }, |
@@ -36,2 +36,6 @@ <!-- TITLE/ --> | ||
## Usage | ||
[Complete API Documentation.](http://master.safeps.bevry.surge.sh/docs/index.html) | ||
<!-- INSTALL/ --> | ||
@@ -44,3 +48,4 @@ | ||
<li>Install: <code>npm install --save safeps</code></li> | ||
<li>Require: <code>require('safeps')</code></li> | ||
<li>Import: <code>import * as pkg from ('safeps')</code></li> | ||
<li>Require: <code>const pkg = require('safeps')</code></li> | ||
</ul> | ||
@@ -53,6 +58,4 @@ | ||
<ul><li><code>safeps</code> aliases <code>safeps/source/index.js</code></li> | ||
<li><code>safeps/source/index.js</code> is esnext source code with require for modules</li></ul> | ||
<li><code>safeps/source/index.js</code> is <a href="https://en.wikipedia.org/wiki/ECMAScript#ES.Next" title="ECMAScript Next">ESNext</a> source code for <a href="https://nodejs.org" title="Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine">Node.js</a> with <a href="https://nodejs.org/dist/latest-v5.x/docs/api/modules.html" title="Node/CJS Modules">Require</a> for modules</li></ul> | ||
<p>Environments older than Node.js v8 may need <a href="https://babeljs.io/docs/usage/polyfill/" title="A polyfill that emulates missing ECMAScript environment features">Babel's Polyfill</a> or something similar.</p> | ||
<h3><a href="https://www.typescriptlang.org/" title="TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. ">TypeScript</a></h3> | ||
@@ -73,7 +76,2 @@ | ||
## Usage | ||
[Documentation](http://master.safeps.bevry.surge.sh/docs/) | ||
<!-- HISTORY/ --> | ||
@@ -105,3 +103,3 @@ | ||
<ul><li><a href="http://balupton.com">Benjamin Lupton</a></li></ul> | ||
<ul><li><a href="https://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/safeps/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/safeps">view contributions</a></li></ul> | ||
@@ -126,7 +124,6 @@ <h3>Sponsors</h3> | ||
<ul><li><a href="http://balupton.com">Benjamin Lupton</a></li> | ||
<ul><li><a href="https://balupton.com">Benjamin Lupton</a> — <a href="https://github.com/bevry/safeps/commits?author=balupton" title="View the GitHub contributions of Benjamin Lupton on repository bevry/safeps">view contributions</a></li> | ||
<li><a href="https://github.com/giodamelio">Gio d'Amelio</a> — <a href="https://github.com/bevry/safeps/commits?author=giodamelio" title="View the GitHub contributions of Gio d'Amelio on repository bevry/safeps">view contributions</a></li> | ||
<li><a href="http://seanfridman.com">Sean Fridman</a></li> | ||
<li><a href="http://www.stevemcarthur.co.uk">Steve Mc</a></li> | ||
<li><a href="http://github.com/apps/dependabot-preview">dependabot-preview[bot]</a></li></ul> | ||
<li><a href="https://github.com/sfrdmn">Sean Fridman</a> — <a href="https://github.com/bevry/safeps/commits?author=sfrdmn" title="View the GitHub contributions of Sean Fridman on repository bevry/safeps">view contributions</a></li> | ||
<li><a href="https://github.com/SteveMcArthur">Steve Mc</a> — <a href="https://github.com/bevry/safeps/commits?author=SteveMcArthur" title="View the GitHub contributions of Steve Mc on repository bevry/safeps">view contributions</a></li></ul> | ||
@@ -145,3 +142,3 @@ <a href="https://github.com/bevry/safeps/blob/master/CONTRIBUTING.md#files">Discover how you can contribute by heading on over to the <code>CONTRIBUTING.md</code> file.</a> | ||
<ul><li>Copyright © 2013+ <a href="http://bevry.me">Bevry Pty Ltd</a></li> | ||
<li>Copyright © 2011-2012 <a href="http://balupton.com">Benjamin Lupton</a></li></ul> | ||
<li>Copyright © 2011-2012 <a href="https://balupton.com">Benjamin Lupton</a></li></ul> | ||
@@ -148,0 +145,0 @@ and licensed under: |
@@ -33,3 +33,3 @@ /* eslint no-sync:0 */ | ||
abortOnError: false, | ||
destroyOnceDone: false | ||
destroyOnceDone: false, | ||
}).run() | ||
@@ -94,6 +94,3 @@ } | ||
const localeCode = | ||
lang | ||
.replace(/\..+/, '') | ||
.replace('-', '_') | ||
.toLowerCase() || null | ||
lang.replace(/\..+/, '').replace('-', '_').toLowerCase() || null | ||
return localeCode | ||
@@ -222,3 +219,3 @@ }, | ||
if (fsUtil.access) { | ||
fsUtil.access(path, fsUtil.X_OK, function(err) { | ||
fsUtil.access(path, fsUtil.X_OK, function (err) { | ||
const isExecutable = !err | ||
@@ -231,3 +228,3 @@ return next(null, isExecutable) | ||
else { | ||
require('child_process').exec(path + ' --version', function(err) { | ||
require('child_process').exec(path + ' --version', function (err) { | ||
// If there was no error, then execution worked fine, so we are executable | ||
@@ -453,3 +450,3 @@ if (!err) return next(null, true) | ||
let wasSync = 0 | ||
safeps.getExecPath(command[0], opts, function(err, execPath) { | ||
safeps.getExecPath(command[0], opts, function (err, execPath) { | ||
if (err) return | ||
@@ -542,3 +539,3 @@ command[0] = execPath | ||
// Patience | ||
safeps.openProcess(function(closeProcess) { | ||
safeps.openProcess(function (closeProcess) { | ||
// If the command is a string, then convert it into an array | ||
@@ -557,3 +554,3 @@ if (typeChecker.isString(command)) { | ||
status: null, | ||
signal: null | ||
signal: null, | ||
} | ||
@@ -563,3 +560,3 @@ let exited = false | ||
// Tasks | ||
const tasks = new TaskGroup().done(function(err) { | ||
const tasks = new TaskGroup().done(function (err) { | ||
exited = true | ||
@@ -578,4 +575,4 @@ closeProcess() | ||
if (opts.safe) { | ||
tasks.addTask(function(complete) { | ||
safeps.getExecPath(command[0], opts, function(err, execPath) { | ||
tasks.addTask(function (complete) { | ||
safeps.getExecPath(command[0], opts, function (err, execPath) { | ||
if (err) return complete(err) | ||
@@ -589,3 +586,3 @@ command[0] = execPath | ||
// Spawn | ||
tasks.addTask(function(complete) { | ||
tasks.addTask(function (complete) { | ||
// Spawn | ||
@@ -609,3 +606,3 @@ result.pid = require('child_process').spawn( | ||
if (result.pid.stdout) { | ||
result.pid.stdout.on('data', function(data) { | ||
result.pid.stdout.on('data', function (data) { | ||
if (opts.output) { | ||
@@ -624,3 +621,3 @@ safeps.outputData(data, 'stdout', opts.outputPrefix) | ||
if (result.pid.stderr) { | ||
result.pid.stderr.on('data', function(data) { | ||
result.pid.stderr.on('data', function (data) { | ||
if (opts.output) { | ||
@@ -639,3 +636,3 @@ safeps.outputData(data, 'stderr', opts.outputPrefix) | ||
// Wait | ||
result.pid.on('close', function(status, signal) { | ||
result.pid.on('close', function (status, signal) { | ||
// Apply to local global | ||
@@ -705,3 +702,3 @@ result.status = status | ||
const tasks = new TaskGroup({ concurrency: opts.concurrency }).done( | ||
function(err) { | ||
function (err) { | ||
next(err, results) | ||
@@ -717,5 +714,5 @@ } | ||
// Add tasks | ||
commands.forEach(function(command) { | ||
tasks.addTask(function(complete) { | ||
safeps.spawn(command, opts, function(...args) { | ||
commands.forEach(function (command) { | ||
tasks.addTask(function (complete) { | ||
safeps.spawn(command, opts, function (...args) { | ||
const err = args[0] || null | ||
@@ -837,3 +834,3 @@ results.push(args) | ||
// Patience | ||
safeps.openProcess(function(closeProcess) { | ||
safeps.openProcess(function (closeProcess) { | ||
// Output | ||
@@ -846,3 +843,3 @@ if (opts.output === true && !opts.outputPrefix) { | ||
// Execute command | ||
require('child_process').exec(command, opts, function( | ||
require('child_process').exec(command, opts, function ( | ||
error, | ||
@@ -904,3 +901,3 @@ stdout, | ||
const tasks = new TaskGroup({ concurrency: opts.concurrency }).done( | ||
function(err) { | ||
function (err) { | ||
next(err, results) | ||
@@ -916,5 +913,5 @@ } | ||
// Add tasks | ||
commands.forEach(function(command) { | ||
tasks.addTask(function(complete) { | ||
safeps.exec(command, opts, function(...args) { | ||
commands.forEach(function (command) { | ||
tasks.addTask(function (complete) { | ||
safeps.exec(command, opts, function (...args) { | ||
const err = args[0] || null | ||
@@ -956,3 +953,3 @@ results.push(args) | ||
// Handle | ||
possibleExecPaths.forEach(function(possibleExecPath) { | ||
possibleExecPaths.forEach(function (possibleExecPath) { | ||
// Check if we have found the valid exec path earlier, if so, skip | ||
@@ -966,3 +963,3 @@ // Check if the path is invalid, if it is, skip it | ||
// Check if the executeable exists | ||
safeps.isExecutableSync(possibleExecPath, opts, function( | ||
safeps.isExecutableSync(possibleExecPath, opts, function ( | ||
err, | ||
@@ -1010,3 +1007,3 @@ isExecutable | ||
// Group | ||
const tasks = new TaskGroup().done(function(err) { | ||
const tasks = new TaskGroup().done(function (err) { | ||
return next(err, execPath) | ||
@@ -1016,6 +1013,6 @@ }) | ||
// Handle | ||
possibleExecPaths.forEach(function(possibleExecPath) { | ||
possibleExecPaths.forEach(function (possibleExecPath) { | ||
// Check if the path is invalid, if it is, skip it | ||
if (!possibleExecPath) return | ||
tasks.addTask(function(complete) { | ||
tasks.addTask(function (complete) { | ||
// Check if we have found the valid exec path earlier, if so, skip | ||
@@ -1028,3 +1025,3 @@ if (execPath) return complete() | ||
// Check if the executeable exists | ||
safeps.isExecutable(possibleExecPath, opts, function( | ||
safeps.isExecutable(possibleExecPath, opts, function ( | ||
err, | ||
@@ -1075,3 +1072,3 @@ isExecutable | ||
if (execName) { | ||
standardExecPaths = standardExecPaths.map(function(path) { | ||
standardExecPaths = standardExecPaths.map(function (path) { | ||
return pathUtil.join(path, execName) | ||
@@ -1176,3 +1173,3 @@ }) | ||
// Which will determine which path it is out of the possible paths | ||
safeps.determineExecPath(possibleExecPaths, opts, function( | ||
safeps.determineExecPath(possibleExecPaths, opts, function ( | ||
err, | ||
@@ -1267,3 +1264,3 @@ execPath | ||
// Try the user directory temp path | ||
safeps.getHomePath(opts, function(err, homePath) { | ||
safeps.getHomePath(opts, function (err, homePath) { | ||
if (err) return next(err) | ||
@@ -1349,3 +1346,3 @@ tmpPath = pathUtil.resolve(homePath, tmpDirName) | ||
// Determine the right path | ||
safeps.determineExecPath(possibleExecPaths, opts, function(err, execPath) { | ||
safeps.determineExecPath(possibleExecPaths, opts, function (err, execPath) { | ||
if (err) { | ||
@@ -1421,3 +1418,3 @@ next(err) | ||
// Determine the right path | ||
safeps.determineExecPath(possibleExecPaths, opts, function(err, execPath) { | ||
safeps.determineExecPath(possibleExecPaths, opts, function (err, execPath) { | ||
if (err) { | ||
@@ -1493,3 +1490,3 @@ next(err) | ||
// Determine the right path | ||
safeps.determineExecPath(possibleExecPaths, opts, function(err, execPath) { | ||
safeps.determineExecPath(possibleExecPaths, opts, function (err, execPath) { | ||
if (err) { | ||
@@ -1563,7 +1560,7 @@ next(err) | ||
// Check if it exists | ||
safefs.ensurePath(opts.cwd, function(err) { | ||
safefs.ensurePath(opts.cwd, function (err) { | ||
if (err) return next(err) | ||
// Initialise git repo | ||
safeps.spawn(['git', 'init'], opts, function(err) { | ||
safeps.spawn(['git', 'init'], opts, function (err) { | ||
if (err) return next(err) | ||
@@ -1574,3 +1571,3 @@ | ||
// Check what remotes we have | ||
safeps.spawn(['git', 'remote', 'show'], opts, function(err, stdout) { | ||
safeps.spawn(['git', 'remote', 'show'], opts, function (err, stdout) { | ||
if (err) return next(err) | ||
@@ -1581,6 +1578,3 @@ // stdout will be null if there are no remotes | ||
stdout && | ||
stdout | ||
.toString() | ||
.split('\n') | ||
.indexOf(opts.remote) !== -1 | ||
stdout.toString().split('\n').indexOf(opts.remote) !== -1 | ||
) { | ||
@@ -1595,3 +1589,3 @@ // Overwrite it if it does exist | ||
opts.remote, | ||
opts.url | ||
opts.url, | ||
] | ||
@@ -1639,3 +1633,3 @@ safeps.spawn(command, opts, partTwo) | ||
// If there is no package.json file, then we can't do anything | ||
safefs.exists(packageJsonPath, function(exists) { | ||
safefs.exists(packageJsonPath, function (exists) { | ||
if (!exists) return next() | ||
@@ -1653,3 +1647,3 @@ | ||
if (!opts.force) { | ||
safefs.exists(nodeModulesPath, function(exists) { | ||
safefs.exists(nodeModulesPath, function (exists) { | ||
if (exists) return next() | ||
@@ -1732,3 +1726,3 @@ partTwo() | ||
return safeps | ||
} | ||
}, | ||
} | ||
@@ -1735,0 +1729,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
72722
14
6
1507
1
143
+ Addedsafeps@9.3.0(transitive)
Updatedsafefs@^5.5.0
Updatedtaskgroup@^6.5.0
Updatedtypechecker@^6.4.0