-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
94 lines (94 loc) · 6.33 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
"_args": [
[
{
"raw": "ps-tree@https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"scope": null,
"escapedName": "ps-tree",
"name": "ps-tree",
"rawSpec": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"spec": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"type": "remote"
},
"/Users/jennyphan/AngularToolingSamples/Angular4/aboutMe-app/functions/node_modules/firebase-admin"
]
],
"_from": "ps-tree@https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"_id": "ps-tree@1.1.0",
"_inCache": true,
"_location": "/firebase-admin/ps-tree",
"_phantomChildren": {},
"_requested": {
"raw": "ps-tree@https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"scope": null,
"escapedName": "ps-tree",
"name": "ps-tree",
"rawSpec": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"spec": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"type": "remote"
},
"_requiredBy": [
"/firebase-admin",
"/firebase-admin/npm-run-all"
],
"_resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"_shasum": "b421b24140d6203f1ed3c76996b4427b08e8c014",
"_shrinkwrap": null,
"_spec": "ps-tree@https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz",
"_where": "/Users/jennyphan/AngularToolingSamples/Angular4/aboutMe-app/functions/node_modules/firebase-admin",
"author": {
"name": "Charlie Robbins",
"email": "charlie.robbins@gmail.com"
},
"bugs": {
"url": "https://github.com/indexzero/ps-tree/issues"
},
"contributors": [
{
"name": "Zhuohuan LI",
"email": "zixia@zixia.net",
"url": "https://github.com/zixia"
}
],
"dependencies": {
"event-stream": "~3.3.0"
},
"description": "Get all children of a pid",
"devDependencies": {
"chalk": "^1.0.0",
"codeclimate-test-reporter": "0.0.4",
"cross-env": "^1.0.8",
"istanbul": "^0.3.20",
"pre-commit": "0.0.9",
"precommit": "^1.1.5",
"tape": "^3.0.3",
"tree-kill": "^1.1.0"
},
"directories": {
"test": "test"
},
"engines": {
"node": ">= 0.10"
},
"homepage": "http://github.com/indexzero/ps-tree",
"license": "MIT",
"name": "ps-tree",
"optionalDependencies": {},
"pre-commit": [
"coverage",
"codeclimate"
],
"readme": "# ps-tree\n\n[![Build Status](https://travis-ci.org/indexzero/ps-tree.svg)](https://travis-ci.org/indexzero/ps-tree)\n[![Code Climate](https://codeclimate.com/github/indexzero/ps-tree/badges/gpa.svg)](https://codeclimate.com/github/indexzero/ps-tree)\n[![Test Coverage](https://codeclimate.com/github/indexzero/ps-tree/badges/coverage.svg)](https://codeclimate.com/github/indexzero/ps-tree)\n[![npm version](https://badge.fury.io/js/ps-tree.svg)](http://badge.fury.io/js/ps-tree)\n[![Node.js Version][node-version-image]][node-version-url]\n[![Dependency Status](https://david-dm.org/indexzero/ps-tree.svg)](https://david-dm.org/indexzero/ps-tree)\n[node-version-image]: https://img.shields.io/node/v/listdirs.svg?style=flat\n[node-version-url]: http://nodejs.org/download/\n\nSometimes you cannot kill child processes like you would expect, this a feature of UNIX.\n\n>in UNIX, a process may terminate by using the exit call, and it's parent process may wait for that event by using the wait system call. the wait system call returns the process identifier of a terminated child, so that the parent tell which of the possibly many children has terminated. If the parent terminates, however, all it's children have assigned as their new parent the init process. Thus, the children still have a parent to collect their status and execution statistics.\n> (from \"operating system concepts\")\n\nSolution: use `ps-tree` to get all processes that a `child_process` may have started, so that they may all be terminated.\n\n``` js\nvar cp = require('child_process'),\n psTree = require('ps-tree');\n\nvar child = cp.exec(\"node -e 'while (true);'\", function () {...});\n\n// This will not actually kill the child it will kill the `sh` process.\nchild.kill();\n```\n\nwtf? it's because exec actually works like this:\n\n``` js\nfunction exec (cmd, cb) {\n spawn('sh', ['-c', cmd]);\n ...\n}\n```\n\n`sh` starts parses the command string and starts processes, and waits for them to terminate, but `exec` returns a process object with the pid of the `sh` process.\nHowever, since it is in `wait` mode killing it does not kill the children.\n\nUse `ps-tree` like this:\n\n``` js\nvar cp = require('child_process'),\n psTree = require('ps-tree');\n\nvar child = cp.exec(\"node -e 'while (true);'\", function () { /*...*/ });\n\npsTree(child.pid, function (err, children) {\n cp.spawn('kill', ['-9'].concat(children.map(function (p) { return p.PID })));\n});\n```\n\nIf you prefer to run **psTree** from the command line, use: `node ./bin/ps-tree.js`\n\n## Cross Platform support\n\n\nThe `ps-tree` module behaves differently on *nix vs. Windows by spawning different programs and parsing their output. This is based on `process.platform` and not on checking to see if a `ps` compatible program exists on the system.\n\n#### *nix\n\n1. \" <defunct> \" need to be striped\n```bash\n$ ps -A -o comm,ppid,pid,stat\nCOMMAND PPID PID STAT\nbbsd 2899 16958 Ss\nwatch <defunct> 1914 16964 Z\nps 20688 16965 R+\n```\n\n### Windows\n1. `wmic PROCESS WHERE ParentProcessId=4604 GET Name,ParentProcessId,ProcessId,Status)`\n2. The order of head columns is fixed\n```shell\n> wmic PROCESS GET Name,ProcessId,ParentProcessId,Status\nName ParentProcessId ProcessId Status\nSystem Idle Process 0 0\nSystem 0 4\nsmss.exe 4 228\n```\n\n### LICENSE: MIT\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/indexzero/ps-tree.git"
},
"scripts": {
"_comment": "https://github.com/gotwarlost/istanbul#usage-on-windows",
"codeclimate": "cross-env CODECLIMATE_REPO_TOKEN=84436b4f13c70ace9c62e7f04928bf23c234eb212c0232d39d7fb1535beb2da5 codeclimate < coverage/lcov.info",
"coverage": "npm test && istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"test": "istanbul cover node_modules/tape/bin/tape test/test.js test/direct.js"
},
"version": "1.1.0"
}