serverless-spy 2.2.4 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/.jsii +3 -3
  2. package/dist/releasetag.txt +1 -1
  3. package/lib/src/ServerlessSpy.js +1 -1
  4. package/node_modules/bundle-name/index.js +2 -2
  5. package/node_modules/bundle-name/package.json +6 -5
  6. package/node_modules/bundle-name/readme.md +2 -2
  7. package/node_modules/default-browser/index.d.ts +5 -4
  8. package/node_modules/default-browser/index.js +13 -11
  9. package/node_modules/default-browser/package.json +14 -12
  10. package/node_modules/default-browser/windows.js +11 -5
  11. package/node_modules/default-browser-id/index.js +8 -32
  12. package/node_modules/default-browser-id/package.json +5 -8
  13. package/node_modules/default-browser-id/readme.md +2 -2
  14. package/node_modules/open/index.js +10 -10
  15. package/node_modules/{is-wsl → open/node_modules/is-wsl}/index.d.ts +2 -2
  16. package/node_modules/open/node_modules/is-wsl/index.js +27 -0
  17. package/node_modules/{is-wsl → open/node_modules/is-wsl}/package.json +21 -9
  18. package/node_modules/open/node_modules/is-wsl/readme.md +21 -0
  19. package/node_modules/open/package.json +9 -8
  20. package/node_modules/open/xdg-open +338 -137
  21. package/node_modules/run-applescript/index.d.ts +28 -4
  22. package/node_modules/run-applescript/index.js +20 -7
  23. package/node_modules/run-applescript/package.json +10 -9
  24. package/node_modules/run-applescript/readme.md +44 -6
  25. package/package.json +2 -2
  26. package/node_modules/big-integer/BigInteger.d.ts +0 -2393
  27. package/node_modules/big-integer/BigInteger.js +0 -1453
  28. package/node_modules/big-integer/BigInteger.min.js +0 -1
  29. package/node_modules/big-integer/LICENSE +0 -24
  30. package/node_modules/big-integer/README.md +0 -589
  31. package/node_modules/big-integer/bower.json +0 -29
  32. package/node_modules/big-integer/package.json +0 -48
  33. package/node_modules/big-integer/tsconfig.json +0 -24
  34. package/node_modules/bplist-parser/README.md +0 -48
  35. package/node_modules/bplist-parser/bplistParser.js +0 -363
  36. package/node_modules/bplist-parser/package.json +0 -34
  37. package/node_modules/bplist-parser/test/airplay.bplist +0 -0
  38. package/node_modules/bplist-parser/test/iTunes-small.bplist +0 -0
  39. package/node_modules/bplist-parser/test/int64.bplist +0 -0
  40. package/node_modules/bplist-parser/test/int64.xml +0 -10
  41. package/node_modules/bplist-parser/test/parseTest.js +0 -104
  42. package/node_modules/bplist-parser/test/sample1.bplist +0 -0
  43. package/node_modules/bplist-parser/test/sample2.bplist +0 -0
  44. package/node_modules/bplist-parser/test/uid.bplist +0 -0
  45. package/node_modules/bplist-parser/test/utf16.bplist +0 -0
  46. package/node_modules/bplist-parser/test/utf16_chinese.plist +0 -0
  47. package/node_modules/cross-spawn/CHANGELOG.md +0 -130
  48. package/node_modules/cross-spawn/LICENSE +0 -21
  49. package/node_modules/cross-spawn/README.md +0 -96
  50. package/node_modules/cross-spawn/index.js +0 -39
  51. package/node_modules/cross-spawn/lib/enoent.js +0 -59
  52. package/node_modules/cross-spawn/lib/parse.js +0 -91
  53. package/node_modules/cross-spawn/lib/util/escape.js +0 -45
  54. package/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  55. package/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  56. package/node_modules/cross-spawn/package.json +0 -73
  57. package/node_modules/default-browser/node_modules/execa/index.d.ts +0 -937
  58. package/node_modules/default-browser/node_modules/execa/index.js +0 -309
  59. package/node_modules/default-browser/node_modules/execa/lib/command.js +0 -120
  60. package/node_modules/default-browser/node_modules/execa/lib/error.js +0 -87
  61. package/node_modules/default-browser/node_modules/execa/lib/kill.js +0 -102
  62. package/node_modules/default-browser/node_modules/execa/lib/pipe.js +0 -42
  63. package/node_modules/default-browser/node_modules/execa/lib/promise.js +0 -36
  64. package/node_modules/default-browser/node_modules/execa/lib/stdio.js +0 -49
  65. package/node_modules/default-browser/node_modules/execa/lib/stream.js +0 -119
  66. package/node_modules/default-browser/node_modules/execa/lib/verbose.js +0 -19
  67. package/node_modules/default-browser/node_modules/execa/package.json +0 -87
  68. package/node_modules/default-browser/node_modules/execa/readme.md +0 -824
  69. package/node_modules/default-browser/node_modules/human-signals/LICENSE +0 -201
  70. package/node_modules/default-browser/node_modules/human-signals/README.md +0 -178
  71. package/node_modules/default-browser/node_modules/human-signals/build/src/core.js +0 -273
  72. package/node_modules/default-browser/node_modules/human-signals/build/src/main.d.ts +0 -73
  73. package/node_modules/default-browser/node_modules/human-signals/build/src/main.js +0 -70
  74. package/node_modules/default-browser/node_modules/human-signals/build/src/realtime.js +0 -16
  75. package/node_modules/default-browser/node_modules/human-signals/build/src/signals.js +0 -34
  76. package/node_modules/default-browser/node_modules/human-signals/package.json +0 -61
  77. package/node_modules/default-browser/node_modules/is-stream/index.d.ts +0 -81
  78. package/node_modules/default-browser/node_modules/is-stream/index.js +0 -29
  79. package/node_modules/default-browser/node_modules/is-stream/license +0 -9
  80. package/node_modules/default-browser/node_modules/is-stream/package.json +0 -44
  81. package/node_modules/default-browser/node_modules/is-stream/readme.md +0 -60
  82. package/node_modules/default-browser/node_modules/mimic-fn/index.d.ts +0 -52
  83. package/node_modules/default-browser/node_modules/mimic-fn/index.js +0 -71
  84. package/node_modules/default-browser/node_modules/mimic-fn/license +0 -9
  85. package/node_modules/default-browser/node_modules/mimic-fn/package.json +0 -45
  86. package/node_modules/default-browser/node_modules/mimic-fn/readme.md +0 -90
  87. package/node_modules/default-browser/node_modules/npm-run-path/index.d.ts +0 -90
  88. package/node_modules/default-browser/node_modules/npm-run-path/index.js +0 -52
  89. package/node_modules/default-browser/node_modules/npm-run-path/license +0 -9
  90. package/node_modules/default-browser/node_modules/npm-run-path/package.json +0 -49
  91. package/node_modules/default-browser/node_modules/npm-run-path/readme.md +0 -104
  92. package/node_modules/default-browser/node_modules/onetime/index.d.ts +0 -59
  93. package/node_modules/default-browser/node_modules/onetime/index.js +0 -41
  94. package/node_modules/default-browser/node_modules/onetime/license +0 -9
  95. package/node_modules/default-browser/node_modules/onetime/package.json +0 -45
  96. package/node_modules/default-browser/node_modules/onetime/readme.md +0 -94
  97. package/node_modules/default-browser/node_modules/path-key/index.d.ts +0 -31
  98. package/node_modules/default-browser/node_modules/path-key/index.js +0 -12
  99. package/node_modules/default-browser/node_modules/path-key/license +0 -9
  100. package/node_modules/default-browser/node_modules/path-key/package.json +0 -41
  101. package/node_modules/default-browser/node_modules/path-key/readme.md +0 -57
  102. package/node_modules/default-browser/node_modules/strip-final-newline/index.js +0 -14
  103. package/node_modules/default-browser/node_modules/strip-final-newline/license +0 -9
  104. package/node_modules/default-browser/node_modules/strip-final-newline/package.json +0 -43
  105. package/node_modules/default-browser/node_modules/strip-final-newline/readme.md +0 -35
  106. package/node_modules/execa/index.d.ts +0 -564
  107. package/node_modules/execa/index.js +0 -268
  108. package/node_modules/execa/lib/command.js +0 -52
  109. package/node_modules/execa/lib/error.js +0 -88
  110. package/node_modules/execa/lib/kill.js +0 -115
  111. package/node_modules/execa/lib/promise.js +0 -46
  112. package/node_modules/execa/lib/stdio.js +0 -52
  113. package/node_modules/execa/lib/stream.js +0 -97
  114. package/node_modules/execa/license +0 -9
  115. package/node_modules/execa/package.json +0 -74
  116. package/node_modules/execa/readme.md +0 -663
  117. package/node_modules/get-stream/buffer-stream.js +0 -52
  118. package/node_modules/get-stream/index.d.ts +0 -105
  119. package/node_modules/get-stream/index.js +0 -61
  120. package/node_modules/get-stream/license +0 -9
  121. package/node_modules/get-stream/package.json +0 -47
  122. package/node_modules/get-stream/readme.md +0 -124
  123. package/node_modules/human-signals/CHANGELOG.md +0 -11
  124. package/node_modules/human-signals/LICENSE +0 -201
  125. package/node_modules/human-signals/README.md +0 -165
  126. package/node_modules/human-signals/build/src/core.js +0 -273
  127. package/node_modules/human-signals/build/src/core.js.map +0 -1
  128. package/node_modules/human-signals/build/src/main.d.ts +0 -52
  129. package/node_modules/human-signals/build/src/main.js +0 -71
  130. package/node_modules/human-signals/build/src/main.js.map +0 -1
  131. package/node_modules/human-signals/build/src/realtime.js +0 -19
  132. package/node_modules/human-signals/build/src/realtime.js.map +0 -1
  133. package/node_modules/human-signals/build/src/signals.js +0 -35
  134. package/node_modules/human-signals/build/src/signals.js.map +0 -1
  135. package/node_modules/human-signals/package.json +0 -64
  136. package/node_modules/is-stream/index.d.ts +0 -79
  137. package/node_modules/is-stream/index.js +0 -28
  138. package/node_modules/is-stream/license +0 -9
  139. package/node_modules/is-stream/package.json +0 -42
  140. package/node_modules/is-stream/readme.md +0 -60
  141. package/node_modules/is-wsl/index.js +0 -31
  142. package/node_modules/is-wsl/license +0 -9
  143. package/node_modules/is-wsl/node_modules/is-docker/cli.js +0 -5
  144. package/node_modules/is-wsl/node_modules/is-docker/index.d.ts +0 -15
  145. package/node_modules/is-wsl/node_modules/is-docker/index.js +0 -29
  146. package/node_modules/is-wsl/node_modules/is-docker/license +0 -9
  147. package/node_modules/is-wsl/node_modules/is-docker/package.json +0 -42
  148. package/node_modules/is-wsl/node_modules/is-docker/readme.md +0 -27
  149. package/node_modules/is-wsl/readme.md +0 -36
  150. package/node_modules/isexe/.npmignore +0 -2
  151. package/node_modules/isexe/LICENSE +0 -15
  152. package/node_modules/isexe/README.md +0 -51
  153. package/node_modules/isexe/index.js +0 -57
  154. package/node_modules/isexe/mode.js +0 -41
  155. package/node_modules/isexe/package.json +0 -31
  156. package/node_modules/isexe/test/basic.js +0 -221
  157. package/node_modules/isexe/windows.js +0 -42
  158. package/node_modules/merge-stream/LICENSE +0 -21
  159. package/node_modules/merge-stream/README.md +0 -78
  160. package/node_modules/merge-stream/index.js +0 -41
  161. package/node_modules/merge-stream/package.json +0 -19
  162. package/node_modules/mimic-fn/index.d.ts +0 -54
  163. package/node_modules/mimic-fn/index.js +0 -13
  164. package/node_modules/mimic-fn/license +0 -9
  165. package/node_modules/mimic-fn/package.json +0 -42
  166. package/node_modules/mimic-fn/readme.md +0 -69
  167. package/node_modules/npm-run-path/index.d.ts +0 -89
  168. package/node_modules/npm-run-path/index.js +0 -47
  169. package/node_modules/npm-run-path/license +0 -9
  170. package/node_modules/npm-run-path/package.json +0 -44
  171. package/node_modules/npm-run-path/readme.md +0 -115
  172. package/node_modules/onetime/index.d.ts +0 -64
  173. package/node_modules/onetime/index.js +0 -44
  174. package/node_modules/onetime/license +0 -9
  175. package/node_modules/onetime/package.json +0 -43
  176. package/node_modules/onetime/readme.md +0 -94
  177. package/node_modules/path-key/index.d.ts +0 -40
  178. package/node_modules/path-key/index.js +0 -16
  179. package/node_modules/path-key/license +0 -9
  180. package/node_modules/path-key/package.json +0 -39
  181. package/node_modules/path-key/readme.md +0 -61
  182. package/node_modules/shebang-command/index.js +0 -19
  183. package/node_modules/shebang-command/license +0 -9
  184. package/node_modules/shebang-command/package.json +0 -34
  185. package/node_modules/shebang-command/readme.md +0 -34
  186. package/node_modules/shebang-regex/index.d.ts +0 -22
  187. package/node_modules/shebang-regex/index.js +0 -2
  188. package/node_modules/shebang-regex/license +0 -9
  189. package/node_modules/shebang-regex/package.json +0 -35
  190. package/node_modules/shebang-regex/readme.md +0 -33
  191. package/node_modules/signal-exit/LICENSE.txt +0 -16
  192. package/node_modules/signal-exit/README.md +0 -39
  193. package/node_modules/signal-exit/index.js +0 -202
  194. package/node_modules/signal-exit/package.json +0 -38
  195. package/node_modules/signal-exit/signals.js +0 -53
  196. package/node_modules/strip-final-newline/index.js +0 -16
  197. package/node_modules/strip-final-newline/license +0 -9
  198. package/node_modules/strip-final-newline/package.json +0 -40
  199. package/node_modules/strip-final-newline/readme.md +0 -30
  200. package/node_modules/titleize/index.d.ts +0 -17
  201. package/node_modules/titleize/index.js +0 -7
  202. package/node_modules/titleize/license +0 -9
  203. package/node_modules/titleize/package.json +0 -42
  204. package/node_modules/titleize/readme.md +0 -25
  205. package/node_modules/untildify/index.d.ts +0 -14
  206. package/node_modules/untildify/index.js +0 -12
  207. package/node_modules/untildify/license +0 -9
  208. package/node_modules/untildify/package.json +0 -43
  209. package/node_modules/untildify/readme.md +0 -30
  210. package/node_modules/which/CHANGELOG.md +0 -166
  211. package/node_modules/which/LICENSE +0 -15
  212. package/node_modules/which/README.md +0 -54
  213. package/node_modules/which/bin/node-which +0 -52
  214. package/node_modules/which/package.json +0 -43
  215. package/node_modules/which/which.js +0 -125
  216. /package/node_modules/{default-browser/node_modules/execa → open/node_modules/is-wsl}/license +0 -0
