angular-slickgrid 4.2.1 → 4.2.2

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 (205) hide show
  1. package/LICENSE +20 -20
  2. package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +2 -2
  3. package/app/modules/angular-slickgrid/extensions/slickRowDetailView.d.ts +0 -2
  4. package/docs/assets/lib/multiple-select/README.md +17 -17
  5. package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +14 -14
  6. package/esm2020/app/modules/angular-slickgrid/constants.mjs +1 -1
  7. package/esm2020/app/modules/angular-slickgrid/extensions/index.mjs +1 -1
  8. package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +2 -4
  9. package/esm2020/app/modules/angular-slickgrid/global-grid-options.mjs +1 -1
  10. package/esm2020/app/modules/angular-slickgrid/index.mjs +1 -1
  11. package/esm2020/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs +1 -1
  12. package/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +1 -1
  13. package/esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs +1 -1
  14. package/esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs +1 -1
  15. package/esm2020/app/modules/angular-slickgrid/models/index.mjs +1 -1
  16. package/esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs +1 -1
  17. package/esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs +1 -1
  18. package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +7 -10
  19. package/esm2020/app/modules/angular-slickgrid/services/angularUtil.service.mjs +4 -4
  20. package/esm2020/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +4 -4
  21. package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +4 -4
  22. package/esm2020/app/modules/angular-slickgrid/services/index.mjs +1 -1
  23. package/esm2020/app/modules/angular-slickgrid/services/translater.service.mjs +4 -4
  24. package/esm2020/app/modules/angular-slickgrid/services/utilities.mjs +1 -1
  25. package/esm2020/app/modules/angular-slickgrid/slickgrid-config.mjs +1 -1
  26. package/esm2020/public_api.mjs +1 -1
  27. package/fesm2015/angular-slickgrid.mjs +32 -37
  28. package/fesm2015/angular-slickgrid.mjs.map +1 -1
  29. package/fesm2020/angular-slickgrid.mjs +32 -37
  30. package/fesm2020/angular-slickgrid.mjs.map +1 -1
  31. package/i18n/en.json +89 -89
  32. package/i18n/fr.json +90 -90
  33. package/{angular-slickgrid.d.ts → index.d.ts} +0 -0
  34. package/package.json +11 -11
  35. package/test/cypress/node_modules/@cypress/request/README.md +1038 -0
  36. package/test/cypress/node_modules/@cypress/xvfb/README.md +48 -0
  37. package/test/cypress/node_modules/@cypress/xvfb/node_modules/debug/README.md +437 -0
  38. package/test/cypress/node_modules/@types/node/README.md +16 -0
  39. package/test/cypress/node_modules/@types/sinonjs__fake-timers/README.md +16 -0
  40. package/test/cypress/node_modules/@types/sizzle/README.md +16 -0
  41. package/test/cypress/node_modules/@types/yauzl/README.md +16 -0
  42. package/test/cypress/node_modules/@types/yauzl/node_modules/@types/node/README.md +16 -0
  43. package/test/cypress/node_modules/aggregate-error/README.md +61 -0
  44. package/test/cypress/node_modules/ansi-colors/README.md +315 -0
  45. package/test/cypress/node_modules/ansi-escapes/README.md +245 -0
  46. package/test/cypress/node_modules/ansi-regex/README.md +78 -0
  47. package/test/cypress/node_modules/ansi-styles/README.md +152 -0
  48. package/test/cypress/node_modules/arch/README.md +71 -0
  49. package/test/cypress/node_modules/asn1/README.md +50 -0
  50. package/test/cypress/node_modules/assert-plus/README.md +162 -0
  51. package/test/cypress/node_modules/astral-regex/README.md +46 -0
  52. package/test/cypress/node_modules/async/README.md +60 -0
  53. package/test/cypress/node_modules/asynckit/README.md +233 -0
  54. package/test/cypress/node_modules/at-least-node/README.md +25 -0
  55. package/test/cypress/node_modules/aws-sign2/README.md +4 -0
  56. package/test/cypress/node_modules/aws4/README.md +183 -0
  57. package/test/cypress/node_modules/balanced-match/README.md +91 -0
  58. package/test/cypress/node_modules/base64-js/README.md +34 -0
  59. package/test/cypress/node_modules/bcrypt-pbkdf/README.md +45 -0
  60. package/test/cypress/node_modules/blob-util/README.md +623 -0
  61. package/test/cypress/node_modules/bluebird/README.md +57 -0
  62. package/test/cypress/node_modules/brace-expansion/README.md +129 -0
  63. package/test/cypress/node_modules/buffer/README.md +410 -0
  64. package/test/cypress/node_modules/buffer-crc32/README.md +47 -0
  65. package/test/cypress/node_modules/cachedir/README.md +27 -0
  66. package/test/cypress/node_modules/caseless/README.md +45 -0
  67. package/test/cypress/node_modules/chalk/README.md +293 -0
  68. package/test/cypress/node_modules/chalk/node_modules/supports-color/README.md +76 -0
  69. package/test/cypress/node_modules/check-more-types/README.md +952 -0
  70. package/test/cypress/node_modules/ci-info/README.md +114 -0
  71. package/test/cypress/node_modules/clean-stack/README.md +76 -0
  72. package/test/cypress/node_modules/cli-cursor/README.md +55 -0
  73. package/test/cypress/node_modules/cli-table3/README.md +218 -0
  74. package/test/cypress/node_modules/cli-truncate/README.md +139 -0
  75. package/test/cypress/node_modules/color-convert/README.md +68 -0
  76. package/test/cypress/node_modules/color-name/README.md +11 -0
  77. package/test/cypress/node_modules/colorette/README.md +102 -0
  78. package/test/cypress/node_modules/colors/README.md +221 -0
  79. package/test/cypress/node_modules/combined-stream/README.md +138 -0
  80. package/test/cypress/node_modules/commander/README.md +737 -0
  81. package/test/cypress/node_modules/common-tags/README.md +687 -0
  82. package/test/cypress/node_modules/core-util-is/README.md +3 -0
  83. package/test/cypress/node_modules/cross-spawn/README.md +96 -0
  84. package/test/cypress/node_modules/cypress/README.md +25 -0
  85. package/test/cypress/node_modules/cypress/mount-utils/README.md +14 -0
  86. package/test/cypress/node_modules/cypress/react/README.md +414 -0
  87. package/test/cypress/node_modules/cypress/vue/README.md +678 -0
  88. package/test/cypress/node_modules/cypress/vue2/README.md +693 -0
  89. package/test/cypress/node_modules/dashdash/README.md +574 -0
  90. package/test/cypress/node_modules/dayjs/README.md +128 -0
  91. package/test/cypress/node_modules/debug/README.md +455 -0
  92. package/test/cypress/node_modules/delayed-stream/README.md +141 -0
  93. package/test/cypress/node_modules/ecc-jsbn/README.md +8 -0
  94. package/test/cypress/node_modules/emoji-regex/README.md +73 -0
  95. package/test/cypress/node_modules/end-of-stream/README.md +54 -0
  96. package/test/cypress/node_modules/enquirer/README.md +1752 -0
  97. package/test/cypress/node_modules/escape-string-regexp/README.md +27 -0
  98. package/test/cypress/node_modules/eventemitter2/README.md +809 -0
  99. package/test/cypress/node_modules/execa/README.md +656 -0
  100. package/test/cypress/node_modules/executable/README.md +64 -0
  101. package/test/cypress/node_modules/extend/README.md +81 -0
  102. package/test/cypress/node_modules/extract-zip/README.md +57 -0
  103. package/test/cypress/node_modules/extract-zip/node_modules/debug/README.md +455 -0
  104. package/test/cypress/node_modules/extsprintf/README.md +46 -0
  105. package/test/cypress/node_modules/fd-slicer/README.md +199 -0
  106. package/test/cypress/node_modules/figures/README.md +139 -0
  107. package/test/cypress/node_modules/forever-agent/README.md +4 -0
  108. package/test/cypress/node_modules/form-data/README.md +234 -0
  109. package/test/cypress/node_modules/fs-extra/README.md +264 -0
  110. package/test/cypress/node_modules/fs.realpath/README.md +33 -0
  111. package/test/cypress/node_modules/get-stream/README.md +124 -0
  112. package/test/cypress/node_modules/getos/README.md +79 -0
  113. package/test/cypress/node_modules/getpass/README.md +32 -0
  114. package/test/cypress/node_modules/glob/README.md +375 -0
  115. package/test/cypress/node_modules/global-dirs/README.md +72 -0
  116. package/test/cypress/node_modules/graceful-fs/README.md +133 -0
  117. package/test/cypress/node_modules/has-flag/README.md +89 -0
  118. package/test/cypress/node_modules/http-signature/README.md +80 -0
  119. package/test/cypress/node_modules/human-signals/README.md +155 -0
  120. package/test/cypress/node_modules/ieee754/README.md +51 -0
  121. package/test/cypress/node_modules/indent-string/README.md +70 -0
  122. package/test/cypress/node_modules/inflight/README.md +37 -0
  123. package/test/cypress/node_modules/inherits/README.md +42 -0
  124. package/test/cypress/node_modules/ini/README.md +102 -0
  125. package/test/cypress/node_modules/is-ci/README.md +50 -0
  126. package/test/cypress/node_modules/is-fullwidth-code-point/README.md +39 -0
  127. package/test/cypress/node_modules/is-installed-globally/README.md +31 -0
  128. package/test/cypress/node_modules/is-path-inside/README.md +63 -0
  129. package/test/cypress/node_modules/is-stream/README.md +57 -0
  130. package/test/cypress/node_modules/is-typedarray/README.md +16 -0
  131. package/test/cypress/node_modules/isexe/README.md +51 -0
  132. package/test/cypress/node_modules/isstream/README.md +66 -0
  133. package/test/cypress/node_modules/jsbn/README.md +175 -0
  134. package/test/cypress/node_modules/json-schema/README.md +3 -0
  135. package/test/cypress/node_modules/json-stringify-safe/README.md +52 -0
  136. package/test/cypress/node_modules/jsonfile/README.md +205 -0
  137. package/test/cypress/node_modules/jsonfile/node_modules/universalify/README.md +76 -0
  138. package/test/cypress/node_modules/jsprim/README.md +287 -0
  139. package/test/cypress/node_modules/lazy-ass/README.md +269 -0
  140. package/test/cypress/node_modules/listr2/README.md +17 -0
  141. package/test/cypress/node_modules/lodash/README.md +39 -0
  142. package/test/cypress/node_modules/lodash.once/README.md +18 -0
  143. package/test/cypress/node_modules/log-symbols/README.md +51 -0
  144. package/test/cypress/node_modules/log-update/README.md +97 -0
  145. package/test/cypress/node_modules/log-update/node_modules/slice-ansi/README.md +66 -0
  146. package/test/cypress/node_modules/log-update/node_modules/wrap-ansi/README.md +97 -0
  147. package/test/cypress/node_modules/lru-cache/README.md +166 -0
  148. package/test/cypress/node_modules/merge-stream/README.md +78 -0
  149. package/test/cypress/node_modules/mime-db/README.md +102 -0
  150. package/test/cypress/node_modules/mime-types/README.md +123 -0
  151. package/test/cypress/node_modules/mimic-fn/README.md +69 -0
  152. package/test/cypress/node_modules/minimatch/README.md +209 -0
  153. package/test/cypress/node_modules/ms/README.md +60 -0
  154. package/test/cypress/node_modules/npm-run-path/README.md +115 -0
  155. package/test/cypress/node_modules/once/README.md +79 -0
  156. package/test/cypress/node_modules/onetime/README.md +94 -0
  157. package/test/cypress/node_modules/ospath/README.md +53 -0
  158. package/test/cypress/node_modules/p-map/README.md +89 -0
  159. package/test/cypress/node_modules/path-is-absolute/README.md +59 -0
  160. package/test/cypress/node_modules/path-key/README.md +61 -0
  161. package/test/cypress/node_modules/pend/README.md +41 -0
  162. package/test/cypress/node_modules/performance-now/README.md +30 -0
  163. package/test/cypress/node_modules/pify/README.md +119 -0
  164. package/test/cypress/node_modules/pretty-bytes/README.md +131 -0
  165. package/test/cypress/node_modules/proxy-from-env/README.md +131 -0
  166. package/test/cypress/node_modules/psl/README.md +215 -0
  167. package/test/cypress/node_modules/pump/README.md +65 -0
  168. package/test/cypress/node_modules/punycode/README.md +122 -0
  169. package/test/cypress/node_modules/qs/README.md +475 -0
  170. package/test/cypress/node_modules/request-progress/README.md +78 -0
  171. package/test/cypress/node_modules/restore-cursor/README.md +26 -0
  172. package/test/cypress/node_modules/rimraf/README.md +101 -0
  173. package/test/cypress/node_modules/rxjs/README.md +147 -0
  174. package/test/cypress/node_modules/rxjs/_esm2015/README.md +147 -0
  175. package/test/cypress/node_modules/rxjs/_esm5/README.md +147 -0
  176. package/test/cypress/node_modules/rxjs/src/README.md +147 -0
  177. package/test/cypress/node_modules/safe-buffer/README.md +584 -0
  178. package/test/cypress/node_modules/safer-buffer/README.md +156 -0
  179. package/test/cypress/node_modules/semver/README.md +566 -0
  180. package/test/cypress/node_modules/shebang-command/README.md +34 -0
  181. package/test/cypress/node_modules/shebang-regex/README.md +33 -0
  182. package/test/cypress/node_modules/signal-exit/README.md +39 -0
  183. package/test/cypress/node_modules/slice-ansi/README.md +72 -0
  184. package/test/cypress/node_modules/sshpk/README.md +804 -0
  185. package/test/cypress/node_modules/string-width/README.md +50 -0
  186. package/test/cypress/node_modules/strip-ansi/README.md +46 -0
  187. package/test/cypress/node_modules/strip-final-newline/README.md +30 -0
  188. package/test/cypress/node_modules/supports-color/README.md +77 -0
  189. package/test/cypress/node_modules/throttleit/README.md +32 -0
  190. package/test/cypress/node_modules/tmp/README.md +365 -0
  191. package/test/cypress/node_modules/tough-cookie/README.md +527 -0
  192. package/test/cypress/node_modules/tslib/README.md +142 -0
  193. package/test/cypress/node_modules/tunnel-agent/README.md +4 -0
  194. package/test/cypress/node_modules/tweetnacl/README.md +459 -0
  195. package/test/cypress/node_modules/type-fest/README.md +760 -0
  196. package/test/cypress/node_modules/universalify/README.md +76 -0
  197. package/test/cypress/node_modules/untildify/README.md +30 -0
  198. package/test/cypress/node_modules/uuid/README.md +505 -0
  199. package/test/cypress/node_modules/verror/README.md +528 -0
  200. package/test/cypress/node_modules/verror/node_modules/extsprintf/README.md +46 -0
  201. package/test/cypress/node_modules/which/README.md +54 -0
  202. package/test/cypress/node_modules/wrap-ansi/README.md +91 -0
  203. package/test/cypress/node_modules/wrappy/README.md +36 -0
  204. package/test/cypress/node_modules/yallist/README.md +204 -0
  205. package/test/cypress/node_modules/yauzl/README.md +658 -0
