spawn-rx 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.prettierrc +4 -0
- package/eslint.config.mjs +88 -0
- package/lib/src/index.d.ts +1 -1
- package/lib/src/index.js +82 -52
- package/lib/src/index.js.map +1 -1
- package/package.json +26 -20
- package/src/ambient.d.ts +1 -1
- package/src/index.ts +200 -129
- package/test/asserttest.ts +5 -4
- package/test/spawn.ts +86 -49
- package/test/support.ts +4 -3
- package/tsconfig.json +2 -6
- package/.travis.yml +0 -24
- package/appveyor.yml +0 -21
- package/tslint.json +0 -40
package/.prettierrc
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
2
|
+
import prettier from "eslint-plugin-prettier";
|
3
|
+
import tsParser from "@typescript-eslint/parser";
|
4
|
+
import path from "node:path";
|
5
|
+
import { fileURLToPath } from "node:url";
|
6
|
+
import js from "@eslint/js";
|
7
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
8
|
+
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
10
|
+
const __dirname = path.dirname(__filename);
|
11
|
+
const compat = new FlatCompat({
|
12
|
+
baseDirectory: __dirname,
|
13
|
+
recommendedConfig: js.configs.recommended,
|
14
|
+
allConfig: js.configs.all,
|
15
|
+
});
|
16
|
+
|
17
|
+
export default [
|
18
|
+
...compat.extends(
|
19
|
+
"eslint:recommended",
|
20
|
+
"prettier",
|
21
|
+
"plugin:@typescript-eslint/eslint-recommended",
|
22
|
+
"plugin:@typescript-eslint/recommended",
|
23
|
+
),
|
24
|
+
{
|
25
|
+
files: ["./src/*.{ts,tsx}", "./test/*.{ts,tsx}"],
|
26
|
+
plugins: {
|
27
|
+
"@typescript-eslint": typescriptEslint,
|
28
|
+
prettier,
|
29
|
+
},
|
30
|
+
|
31
|
+
languageOptions: {
|
32
|
+
globals: {},
|
33
|
+
parser: tsParser,
|
34
|
+
ecmaVersion: 5,
|
35
|
+
sourceType: "script",
|
36
|
+
|
37
|
+
parserOptions: {
|
38
|
+
project: "./tsconfig.json",
|
39
|
+
},
|
40
|
+
},
|
41
|
+
|
42
|
+
rules: {
|
43
|
+
"prettier/prettier": "warn",
|
44
|
+
|
45
|
+
"spaced-comment": [
|
46
|
+
"error",
|
47
|
+
"always",
|
48
|
+
{
|
49
|
+
markers: ["/"],
|
50
|
+
},
|
51
|
+
],
|
52
|
+
|
53
|
+
"no-fallthrough": "error",
|
54
|
+
"@typescript-eslint/ban-ts-comment": "warn",
|
55
|
+
|
56
|
+
"@typescript-eslint/consistent-type-imports": [
|
57
|
+
"error",
|
58
|
+
{
|
59
|
+
prefer: "type-imports",
|
60
|
+
},
|
61
|
+
],
|
62
|
+
|
63
|
+
"@typescript-eslint/no-inferrable-types": [
|
64
|
+
"error",
|
65
|
+
{
|
66
|
+
ignoreParameters: false,
|
67
|
+
ignoreProperties: false,
|
68
|
+
},
|
69
|
+
],
|
70
|
+
|
71
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
72
|
+
"@typescript-eslint/no-floating-promises": "error",
|
73
|
+
|
74
|
+
"@typescript-eslint/no-unused-vars": [
|
75
|
+
"warn",
|
76
|
+
{
|
77
|
+
args: "after-used",
|
78
|
+
argsIgnorePattern: "^_",
|
79
|
+
varsIgnorePattern: "^_",
|
80
|
+
ignoreRestSiblings: true,
|
81
|
+
},
|
82
|
+
],
|
83
|
+
|
84
|
+
"@typescript-eslint/no-empty-function": ["error"],
|
85
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
86
|
+
},
|
87
|
+
},
|
88
|
+
];
|
package/lib/src/index.d.ts
CHANGED
package/lib/src/index.js
CHANGED
@@ -4,20 +4,38 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
4
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
5
5
|
t[p] = s[p];
|
6
6
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
8
|
-
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
9
|
+
t[p[i]] = s[p[i]];
|
10
|
+
}
|
9
11
|
return t;
|
10
12
|
};
|
13
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
14
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
15
|
+
if (ar || !(i in from)) {
|
16
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
17
|
+
ar[i] = from[i];
|
18
|
+
}
|
19
|
+
}
|
20
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
21
|
+
};
|
11
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
23
|
+
exports.findActualExecutable = findActualExecutable;
|
24
|
+
exports.spawnDetached = spawnDetached;
|
25
|
+
exports.spawn = spawn;
|
26
|
+
exports.spawnDetachedPromise = spawnDetachedPromise;
|
27
|
+
exports.spawnPromise = spawnPromise;
|
28
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
12
29
|
var path = require("path");
|
13
30
|
var net = require("net");
|
14
31
|
var sfs = require("fs");
|
15
32
|
var assign = require("lodash.assign");
|
16
33
|
var rxjs_1 = require("rxjs");
|
17
34
|
var operators_1 = require("rxjs/operators");
|
18
|
-
var
|
19
|
-
var
|
20
|
-
var
|
35
|
+
var child_process_1 = require("child_process");
|
36
|
+
var debug_1 = require("debug");
|
37
|
+
var isWindows = process.platform === "win32";
|
38
|
+
var d = (0, debug_1.default)("spawn-rx"); // tslint:disable-line:no-var-requires
|
21
39
|
/**
|
22
40
|
* stat a file but don't throw if it doesn't exist
|
23
41
|
*
|
@@ -30,7 +48,7 @@ function statSyncNoException(file) {
|
|
30
48
|
try {
|
31
49
|
return sfs.statSync(file);
|
32
50
|
}
|
33
|
-
catch (
|
51
|
+
catch (_a) {
|
34
52
|
return null;
|
35
53
|
}
|
36
54
|
}
|
@@ -47,16 +65,16 @@ function runDownPath(exe) {
|
|
47
65
|
// NB: Windows won't search PATH looking for executables in spawn like
|
48
66
|
// Posix does
|
49
67
|
// Files with any directory path don't get this applied
|
50
|
-
if (exe.match(/[
|
51
|
-
d(
|
68
|
+
if (exe.match(/[\\/]/)) {
|
69
|
+
d("Path has slash in directory, bailing");
|
52
70
|
return exe;
|
53
71
|
}
|
54
|
-
var target = path.join(
|
72
|
+
var target = path.join(".", exe);
|
55
73
|
if (statSyncNoException(target)) {
|
56
|
-
d("Found executable in currect directory: "
|
74
|
+
d("Found executable in currect directory: ".concat(target));
|
57
75
|
return target;
|
58
76
|
}
|
59
|
-
var haystack = process.env.PATH.split(isWindows ?
|
77
|
+
var haystack = process.env.PATH.split(isWindows ? ";" : ":");
|
60
78
|
for (var _i = 0, haystack_1 = haystack; _i < haystack_1.length; _i++) {
|
61
79
|
var p = haystack_1[_i];
|
62
80
|
var needle = path.join(p, exe);
|
@@ -64,7 +82,7 @@ function runDownPath(exe) {
|
|
64
82
|
return needle;
|
65
83
|
}
|
66
84
|
}
|
67
|
-
d(
|
85
|
+
d("Failed to find executable anywhere in path");
|
68
86
|
return exe;
|
69
87
|
}
|
70
88
|
/**
|
@@ -85,30 +103,37 @@ function runDownPath(exe) {
|
|
85
103
|
*/
|
86
104
|
function findActualExecutable(exe, args) {
|
87
105
|
// POSIX can just execute scripts directly, no need for silly goosery
|
88
|
-
if (process.platform !==
|
106
|
+
if (process.platform !== "win32") {
|
89
107
|
return { cmd: runDownPath(exe), args: args };
|
90
108
|
}
|
91
109
|
if (!sfs.existsSync(exe)) {
|
92
110
|
// NB: When you write something like `surf-client ... -- surf-build` on Windows,
|
93
111
|
// a shell would normally convert that to surf-build.cmd, but since it's passed
|
94
112
|
// in as an argument, it doesn't happen
|
95
|
-
var possibleExts = [
|
113
|
+
var possibleExts = [".exe", ".bat", ".cmd", ".ps1"];
|
96
114
|
for (var _i = 0, possibleExts_1 = possibleExts; _i < possibleExts_1.length; _i++) {
|
97
115
|
var ext = possibleExts_1[_i];
|
98
|
-
var possibleFullPath = runDownPath(""
|
116
|
+
var possibleFullPath = runDownPath("".concat(exe).concat(ext));
|
99
117
|
if (sfs.existsSync(possibleFullPath)) {
|
100
118
|
return findActualExecutable(possibleFullPath, args);
|
101
119
|
}
|
102
120
|
}
|
103
121
|
}
|
104
122
|
if (exe.match(/\.ps1$/i)) {
|
105
|
-
var cmd = path.join(process.env.SYSTEMROOT,
|
106
|
-
var psargs = [
|
123
|
+
var cmd = path.join(process.env.SYSTEMROOT, "System32", "WindowsPowerShell", "v1.0", "PowerShell.exe");
|
124
|
+
var psargs = [
|
125
|
+
"-ExecutionPolicy",
|
126
|
+
"Unrestricted",
|
127
|
+
"-NoLogo",
|
128
|
+
"-NonInteractive",
|
129
|
+
"-File",
|
130
|
+
exe,
|
131
|
+
];
|
107
132
|
return { cmd: cmd, args: psargs.concat(args) };
|
108
133
|
}
|
109
134
|
if (exe.match(/\.(bat|cmd)$/i)) {
|
110
|
-
var cmd = path.join(process.env.SYSTEMROOT,
|
111
|
-
var cmdArgs = [
|
135
|
+
var cmd = path.join(process.env.SYSTEMROOT, "System32", "cmd.exe");
|
136
|
+
var cmdArgs = __spreadArray(["/C", exe], args, true);
|
112
137
|
return { cmd: cmd, args: cmdArgs };
|
113
138
|
}
|
114
139
|
if (exe.match(/\.(js)$/i)) {
|
@@ -119,7 +144,6 @@ function findActualExecutable(exe, args) {
|
|
119
144
|
// Dunno lol
|
120
145
|
return { cmd: exe, args: args };
|
121
146
|
}
|
122
|
-
exports.findActualExecutable = findActualExecutable;
|
123
147
|
/**
|
124
148
|
* Spawns a process but detached from the current process. The process is put
|
125
149
|
* into its own Process Group that can be killed by unsubscribing from the
|
@@ -144,12 +168,11 @@ function spawnDetached(exe, params, opts) {
|
|
144
168
|
return spawn(cmd, args, assign({}, opts || {}, { detached: true }));
|
145
169
|
}
|
146
170
|
var newParams = [cmd].concat(args);
|
147
|
-
var target = path.join(__dirname,
|
171
|
+
var target = path.join(__dirname, "..", "..", "vendor", "jobber", "Jobber.exe");
|
148
172
|
var options = assign({}, opts || {}, { detached: true, jobber: true });
|
149
|
-
d("spawnDetached: "
|
173
|
+
d("spawnDetached: ".concat(target, ", ").concat(newParams));
|
150
174
|
return spawn(target, newParams, options);
|
151
175
|
}
|
152
|
-
exports.spawnDetached = spawnDetached;
|
153
176
|
/**
|
154
177
|
* Spawns a process attached as a child of the current process.
|
155
178
|
*
|
@@ -170,32 +193,33 @@ function spawn(exe, params, opts) {
|
|
170
193
|
if (opts === void 0) { opts = null; }
|
171
194
|
opts = opts || {};
|
172
195
|
var spawnObs = rxjs_1.Observable.create(function (subj) {
|
173
|
-
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
197
|
+
var _ = opts._, optsWithoutStdIn = __rest(opts, ["_"]);
|
174
198
|
var _a = findActualExecutable(exe, params), cmd = _a.cmd, args = _a.args;
|
175
|
-
d("spawning process: "
|
199
|
+
d("spawning process: ".concat(cmd, " ").concat(args.join(), ", ").concat(JSON.stringify(optsWithoutStdIn)));
|
176
200
|
var origOpts = assign({}, optsWithoutStdIn);
|
177
|
-
if (
|
201
|
+
if ("jobber" in origOpts) {
|
178
202
|
delete origOpts.jobber;
|
179
203
|
}
|
180
|
-
if (
|
204
|
+
if ("split" in origOpts) {
|
181
205
|
delete origOpts.split;
|
182
206
|
}
|
183
|
-
var proc =
|
207
|
+
var proc = (0, child_process_1.spawn)(cmd, args, origOpts);
|
184
208
|
var bufHandler = function (source) { return function (b) {
|
185
209
|
if (b.length < 1) {
|
186
210
|
return;
|
187
211
|
}
|
188
|
-
var chunk =
|
212
|
+
var chunk = "<< String sent back was too long >>";
|
189
213
|
try {
|
190
|
-
if (typeof b ===
|
214
|
+
if (typeof b === "string") {
|
191
215
|
chunk = b.toString();
|
192
216
|
}
|
193
217
|
else {
|
194
|
-
chunk = b.toString(origOpts.encoding ||
|
218
|
+
chunk = b.toString(origOpts.encoding || "utf8");
|
195
219
|
}
|
196
220
|
}
|
197
|
-
catch (
|
198
|
-
chunk = "<< Lost chunk of process output for "
|
221
|
+
catch (_a) {
|
222
|
+
chunk = "<< Lost chunk of process output for ".concat(exe, " - length was ").concat(b.length, ">>");
|
199
223
|
}
|
200
224
|
subj.next({ source: source, text: chunk });
|
201
225
|
}; };
|
@@ -213,43 +237,52 @@ function spawn(exe, params, opts) {
|
|
213
237
|
var noClose = false;
|
214
238
|
if (proc.stdout) {
|
215
239
|
stdoutCompleted = new rxjs_1.AsyncSubject();
|
216
|
-
proc.stdout.on(
|
217
|
-
proc.stdout.on(
|
240
|
+
proc.stdout.on("data", bufHandler("stdout"));
|
241
|
+
proc.stdout.on("close", function () {
|
242
|
+
stdoutCompleted.next(true);
|
243
|
+
stdoutCompleted.complete();
|
244
|
+
});
|
218
245
|
}
|
219
246
|
else {
|
220
|
-
stdoutCompleted = rxjs_1.of(true);
|
247
|
+
stdoutCompleted = (0, rxjs_1.of)(true);
|
221
248
|
}
|
222
249
|
if (proc.stderr) {
|
223
250
|
stderrCompleted = new rxjs_1.AsyncSubject();
|
224
|
-
proc.stderr.on(
|
225
|
-
proc.stderr.on(
|
251
|
+
proc.stderr.on("data", bufHandler("stderr"));
|
252
|
+
proc.stderr.on("close", function () {
|
253
|
+
stderrCompleted.next(true);
|
254
|
+
stderrCompleted.complete();
|
255
|
+
});
|
226
256
|
}
|
227
257
|
else {
|
228
|
-
stderrCompleted = rxjs_1.of(true);
|
258
|
+
stderrCompleted = (0, rxjs_1.of)(true);
|
229
259
|
}
|
230
|
-
proc.on(
|
260
|
+
proc.on("error", function (e) {
|
231
261
|
noClose = true;
|
232
262
|
subj.error(e);
|
233
263
|
});
|
234
|
-
proc.on(
|
264
|
+
proc.on("close", function (code) {
|
235
265
|
noClose = true;
|
236
|
-
var pipesClosed = rxjs_1.merge(stdoutCompleted, stderrCompleted)
|
237
|
-
.pipe(operators_1.reduce(function (acc) { return acc; }, true));
|
266
|
+
var pipesClosed = (0, rxjs_1.merge)(stdoutCompleted, stderrCompleted).pipe((0, operators_1.reduce)(function (acc) { return acc; }, true));
|
238
267
|
if (code === 0) {
|
239
268
|
pipesClosed.subscribe(function () { return subj.complete(); });
|
240
269
|
}
|
241
270
|
else {
|
242
|
-
pipesClosed.subscribe(function () {
|
271
|
+
pipesClosed.subscribe(function () {
|
272
|
+
var e = new Error("Failed with exit code: ".concat(code));
|
273
|
+
e.exitCode = code;
|
274
|
+
subj.error(e);
|
275
|
+
});
|
243
276
|
}
|
244
277
|
});
|
245
278
|
ret.add(new rxjs_1.Subscription(function () {
|
246
279
|
if (noClose) {
|
247
280
|
return;
|
248
281
|
}
|
249
|
-
d("Killing process: "
|
282
|
+
d("Killing process: ".concat(cmd, " ").concat(args.join()));
|
250
283
|
if (opts.jobber) {
|
251
284
|
// NB: Connecting to Jobber's named pipe will kill it
|
252
|
-
net.connect("\\\\.\\pipe\\jobber-"
|
285
|
+
net.connect("\\\\.\\pipe\\jobber-".concat(proc.pid));
|
253
286
|
setTimeout(function () { return proc.kill(); }, 5 * 1000);
|
254
287
|
}
|
255
288
|
else {
|
@@ -258,13 +291,12 @@ function spawn(exe, params, opts) {
|
|
258
291
|
}));
|
259
292
|
return ret;
|
260
293
|
});
|
261
|
-
return opts.split ? spawnObs : spawnObs.pipe(operators_1.
|
294
|
+
return opts.split ? spawnObs : spawnObs.pipe((0, operators_1.map)(function (x) { return x === null || x === void 0 ? void 0 : x.text; }));
|
262
295
|
}
|
263
|
-
exports.spawn = spawn;
|
264
296
|
function wrapObservableInPromise(obs) {
|
265
297
|
return new Promise(function (res, rej) {
|
266
|
-
var out =
|
267
|
-
obs.subscribe(function (x) { return out += x; }, function (e) { return rej(new Error(out
|
298
|
+
var out = "";
|
299
|
+
obs.subscribe(function (x) { return (out += x); }, function (e) { return rej(new Error("".concat(out, "\n").concat(e.message))); }, function () { return res(out); });
|
268
300
|
});
|
269
301
|
}
|
270
302
|
/**
|
@@ -285,7 +317,6 @@ function spawnDetachedPromise(exe, params, opts) {
|
|
285
317
|
if (opts === void 0) { opts = null; }
|
286
318
|
return wrapObservableInPromise(spawnDetached(exe, params, opts));
|
287
319
|
}
|
288
|
-
exports.spawnDetachedPromise = spawnDetachedPromise;
|
289
320
|
/**
|
290
321
|
* Spawns a process as a child process.
|
291
322
|
*
|
@@ -303,5 +334,4 @@ function spawnPromise(exe, params, opts) {
|
|
303
334
|
if (opts === void 0) { opts = null; }
|
304
335
|
return wrapObservableInPromise(spawn(exe, params, opts));
|
305
336
|
}
|
306
|
-
exports.spawnPromise = spawnPromise;
|
307
337
|
//# sourceMappingURL=index.js.map
|
package/lib/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqFA,oDA8DC;AAmBD,sCAyBC;AAkBD,sBA4IC;AA4BD,oDAMC;AAeD,oCAMC;AApZD,uDAAuD;AACvD,2BAA6B;AAC7B,yBAA2B;AAC3B,wBAA0B;AAC1B,sCAAwC;AAGxC,6BAAyE;AACzE,4CAA6C;AAC7C,+CAAiD;AACjD,+BAA0B;AAE1B,IAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE/C,IAAM,CAAC,GAAG,IAAA,eAAK,EAAC,UAAU,CAAC,CAAC,CAAC,sCAAsC;AAEnE;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,IAAY;IACvC,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,GAAW;IAC9B,sEAAs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AAC,CAAC,IAAK,OAAA,GAAG,CAAC,IAAI,KAAK,CAAC,UAAG,GAAG,eAAK,CAAC,CAAC,OAAO,CAAE,CAAC,CAAC,EAAtC,CAAsC,EAC7C,cAAM,OAAA,GAAG,CAAC,GAAG,CAAC,EAAR,CAAQ,CACf,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAgB,oBAAoB,CAClC,GAAW,EACX,MAAqB,EACrB,IAAgB;IAAhB,qBAAA,EAAA,WAAgB;IAEhB,OAAO,uBAAuB,CAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,YAAY,CAC1B,GAAW,EACX,MAAqB,EACrB,IAAgB;IAAhB,qBAAA,EAAA,WAAgB;IAEhB,OAAO,uBAAuB,CAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACnE,CAAC"}
|
package/package.json
CHANGED
@@ -1,54 +1,60 @@
|
|
1
1
|
{
|
2
2
|
"name": "spawn-rx",
|
3
|
-
"version": "
|
3
|
+
"version": "4.0.0",
|
4
4
|
"description": "An Rx-version of child_process.spawn",
|
5
5
|
"scripts": {
|
6
6
|
"doc": "echo \"esdoc may not work correctly\" && esdoc -c ./esdoc.json",
|
7
|
-
"compile": "tsc",
|
8
|
-
"
|
9
|
-
"lint": "
|
7
|
+
"compile": "tsc -p ./tsconfig.json",
|
8
|
+
"prepublishOnly": "npm run build",
|
9
|
+
"lint": "npx eslint .",
|
10
10
|
"test": "mocha --compilers ts:ts-node/register ./test/*",
|
11
|
-
"build": "npm-run-all compile
|
11
|
+
"build": "npm-run-all compile test"
|
12
12
|
},
|
13
13
|
"repository": {
|
14
14
|
"type": "git",
|
15
|
-
"url": "https://github.com/
|
15
|
+
"url": "https://github.com/anaisbetts/spawn-rx"
|
16
16
|
},
|
17
17
|
"keywords": [
|
18
18
|
"spawn",
|
19
19
|
"rx"
|
20
20
|
],
|
21
|
-
"author": "
|
21
|
+
"author": "Anaïs Betts <anais@anaisbetts.org>",
|
22
22
|
"license": "MIT",
|
23
23
|
"bugs": {
|
24
|
-
"url": "https://github.com/
|
24
|
+
"url": "https://github.com/anaisbetts/spawn-rx/issues"
|
25
25
|
},
|
26
26
|
"main": "lib/src/index.js",
|
27
27
|
"typings": "lib/src/index.d.ts",
|
28
|
-
"homepage": "https://github.com/
|
28
|
+
"homepage": "https://github.com/anaisbetts/spawn-rx",
|
29
29
|
"dependencies": {
|
30
|
-
"debug": "^
|
30
|
+
"debug": "^4.3.7",
|
31
31
|
"lodash.assign": "^4.2.0",
|
32
|
-
"rxjs": "^
|
32
|
+
"rxjs": "^7.8.1"
|
33
33
|
},
|
34
34
|
"devDependencies": {
|
35
|
-
"@
|
36
|
-
"@
|
37
|
-
"@types/
|
38
|
-
"@types/
|
35
|
+
"@eslint/eslintrc": "^3.1.0",
|
36
|
+
"@eslint/js": "^9.14.0",
|
37
|
+
"@types/chai": "^4.3.20",
|
38
|
+
"@types/chai-as-promised": "^7.1.8",
|
39
|
+
"@types/debug": "^4.1.12",
|
40
|
+
"@types/mocha": "^2.2.48",
|
41
|
+
"@types/node": "^8.10.66",
|
39
42
|
"babel-register": "^6.23.0",
|
40
|
-
"chai": "^4.
|
41
|
-
"chai-as-promised": "^7.1.
|
43
|
+
"chai": "^4.5.0",
|
44
|
+
"chai-as-promised": "^7.1.2",
|
42
45
|
"esdoc": "^1.1.0",
|
43
46
|
"esdoc-es7-plugin": "0.0.3",
|
44
47
|
"esdoc-plugin-async-to-sync": "^0.5.0",
|
48
|
+
"eslint": "^9.14.0",
|
49
|
+
"eslint-config-prettier": "^9.1.0",
|
50
|
+
"eslint-plugin-prettier": "^5.2.1",
|
45
51
|
"marked": "^0.5.0",
|
46
52
|
"mocha": "^4.0.0",
|
47
53
|
"npm-run-all": "^4.0.2",
|
54
|
+
"prettier": "^3.3.3",
|
48
55
|
"ts-node": "^3.3.0",
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"typescript": "^2.5.3",
|
56
|
+
"typescript": "^5.6.3",
|
57
|
+
"typescript-eslint": "^8.14.0",
|
52
58
|
"uuid": "3.0.1"
|
53
59
|
}
|
54
60
|
}
|
package/src/ambient.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
declare module
|
1
|
+
declare module "lodash.assign";
|