mirror of
https://github.com/fofolee/uTools-ProcessKiller.git
synced 2025-09-28 07:05:04 +08:00
v0.0.2
This commit is contained in:
21
node_modules/spawno/LICENSE
generated
vendored
Normal file
21
node_modules/spawno/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
100
node_modules/spawno/README.md
generated
vendored
Normal file
100
node_modules/spawno/README.md
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
# spawno
|
||||
|
||||
[][patreon] [][paypal-donations] [](https://github.com/IonicaBizau/ama) [](https://www.npmjs.com/package/spawno) [](https://www.npmjs.com/package/spawno) [](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
> Easily work with child processes.
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
$ npm i --save spawno
|
||||
```
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
const spawn = require("spawno");
|
||||
|
||||
spawn("ls", ["-l"], { cwd: __dirname }, (err, stdout, stderr) => {
|
||||
console.log(err || stderr || stdout);
|
||||
// =>
|
||||
// total 4
|
||||
// -rw-rw-r-- 1 ionicabizau ionicabizau 256 Mar 27 14:53 index.js
|
||||
});
|
||||
|
||||
// Pipe the output in the stdout/stderr streams (this will not collect the output in memory)
|
||||
let proc = spawn("ping", ["ionicabizau.net"], {
|
||||
cwd: __dirname
|
||||
, _showOutput: true
|
||||
});
|
||||
// =>
|
||||
// PING ionicabizau.net (109.107.37.233) 56(84) bytes of data.
|
||||
// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=1 ttl=54 time=49.2 ms
|
||||
// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=2 ttl=54 time=44.4 ms
|
||||
// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=3 ttl=54 time=47.9 ms
|
||||
// 64 bytes from cip-109-107-37-233.gb1.brightbox.com (109.107.37.233): icmp_seq=4 ttl=54 time=46.3 ms
|
||||
```
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `spawno(command, args, options, cb)`
|
||||
Creates the child process.
|
||||
|
||||
#### Params
|
||||
- **String** `command`: The command you want to run.
|
||||
- **Array** `args`: The command arguments.
|
||||
- **Object** `options`: The options to pass to the `spawn` function extended with:
|
||||
- `_showOutput` (Boolean): If truly, the output will be piped in the
|
||||
process stdout/stderr streams.
|
||||
- **Function** `cb`: The callback function.
|
||||
|
||||
#### Return
|
||||
- **Process** The child process that was created.
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :moneybag: Donations
|
||||
|
||||
Another way to support the development of my open-source modules is
|
||||
to [set up a recurring donation, via Patreon][patreon]. :rocket:
|
||||
|
||||
[PayPal donations][paypal-donations] are appreciated too! Each dollar helps.
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
|
||||
- [`babel-it`](https://github.com/IonicaBizau/babel-it#readme)—Babelify your code before `npm publish`.
|
||||
- [`electroner`](https://github.com/IonicaBizau/electroner#readme)—Start ElectronJS apps from Node.js.
|
||||
- [`fortran`](https://github.com/IonicaBizau/node-fortran)—Fortran bridge for Node.js which allows you to run Fortran code from Node.js.
|
||||
- [`git-cloner`](https://github.com/IonicaBizau/git-cloner#readme)—Clone multiple git repositories.
|
||||
- [`git-status`](https://github.com/IonicaBizau/git-status#readme)—A git-status wrapper.
|
||||
- [`initial-commit-date`](https://github.com/IonicaBizau/initial-commit-date#readme)—Get the initial commit date of a git repository.
|
||||
- [`powershell`](https://github.com/IonicaBizau/powershell#readme)—Run PowerShell scripts and commands from Node.js.
|
||||
- [`pull-from-source`](https://github.com/IonicaBizau/pull-from-source#readme)—Pulls the changes from the source repository in the forked one.
|
||||
- [`ship-release`](https://github.com/IonicaBizau/ship-release#readme)—Publish new versions on GitHub and npm with ease.
|
||||
- [`spawn-npm`](https://github.com/IonicaBizau/spawn-npm#readme)—Run npm commands by creating child processes.
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
[donate-now]: http://i.imgur.com/6cMbHOC.png
|
||||
|
||||
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2016#license-mit
|
||||
[website]: http://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
55
node_modules/spawno/lib/index.js
generated
vendored
Normal file
55
node_modules/spawno/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
|
||||
var spawn = require("child_process").spawn,
|
||||
procOutput = require("proc-output");
|
||||
|
||||
/**
|
||||
* spawno
|
||||
* Creates the child process.
|
||||
*
|
||||
* @name spawno
|
||||
* @function
|
||||
* @param {String} command The command you want to run.
|
||||
* @param {Array} args The command arguments.
|
||||
* @param {Object} options The options to pass to the `spawn` function extended with:
|
||||
*
|
||||
* - `_showOutput` (Boolean): If truly, the output will be piped in the
|
||||
* process stdout/stderr streams.
|
||||
*
|
||||
* @param {Function} cb The callback function.
|
||||
* @returns {Process} The child process that was created.
|
||||
*/
|
||||
module.exports = function spawno(command, args, options, cb) {
|
||||
|
||||
if (typeof args === "function") {
|
||||
cb = args;
|
||||
args = [];
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (typeof options === "function") {
|
||||
cb = options;
|
||||
if (!Array.isArray(args)) {
|
||||
options = args;
|
||||
args = [];
|
||||
} else {
|
||||
options = {};
|
||||
}
|
||||
}
|
||||
|
||||
var showOutput = options._showOutput;
|
||||
delete options._showOutput;
|
||||
|
||||
var proc = spawn(command, args, options);
|
||||
|
||||
if (showOutput) {
|
||||
proc.stdout.pipe(process.stdout);
|
||||
proc.stderr.pipe(process.stderr);
|
||||
}
|
||||
|
||||
if (cb) {
|
||||
procOutput(proc, cb);
|
||||
}
|
||||
|
||||
return proc;
|
||||
};
|
73
node_modules/spawno/package.json
generated
vendored
Normal file
73
node_modules/spawno/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_from": "spawno@^1.0.0",
|
||||
"_id": "spawno@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-jfVlA/wxVpNYjnIhSU1clPFlu1c=",
|
||||
"_location": "/spawno",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "spawno@^1.0.0",
|
||||
"name": "spawno",
|
||||
"escapedName": "spawno",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/powershell"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/spawno/-/spawno-1.0.4.tgz",
|
||||
"_shasum": "8df56503fc315693588e7221494d5c94f165bb57",
|
||||
"_spec": "spawno@^1.0.0",
|
||||
"_where": "C:\\Users\\fofol\\OneDrive\\Configs\\ProcessKiller\\node_modules\\powershell",
|
||||
"author": {
|
||||
"name": "Ionică Bizău",
|
||||
"email": "bizauionica@gmail.com",
|
||||
"url": "http://ionicabizau.net"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/spawno/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"proc-output": "^1.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Easily work with child processes.",
|
||||
"devDependencies": {},
|
||||
"directories": {
|
||||
"example": "example"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"app/",
|
||||
"lib/",
|
||||
"build/",
|
||||
"dist/",
|
||||
"src/",
|
||||
"resources/",
|
||||
"menu/",
|
||||
"scripts/",
|
||||
"cli.js",
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/IonicaBizau/spawno#readme",
|
||||
"keywords": [
|
||||
"spawn",
|
||||
"child",
|
||||
"process"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "spawno",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/IonicaBizau/spawno.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
}
|
Reference in New Issue
Block a user