@@ -0,0 +1,656 @@
1
+ <img src="media/logo.svg" width="400">
2
+ <br>
3
+
4
+ [![Build Status](https://travis-ci.com/sindresorhus/execa.svg?branch=master)](https://travis-ci.com/github/sindresorhus/execa) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master)
5
+
6
+ > Process execution for humans
7
+
8
+ ---
9
+
10
+ Netlify is looking for a senior/expert Node.js backend engineer to join a fully remote, international, diverse (44% women and non-binary) and friendly team. This is for the team where one of the co-maintainers [@ehmicky](https://github.com/ehmicky) is working. The job description is [here](https://boards.greenhouse.io/netlify/jobs/4832483002).
11
+
12
+ ---
13
+
14
+ ## Why
15
+
16
+ This package improves [`child_process`](https://nodejs.org/api/child_process.html) methods with:
17
+
18
+ - Promise interface.
19
+ - [Strips the final newline](#stripfinalnewline) from the output so you don't have to do `stdout.trim()`.
20
+ - Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform.
21
+ - [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why)
22
+ - Higher max buffer. 100 MB instead of 200 KB.
23
+ - [Executes locally installed binaries by name.](#preferlocal)
24
+ - [Cleans up spawned processes when the parent process dies.](#cleanup)
25
+ - [Get interleaved output](#all) from `stdout` and `stderr` similar to what is printed on the terminal. [*(Async only)*](#execasyncfile-arguments-options)
26
+ - [Can specify file and arguments as a single string without a shell](#execacommandcommand-options)
27
+ - More descriptive errors.
28
+
29
+ ## Install
30
+
31
+ ```
32
+ $ npm install execa
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ ```js
38
+ const execa = require('execa');
39
+
40
+ (async () => {
41
+ const {stdout} = await execa('echo', ['unicorns']);
42
+ console.log(stdout);
43
+ //=> 'unicorns'
44
+ })();
45
+ ```
46
+
47
+ ### Pipe the child process stdout to the parent
48
+
49
+ ```js
50
+ const execa = require('execa');
51
+
52
+ execa('echo', ['unicorns']).stdout.pipe(process.stdout);
53
+ ```
54
+
55
+ ### Handling Errors
56
+
57
+ ```js
58
+ const execa = require('execa');
59
+
60
+ (async () => {
61
+ // Catching an error
62
+ try {
63
+ await execa('unknown', ['command']);
64
+ } catch (error) {
65
+ console.log(error);
66
+ /*
67
+ {
68
+ message: 'Command failed with ENOENT: unknown command spawn unknown ENOENT',
69
+ errno: -2,
70
+ code: 'ENOENT',
71
+ syscall: 'spawn unknown',
72
+ path: 'unknown',
73
+ spawnargs: ['command'],
74
+ originalMessage: 'spawn unknown ENOENT',
75
+ shortMessage: 'Command failed with ENOENT: unknown command spawn unknown ENOENT',
76
+ command: 'unknown command',
77
+ stdout: '',
78
+ stderr: '',
79
+ all: '',
80
+ failed: true,
81
+ timedOut: false,
82
+ isCanceled: false,
83
+ killed: false
84
+ }
85
+ */
86
+ }
87
+
88
+ })();
89
+ ```
90
+
91
+ ### Cancelling a spawned process
92
+
93
+ ```js
94
+ const execa = require('execa');
95
+
96
+ (async () => {
97
+ const subprocess = execa('node');
98
+
99
+ setTimeout(() => {
100
+ subprocess.cancel();
101
+ }, 1000);
102
+
103
+ try {
104
+ await subprocess;
105
+ } catch (error) {
106
+ console.log(subprocess.killed); // true
107
+ console.log(error.isCanceled); // true
108
+ }
109
+ })()
110
+ ```
111
+
112
+ ### Catching an error with the sync method
113
+
114
+ ```js
115
+ try {
116
+ execa.sync('unknown', ['command']);
117
+ } catch (error) {
118
+ console.log(error);
119
+ /*
120
+ {
121
+ message: 'Command failed with ENOENT: unknown command spawnSync unknown ENOENT',
122
+ errno: -2,
123
+ code: 'ENOENT',
124
+ syscall: 'spawnSync unknown',
125
+ path: 'unknown',
126
+ spawnargs: ['command'],
127
+ originalMessage: 'spawnSync unknown ENOENT',
128
+ shortMessage: 'Command failed with ENOENT: unknown command spawnSync unknown ENOENT',
129
+ command: 'unknown command',
130
+ stdout: '',
131
+ stderr: '',
132
+ all: '',
133
+ failed: true,
134
+ timedOut: false,
135
+ isCanceled: false,
136
+ killed: false
137
+ }
138
+ */
139
+ }
140
+ ```
141
+
142
+ ### Kill a process
143
+
144
+ Using SIGTERM, and after 2 seconds, kill it with SIGKILL.
145
+
146
+ ```js
147
+ const subprocess = execa('node');
148
+
149
+ setTimeout(() => {
150
+ subprocess.kill('SIGTERM', {
151
+ forceKillAfterTimeout: 2000
152
+ });
153
+ }, 1000);
154
+ ```
155
+
156
+ ## API
157
+
158
+ ### execa(file, arguments, options?)
159
+
160
+ Execute a file. Think of this as a mix of [`child_process.execFile()`](https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback) and [`child_process.spawn()`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).
161
+
162
+ No escaping/quoting is needed.
163
+
164
+ Unless the [`shell`](#shell) option is used, no shell interpreter (Bash, `cmd.exe`, etc.) is used, so shell features such as variables substitution (`echo $PATH`) are not allowed.
165
+
166
+ Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess) which:
167
+ - is also a `Promise` resolving or rejecting with a [`childProcessResult`](#childProcessResult).
168
+ - exposes the following additional methods and properties.
169
+
170
+ #### kill(signal?, options?)
171
+
172
+ Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal) except: if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`.
173
+
174
+ ##### options.forceKillAfterTimeout
175
+
176
+ Type: `number | false`\
177
+ Default: `5000`
178
+
179
+ Milliseconds to wait for the child process to terminate before sending `SIGKILL`.
180
+
181
+ Can be disabled with `false`.
182
+
183
+ #### cancel()
184
+
185
+ Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`.
186
+
187
+ #### all
188
+
189
+ Type: `ReadableStream | undefined`
190
+
191
+ Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr).
192
+
193
+ This is `undefined` if either:
194
+ - the [`all` option](#all-2) is `false` (the default value)
195
+ - both [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options are set to [`'inherit'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio)
196
+
197
+ ### execa.sync(file, arguments?, options?)
198
+
199
+ Execute a file synchronously.
200
+
201
+ Returns or throws a [`childProcessResult`](#childProcessResult).
202
+
203
+ ### execa.command(command, options?)
204
+
205
+ Same as [`execa()`](#execafile-arguments-options) except both file and arguments are specified in a single `command` string. For example, `execa('echo', ['unicorns'])` is the same as `execa.command('echo unicorns')`.
206
+
207
+ If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.
208
+
209
+ The [`shell` option](#shell) must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`.
210
+
211
+ ### execa.commandSync(command, options?)
212
+
213
+ Same as [`execa.command()`](#execacommand-command-options) but synchronous.
214
+
215
+ Returns or throws a [`childProcessResult`](#childProcessResult).
216
+
217
+ ### execa.node(scriptPath, arguments?, options?)
218
+
219
+ Execute a Node.js script as a child process.
220
+
221
+ Same as `execa('node', [scriptPath, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):
222
+ - the current Node version and options are used. This can be overridden using the [`nodePath`](#nodepath-for-node-only) and [`nodeOptions`](#nodeoptions-for-node-only) options.
223
+ - the [`shell`](#shell) option cannot be used
224
+ - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)
225
+
226
+ ### childProcessResult
227
+
228
+ Type: `object`
229
+
230
+ Result of a child process execution. On success this is a plain object. On failure this is also an `Error` instance.
231
+
232
+ The child process [fails](#failed) when:
233
+ - its [exit code](#exitcode) is not `0`
234
+ - it was [killed](#killed) with a [signal](#signal)
235
+ - [timing out](#timedout)
236
+ - [being canceled](#iscanceled)
237
+ - there's not enough memory or there are already too many child processes
238
+
239
+ #### command
240
+
241
+ Type: `string`
242
+
243
+ The file and arguments that were run.
244
+
245
+ #### exitCode
246
+
247
+ Type: `number`
248
+
249
+ The numeric exit code of the process that was run.
250
+
251
+ #### stdout
252
+
253
+ Type: `string | Buffer`
254
+
255
+ The output of the process on stdout.
256
+
257
+ #### stderr
258
+
259
+ Type: `string | Buffer`
260
+
261
+ The output of the process on stderr.
262
+
263
+ #### all
264
+
265
+ Type: `string | Buffer | undefined`
266
+
267
+ The output of the process with `stdout` and `stderr` interleaved.
268
+
269
+ This is `undefined` if either:
270
+ - the [`all` option](#all-2) is `false` (the default value)
271
+ - `execa.sync()` was used
272
+
273
+ #### failed
274
+
275
+ Type: `boolean`
276
+
277
+ Whether the process failed to run.
278
+
279
+ #### timedOut
280
+
281
+ Type: `boolean`
282
+
283
+ Whether the process timed out.
284
+
285
+ #### isCanceled
286
+
287
+ Type: `boolean`
288
+
289
+ Whether the process was canceled.
290
+
291
+ #### killed
292
+
293
+ Type: `boolean`
294
+
295
+ Whether the process was killed.
296
+
297
+ #### signal
298
+
299
+ Type: `string | undefined`
300
+
301
+ The name of the signal that was used to terminate the process. For example, `SIGFPE`.
302
+
303
+ If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`.
304
+
305
+ #### signalDescription
306
+
307
+ Type: `string | undefined`
308
+
309
+ A human-friendly description of the signal that was used to terminate the process. For example, `Floating point arithmetic error`.
310
+
311
+ If a signal terminated the process, this property is defined and included in the error message. Otherwise it is `undefined`. It is also `undefined` when the signal is very uncommon which should seldomly happen.
312
+
313
+ #### message
314
+
315
+ Type: `string`
316
+
317
+ Error message when the child process failed to run. In addition to the [underlying error message](#originalMessage), it also contains some information related to why the child process errored.
318
+
319
+ The child process [stderr](#stderr) then [stdout](#stdout) are appended to the end, separated with newlines and not interleaved.
320
+
321
+ #### shortMessage
322
+
323
+ Type: `string`
324
+
325
+ This is the same as the [`message` property](#message) except it does not include the child process stdout/stderr.
326
+
327
+ #### originalMessage
328
+
329
+ Type: `string | undefined`
330
+
331
+ Original error message. This is the same as the `message` property except it includes neither the child process stdout/stderr nor some additional information added by Execa.
332
+
333
+ This is `undefined` unless the child process exited due to an `error` event or a timeout.
334
+
335
+ ### options
336
+
337
+ Type: `object`
338
+
339
+ #### cleanup
340
+
341
+ Type: `boolean`\
342
+ Default: `true`
343
+
344
+ Kill the spawned process when the parent process exits unless either:
345
+ - the spawned process is [`detached`](https://nodejs.org/api/child_process.html#child_process_options_detached)
346
+ - the parent process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit
347
+
348
+ #### preferLocal
349
+
350
+ Type: `boolean`\
351
+ Default: `false`
352
+
353
+ Prefer locally installed binaries when looking for a binary to execute.\
354
+ If you `$ npm install foo`, you can then `execa('foo')`.
355
+
356
+ #### localDir
357
+
358
+ Type: `string`\
359
+ Default: `process.cwd()`
360
+
361
+ Preferred path to find locally installed binaries in (use with `preferLocal`).
362
+
363
+ #### execPath
364
+
365
+ Type: `string`\
366
+ Default: `process.execPath` (Current Node.js executable)
367
+
368
+ Path to the Node.js executable to use in child processes.
369
+
370
+ This can be either an absolute path or a path relative to the [`cwd` option](#cwd).
371
+
372
+ Requires [`preferLocal`](#preferlocal) to be `true`.
373
+
374
+ For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process.
375
+
376
+ #### buffer
377
+
378
+ Type: `boolean`\
379
+ Default: `true`
380
+
381
+ Buffer the output from the spawned process. When set to `false`, you must read the output of [`stdout`](#stdout-1) and [`stderr`](#stderr-1) (or [`all`](#all) if the [`all`](#all-2) option is `true`). Otherwise the returned promise will not be resolved/rejected.
382
+
383
+ If the spawned process fails, [`error.stdout`](#stdout), [`error.stderr`](#stderr), and [`error.all`](#all) will contain the buffered data.
384
+
385
+ #### input
386
+
387
+ Type: `string | Buffer | stream.Readable`
388
+
389
+ Write some input to the `stdin` of your binary.\
390
+ Streams are not allowed when using the synchronous methods.
391
+
392
+ #### stdin
393
+
394
+ Type: `string | number | Stream | undefined`\
395
+ Default: `pipe`
396
+
397
+ Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
398
+
399
+ #### stdout
400
+
401
+ Type: `string | number | Stream | undefined`\
402
+ Default: `pipe`
403
+
404
+ Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
405
+
406
+ #### stderr
407
+
408
+ Type: `string | number | Stream | undefined`\
409
+ Default: `pipe`
410
+
411
+ Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio).
412
+
413
+ #### all
414
+
415
+ Type: `boolean`\
416
+ Default: `false`
417
+
418
+ Add an `.all` property on the [promise](#all) and the [resolved value](#all-1). The property contains the output of the process with `stdout` and `stderr` interleaved.
419
+
420
+ #### reject
421
+
422
+ Type: `boolean`\
423
+ Default: `true`
424
+
425
+ Setting this to `false` resolves the promise with the error instead of rejecting it.
426
+
427
+ #### stripFinalNewline
428
+
429
+ Type: `boolean`\
430
+ Default: `true`
431
+
432
+ Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from the output.
433
+
434
+ #### extendEnv
435
+
436
+ Type: `boolean`\
437
+ Default: `true`
438
+
439
+ Set to `false` if you don't want to extend the environment variables when providing the `env` property.
440
+
441
+ ---
442
+
443
+ Execa also accepts the below options which are the same as the options for [`child_process#spawn()`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options)/[`child_process#exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback)
444
+
445
+ #### cwd
446
+
447
+ Type: `string`\
448
+ Default: `process.cwd()`
449
+
450
+ Current working directory of the child process.
451
+
452
+ #### env
453
+
454
+ Type: `object`\
455
+ Default: `process.env`
456
+
457
+ Environment key-value pairs. Extends automatically from `process.env`. Set [`extendEnv`](#extendenv) to `false` if you don't want this.
458
+
459
+ #### argv0
460
+
461
+ Type: `string`
462
+
463
+ Explicitly set the value of `argv[0]` sent to the child process. This will be set to `file` if not specified.
464
+
465
+ #### stdio
466
+
467
+ Type: `string | string[]`\
468
+ Default: `pipe`
469
+
470
+ Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.
471
+
472
+ #### serialization
473
+
474
+ Type: `string`\
475
+ Default: `'json'`
476
+
477
+ Specify the kind of serialization used for sending messages between processes when using the [`stdio: 'ipc'`](#stdio) option or [`execa.node()`](#execanodescriptpath-arguments-options):
478
+ - `json`: Uses `JSON.stringify()` and `JSON.parse()`.
479
+ - `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)
480
+
481
+ Requires Node.js `13.2.0` or later.
482
+
483
+ [More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)
484
+
485
+ #### detached
486
+
487
+ Type: `boolean`
488
+
489
+ Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).
490
+
491
+ #### uid
492
+
493
+ Type: `number`
494
+
495
+ Sets the user identity of the process.
496
+
497
+ #### gid
498
+
499
+ Type: `number`
500
+
501
+ Sets the group identity of the process.
502
+
503
+ #### shell
504
+
505
+ Type: `boolean | string`\
506
+ Default: `false`
507
+
508
+ If `true`, runs `file` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows.
509
+
510
+ We recommend against using this option since it is:
511
+ - not cross-platform, encouraging shell-specific syntax.
512
+ - slower, because of the additional shell interpretation.
513
+ - unsafe, potentially allowing command injection.
514
+
515
+ #### encoding
516
+
517
+ Type: `string | null`\
518
+ Default: `utf8`
519
+
520
+ Specify the character encoding used to decode the `stdout` and `stderr` output. If set to `null`, then `stdout` and `stderr` will be a `Buffer` instead of a string.
521
+
522
+ #### timeout
523
+
524
+ Type: `number`\
525
+ Default: `0`
526
+
527
+ If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds.
528
+
529
+ #### maxBuffer
530
+
531
+ Type: `number`\
532
+ Default: `100_000_000` (100 MB)
533
+
534
+ Largest amount of data in bytes allowed on `stdout` or `stderr`.
535
+
536
+ #### killSignal
537
+
538
+ Type: `string | number`\
539
+ Default: `SIGTERM`
540
+
541
+ Signal value to be used when the spawned process will be killed.
542
+
543
+ #### windowsVerbatimArguments
544
+
545
+ Type: `boolean`\
546
+ Default: `false`
547
+
548
+ If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.
549
+
550
+ #### windowsHide
551
+
552
+ Type: `boolean`\
553
+ Default: `true`
554
+
555
+ On Windows, do not create a new console window. Please note this also prevents `CTRL-C` [from working](https://github.com/nodejs/node/issues/29837) on Windows.
556
+
557
+ #### nodePath *(For `.node()` only)*
558
+
559
+ Type: `string`\
560
+ Default: [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath)
561
+
562
+ Node.js executable used to create the child process.
563
+
564
+ #### nodeOptions *(For `.node()` only)*
565
+
566
+ Type: `string[]`\
567
+ Default: [`process.execArgv`](https://nodejs.org/api/process.html#process_process_execargv)
568
+
569
+ List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.
570
+
571
+ ## Tips
572
+
573
+ ### Retry on error
574
+
575
+ Gracefully handle failures by using automatic retries and exponential backoff with the [`p-retry`](https://github.com/sindresorhus/p-retry) package:
576
+
577
+ ```js
578
+ const pRetry = require('p-retry');
579
+
580
+ const run = async () => {
581
+ const results = await execa('curl', ['-sSL', 'https://sindresorhus.com/unicorn']);
582
+ return results;
583
+ };
584
+
585
+ (async () => {
586
+ console.log(await pRetry(run, {retries: 5}));
587
+ })();
588
+ ```
589
+
590
+ ### Save and pipe output from a child process
591
+
592
+ Let's say you want to show the output of a child process in real-time while also saving it to a variable.
593
+
594
+ ```js
595
+ const execa = require('execa');
596
+
597
+ const subprocess = execa('echo', ['foo']);
598
+ subprocess.stdout.pipe(process.stdout);
599
+
600
+ (async () => {
601
+ const {stdout} = await subprocess;
602
+ console.log('child output:', stdout);
603
+ })();
604
+ ```
605
+
606
+ ### Redirect output to a file
607
+
608
+ ```js
609
+ const execa = require('execa');
610
+
611
+ const subprocess = execa('echo', ['foo'])
612
+ subprocess.stdout.pipe(fs.createWriteStream('stdout.txt'))
613
+ ```
614
+
615
+ ### Redirect input from a file
616
+
617
+ ```js
618
+ const execa = require('execa');
619
+
620
+ const subprocess = execa('cat')
621
+ fs.createReadStream('stdin.txt').pipe(subprocess.stdin)
622
+ ```
623
+
624
+ ### Execute the current package's binary
625
+
626
+ ```js
627
+ const {getBinPathSync} = require('get-bin-path');
628
+
629
+ const binPath = getBinPathSync();
630
+ const subprocess = execa(binPath);
631
+ ```
632
+
633
+ `execa` can be combined with [`get-bin-path`](https://github.com/ehmicky/get-bin-path) to test the current package's binary. As opposed to hard-coding the path to the binary, this validates that the `package.json` `bin` field is correctly set up.
634
+
635
+ ## Related
636
+
637
+ - [gulp-execa](https://github.com/ehmicky/gulp-execa) - Gulp plugin for `execa`
638
+ - [nvexeca](https://github.com/ehmicky/nvexeca) - Run `execa` using any Node.js version
639
+ - [sudo-prompt](https://github.com/jorangreef/sudo-prompt) - Run commands with elevated privileges.
640
+
641
+ ## Maintainers
642
+
643
+ - [Sindre Sorhus](https://github.com/sindresorhus)
644
+ - [@ehmicky](https://github.com/ehmicky)
645
+
646
+ ---
647
+
648
+ <div align="center">
649
+ <b>
650
+ <a href="https://tidelift.com/subscription/pkg/npm-execa?utm_source=npm-execa&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
651
+ </b>
652
+ <br>
653
+ <sub>
654
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
655
+ </sub>
656
+ </div>
@@ -0,0 +1,64 @@
1
+ # executable [![Build Status](https://travis-ci.org/kevva/executable.svg?branch=master)](https://travis-ci.org/kevva/executable)
2
+
3
+ > Check if a file is executable
4
+
5
+
6
+ ## Install
7
+
8
+ ```
9
+ $ npm install --save executable
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ const executable = require('executable');
17
+
18
+ executable('bash').then(exec => {
19
+ console.log(exec);
20
+ //=> true
21
+ });
22
+ ```
23
+
24
+
25
+ ## API
26
+
27
+ ### executable(file)
28
+
29
+ Returns a Promise for a boolean.
30
+
31
+ ### executable.sync(file)
32
+
33
+ Returns a boolean of whether the file is executable.
34
+
35
+ #### file
36
+
37
+ Type: `string`
38
+
39
+ Path of the file.
40
+
41
+ ### executable.checkMode(mode, [gid], [uid])
42
+
43
+ Returns a boolean of whether the mode passed as first argument means that the file is executable.
44
+
45
+ #### mode
46
+
47
+ Type: `number`
48
+
49
+ Property `mode` of `fs.Stats` instance returned by `fs.stat()` (or `fs.statSync()`) function.
50
+
51
+ #### gid, uid
52
+
53
+ Type: `number`
54
+
55
+ Respectively the group identity and user identity of the file. If not set, permissions will be evaluated without considering owner or group of the file.
56
+
57
+ ## Related
58
+
59
+ * [executable-cli](https://github.com/kevva/executable-cli) - CLI for this module
60
+
61
+
62
+ ## License
63
+
64
+ MIT © [Kevin Mårtensson](https://github.com/kevva)