@@ -1,61 +0,0 @@
1
- # path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key)
2
-
3
- > Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform
4
-
5
- It's usually `PATH`, but on Windows it can be any casing like `Path`...
6
-
7
-
8
- ## Install
9
-
10
- ```
11
- $ npm install path-key
12
- ```
13
-
14
-
15
- ## Usage
16
-
17
- ```js
18
- const pathKey = require('path-key');
19
-
20
- const key = pathKey();
21
- //=> 'PATH'
22
-
23
- const PATH = process.env[key];
24
- //=> '/usr/local/bin:/usr/bin:/bin'
25
- ```
26
-
27
-
28
- ## API
29
-
30
- ### pathKey(options?)
31
-
32
- #### options
33
-
34
- Type: `object`
35
-
36
- ##### env
37
-
38
- Type: `object`<br>
39
- Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)
40
-
41
- Use a custom environment variables object.
42
-
43
- #### platform
44
-
45
- Type: `string`<br>
46
- Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)
47
-
48
- Get the PATH key for a specific platform.
49
-
50
-
51
- ---
52
-
53
- <div align="center">
54
- <b>
55
- <a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
56
- </b>
57
- <br>
58
- <sub>
59
- Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
60
- </sub>
61
- </div>
@@ -1,19 +0,0 @@
1
- 'use strict';
2
- const shebangRegex = require('shebang-regex');
3
-
4
- module.exports = (string = '') => {
5
- const match = string.match(shebangRegex);
6
-
7
- if (!match) {
8
- return null;
9
- }
10
-
11
- const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
12
- const binary = path.split('/').pop();
13
-
14
- if (binary === 'env') {
15
- return argument;
16
- }
17
-
18
- return argument ? `${binary} ${argument}` : binary;
19
- };
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
4
-
5
- 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:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- 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.
@@ -1,34 +0,0 @@
1
- {
2
- "name": "shebang-command",
3
- "version": "2.0.0",
4
- "description": "Get the command from a shebang",
5
- "license": "MIT",
6
- "repository": "kevva/shebang-command",
7
- "author": {
8
- "name": "Kevin Mårtensson",
9
- "email": "kevinmartensson@gmail.com",
10
- "url": "github.com/kevva"
11
- },
12
- "engines": {
13
- "node": ">=8"
14
- },
15
- "scripts": {
16
- "test": "xo && ava"
17
- },
18
- "files": [
19
- "index.js"
20
- ],
21
- "keywords": [
22
- "cmd",
23
- "command",
24
- "parse",
25
- "shebang"
26
- ],
27
- "dependencies": {
28
- "shebang-regex": "^3.0.0"
29
- },
30
- "devDependencies": {
31
- "ava": "^2.3.0",
32
- "xo": "^0.24.0"
33
- }
34
- }
@@ -1,34 +0,0 @@
1
- # shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command)
2
-
3
- > Get the command from a shebang
4
-
5
-
6
- ## Install
7
-
8
- ```
9
- $ npm install shebang-command
10
- ```
11
-
12
-
13
- ## Usage
14
-
15
- ```js
16
- const shebangCommand = require('shebang-command');
17
-
18
- shebangCommand('#!/usr/bin/env node');
19
- //=> 'node'
20
-
21
- shebangCommand('#!/bin/bash');
22
- //=> 'bash'
23
- ```
24
-
25
-
26
- ## API
27
-
28
- ### shebangCommand(string)
29
-
30
- #### string
31
-
32
- Type: `string`
33
-
34
- String containing a shebang.
@@ -1,22 +0,0 @@
1
- /**
2
- Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line.
3
-
4
- @example
5
- ```
6
- import shebangRegex = require('shebang-regex');
7
-
8
- const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
9
-
10
- shebangRegex.test(string);
11
- //=> true
12
-
13
- shebangRegex.exec(string)[0];
14
- //=> '#!/usr/bin/env node'
15
-
16
- shebangRegex.exec(string)[1];
17
- //=> '/usr/bin/env node'
18
- ```
19
- */
20
- declare const shebangRegex: RegExp;
21
-
22
- export = shebangRegex;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = /^#!(.*)/;
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
-
5
- 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:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- 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.
@@ -1,35 +0,0 @@
1
- {
2
- "name": "shebang-regex",
3
- "version": "3.0.0",
4
- "description": "Regular expression for matching a shebang line",
5
- "license": "MIT",
6
- "repository": "sindresorhus/shebang-regex",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "engines": {
13
- "node": ">=8"
14
- },
15
- "scripts": {
16
- "test": "xo && ava && tsd"
17
- },
18
- "files": [
19
- "index.js",
20
- "index.d.ts"
21
- ],
22
- "keywords": [
23
- "regex",
24
- "regexp",
25
- "shebang",
26
- "match",
27
- "test",
28
- "line"
29
- ],
30
- "devDependencies": {
31
- "ava": "^1.4.1",
32
- "tsd": "^0.7.2",
33
- "xo": "^0.24.0"
34
- }
35
- }
@@ -1,33 +0,0 @@
1
- # shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex)
2
-
3
- > Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line
4
-
5
-
6
- ## Install
7
-
8
- ```
9
- $ npm install shebang-regex
10
- ```
11
-
12
-
13
- ## Usage
14
-
15
- ```js
16
- const shebangRegex = require('shebang-regex');
17
-
18
- const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
19
-
20
- shebangRegex.test(string);
21
- //=> true
22
-
23
- shebangRegex.exec(string)[0];
24
- //=> '#!/usr/bin/env node'
25
-
26
- shebangRegex.exec(string)[1];
27
- //=> '/usr/bin/env node'
28
- ```
29
-
30
-
31
- ## License
32
-
33
- MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -1,16 +0,0 @@
1
- The ISC License
2
-
3
- Copyright (c) 2015, Contributors
4
-
5
- Permission to use, copy, modify, and/or distribute this software
6
- for any purpose with or without fee is hereby granted, provided
7
- that the above copyright notice and this permission notice
8
- appear in all copies.
9
-
10
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
12
- OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
13
- LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
14
- OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
15
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
16
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,39 +0,0 @@
1
- # signal-exit
2
-
3
- [![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit)
4
- [![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master)
5
- [![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit)
6
- [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
7
-
8
- When you want to fire an event no matter how a process exits:
9
-
10
- * reaching the end of execution.
11
- * explicitly having `process.exit(code)` called.
12
- * having `process.kill(pid, sig)` called.
13
- * receiving a fatal signal from outside the process
14
-
15
- Use `signal-exit`.
16
-
17
- ```js
18
- var onExit = require('signal-exit')
19
-
20
- onExit(function (code, signal) {
21
- console.log('process exited!')
22
- })
23
- ```
24
-
25
- ## API
26
-
27
- `var remove = onExit(function (code, signal) {}, options)`
28
-
29
- The return value of the function is a function that will remove the
30
- handler.
31
-
32
- Note that the function *only* fires for signals if the signal would
33
- cause the process to exit. That is, there are no other listeners, and
34
- it is a fatal signal.
35
-
36
- ## Options
37
-
38
- * `alwaysLast`: Run this handler after any other signal or exit
39
- handlers. This causes `process.emit` to be monkeypatched.
@@ -1,202 +0,0 @@
1
- // Note: since nyc uses this module to output coverage, any lines
2
- // that are in the direct sync flow of nyc's outputCoverage are
3
- // ignored, since we can never get coverage for them.
4
- // grab a reference to node's real process object right away
5
- var process = global.process
6
-
7
- const processOk = function (process) {
8
- return process &&
9
- typeof process === 'object' &&
10
- typeof process.removeListener === 'function' &&
11
- typeof process.emit === 'function' &&
12
- typeof process.reallyExit === 'function' &&
13
- typeof process.listeners === 'function' &&
14
- typeof process.kill === 'function' &&
15
- typeof process.pid === 'number' &&
16
- typeof process.on === 'function'
17
- }
18
-
19
- // some kind of non-node environment, just no-op
20
- /* istanbul ignore if */
21
- if (!processOk(process)) {
22
- module.exports = function () {
23
- return function () {}
24
- }
25
- } else {
26
- var assert = require('assert')
27
- var signals = require('./signals.js')
28
- var isWin = /^win/i.test(process.platform)
29
-
30
- var EE = require('events')
31
- /* istanbul ignore if */
32
- if (typeof EE !== 'function') {
33
- EE = EE.EventEmitter
34
- }
35
-
36
- var emitter
37
- if (process.__signal_exit_emitter__) {
38
- emitter = process.__signal_exit_emitter__
39
- } else {
40
- emitter = process.__signal_exit_emitter__ = new EE()
41
- emitter.count = 0
42
- emitter.emitted = {}
43
- }
44
-
45
- // Because this emitter is a global, we have to check to see if a
46
- // previous version of this library failed to enable infinite listeners.
47
- // I know what you're about to say. But literally everything about
48
- // signal-exit is a compromise with evil. Get used to it.
49
- if (!emitter.infinite) {
50
- emitter.setMaxListeners(Infinity)
51
- emitter.infinite = true
52
- }
53
-
54
- module.exports = function (cb, opts) {
55
- /* istanbul ignore if */
56
- if (!processOk(global.process)) {
57
- return function () {}
58
- }
59
- assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
60
-
61
- if (loaded === false) {
62
- load()
63
- }
64
-
65
- var ev = 'exit'
66
- if (opts && opts.alwaysLast) {
67
- ev = 'afterexit'
68
- }
69
-
70
- var remove = function () {
71
- emitter.removeListener(ev, cb)
72
- if (emitter.listeners('exit').length === 0 &&
73
- emitter.listeners('afterexit').length === 0) {
74
- unload()
75
- }
76
- }
77
- emitter.on(ev, cb)
78
-
79
- return remove
80
- }
81
-
82
- var unload = function unload () {
83
- if (!loaded || !processOk(global.process)) {
84
- return
85
- }
86
- loaded = false
87
-
88
- signals.forEach(function (sig) {
89
- try {
90
- process.removeListener(sig, sigListeners[sig])
91
- } catch (er) {}
92
- })
93
- process.emit = originalProcessEmit
94
- process.reallyExit = originalProcessReallyExit
95
- emitter.count -= 1
96
- }
97
- module.exports.unload = unload
98
-
99
- var emit = function emit (event, code, signal) {
100
- /* istanbul ignore if */
101
- if (emitter.emitted[event]) {
102
- return
103
- }
104
- emitter.emitted[event] = true
105
- emitter.emit(event, code, signal)
106
- }
107
-
108
- // { <signal>: <listener fn>, ... }
109
- var sigListeners = {}
110
- signals.forEach(function (sig) {
111
- sigListeners[sig] = function listener () {
112
- /* istanbul ignore if */
113
- if (!processOk(global.process)) {
114
- return
115
- }
116
- // If there are no other listeners, an exit is coming!
117
- // Simplest way: remove us and then re-send the signal.
118
- // We know that this will kill the process, so we can
119
- // safely emit now.
120
- var listeners = process.listeners(sig)
121
- if (listeners.length === emitter.count) {
122
- unload()
123
- emit('exit', null, sig)
124
- /* istanbul ignore next */
125
- emit('afterexit', null, sig)
126
- /* istanbul ignore next */
127
- if (isWin && sig === 'SIGHUP') {
128
- // "SIGHUP" throws an `ENOSYS` error on Windows,
129
- // so use a supported signal instead
130
- sig = 'SIGINT'
131
- }
132
- /* istanbul ignore next */
133
- process.kill(process.pid, sig)
134
- }
135
- }
136
- })
137
-
138
- module.exports.signals = function () {
139
- return signals
140
- }
141
-
142
- var loaded = false
143
-
144
- var load = function load () {
145
- if (loaded || !processOk(global.process)) {
146
- return
147
- }
148
- loaded = true
149
-
150
- // This is the number of onSignalExit's that are in play.
151
- // It's important so that we can count the correct number of
152
- // listeners on signals, and don't wait for the other one to
153
- // handle it instead of us.
154
- emitter.count += 1
155
-
156
- signals = signals.filter(function (sig) {
157
- try {
158
- process.on(sig, sigListeners[sig])
159
- return true
160
- } catch (er) {
161
- return false
162
- }
163
- })
164
-
165
- process.emit = processEmit
166
- process.reallyExit = processReallyExit
167
- }
168
- module.exports.load = load
169
-
170
- var originalProcessReallyExit = process.reallyExit
171
- var processReallyExit = function processReallyExit (code) {
172
- /* istanbul ignore if */
173
- if (!processOk(global.process)) {
174
- return
175
- }
176
- process.exitCode = code || /* istanbul ignore next */ 0
177
- emit('exit', process.exitCode, null)
178
- /* istanbul ignore next */
179
- emit('afterexit', process.exitCode, null)
180
- /* istanbul ignore next */
181
- originalProcessReallyExit.call(process, process.exitCode)
182
- }
183
-
184
- var originalProcessEmit = process.emit
185
- var processEmit = function processEmit (ev, arg) {
186
- if (ev === 'exit' && processOk(global.process)) {
187
- /* istanbul ignore else */
188
- if (arg !== undefined) {
189
- process.exitCode = arg
190
- }
191
- var ret = originalProcessEmit.apply(this, arguments)
192
- /* istanbul ignore next */
193
- emit('exit', process.exitCode, null)
194
- /* istanbul ignore next */
195
- emit('afterexit', process.exitCode, null)
196
- /* istanbul ignore next */
197
- return ret
198
- } else {
199
- return originalProcessEmit.apply(this, arguments)
200
- }
201
- }
202
- }
@@ -1,38 +0,0 @@
1
- {
2
- "name": "signal-exit",
3
- "version": "3.0.7",
4
- "description": "when you want to fire an event no matter how a process exits.",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "tap",
8
- "snap": "tap",
9
- "preversion": "npm test",
10
- "postversion": "npm publish",
11
- "prepublishOnly": "git push origin --follow-tags"
12
- },
13
- "files": [
14
- "index.js",
15
- "signals.js"
16
- ],
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/tapjs/signal-exit.git"
20
- },
21
- "keywords": [
22
- "signal",
23
- "exit"
24
- ],
25
- "author": "Ben Coe <ben@npmjs.com>",
26
- "license": "ISC",
27
- "bugs": {
28
- "url": "https://github.com/tapjs/signal-exit/issues"
29
- },
30
- "homepage": "https://github.com/tapjs/signal-exit",
31
- "devDependencies": {
32
- "chai": "^3.5.0",
33
- "coveralls": "^3.1.1",
34
- "nyc": "^15.1.0",
35
- "standard-version": "^9.3.1",
36
- "tap": "^15.1.1"
37
- }
38
- }
@@ -1,53 +0,0 @@
1
- // This is not the set of all possible signals.
2
- //
3
- // It IS, however, the set of all signals that trigger
4
- // an exit on either Linux or BSD systems. Linux is a
5
- // superset of the signal names supported on BSD, and
6
- // the unknown signals just fail to register, so we can
7
- // catch that easily enough.
8
- //
9
- // Don't bother with SIGKILL. It's uncatchable, which
10
- // means that we can't fire any callbacks anyway.
11
- //
12
- // If a user does happen to register a handler on a non-
13
- // fatal signal like SIGWINCH or something, and then
14
- // exit, it'll end up firing `process.emit('exit')`, so
15
- // the handler will be fired anyway.
16
- //
17
- // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
18
- // artificially, inherently leave the process in a
19
- // state from which it is not safe to try and enter JS
20
- // listeners.
21
- module.exports = [
22
- 'SIGABRT',
23
- 'SIGALRM',
24
- 'SIGHUP',
25
- 'SIGINT',
26
- 'SIGTERM'
27
- ]
28
-
29
- if (process.platform !== 'win32') {
30
- module.exports.push(
31
- 'SIGVTALRM',
32
- 'SIGXCPU',
33
- 'SIGXFSZ',
34
- 'SIGUSR2',
35
- 'SIGTRAP',
36
- 'SIGSYS',
37
- 'SIGQUIT',
38
- 'SIGIOT'
39
- // should detect profiler and enable/disable accordingly.
40
- // see #21
41
- // 'SIGPROF'
42
- )
43
- }
44
-
45
- if (process.platform === 'linux') {
46
- module.exports.push(
47
- 'SIGIO',
48
- 'SIGPOLL',
49
- 'SIGPWR',
50
- 'SIGSTKFLT',
51
- 'SIGUNUSED'
52
- )
53
- }
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = input => {
4
- const LF = typeof input === 'string' ? '\n' : '\n'.charCodeAt();
5
- const CR = typeof input === 'string' ? '\r' : '\r'.charCodeAt();
6
-
7
- if (input[input.length - 1] === LF) {
8
- input = input.slice(0, input.length - 1);
9
- }
10
-
11
- if (input[input.length - 1] === CR) {
12
- input = input.slice(0, input.length - 1);
13
- }
14
-
15
- return input;
16
- };
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
-
5
- 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:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- 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.