From 968c651d2dcf92be7969927da07fbfc4794155aa Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 13 Oct 2019 16:21:09 -0700 Subject: [PATCH 001/111] add AtlantOS Ocean Data QC to used by --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8b5572..e6089df 100644 --- a/README.md +++ b/README.md @@ -330,7 +330,7 @@ Fires when the process terminates with a non-zero exit code. ## Used By: -Python-Shell is used by [arepl-vscode](https://github.com/almenon/arepl-vscode), [gitinspector](https://github.com/ejwa/gitinspector), [pyspreadsheet](https://github.com/extrabacon/pyspreadsheet), and more! +Python-Shell is used by [arepl-vscode](https://github.com/almenon/arepl-vscode), [gitinspector](https://github.com/ejwa/gitinspector), [pyspreadsheet](https://github.com/extrabacon/pyspreadsheet), [AtlantOS Ocean Data QC](https://github.com/ocean-data-qc/ocean-data-qc) and more! ## License From b8eba8a368803eaafc2dc3586fac0fcc97dfcf85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2019 13:39:15 +0000 Subject: [PATCH 002/111] Bump diff from 3.3.1 to 3.5.0 Bumps [diff](https://github.com/kpdecker/jsdiff) from 3.3.1 to 3.5.0. - [Release notes](https://github.com/kpdecker/jsdiff/releases) - [Changelog](https://github.com/kpdecker/jsdiff/blob/master/release-notes.md) - [Commits](https://github.com/kpdecker/jsdiff/compare/v3.3.1...v3.5.0) Signed-off-by: dependabot[bot] --- package-lock.json | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 603998b..08ca7a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -204,9 +204,9 @@ "dev": true }, "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, "ecc-jsbn": { @@ -482,12 +482,6 @@ "supports-color": "5.4.0" }, "dependencies": { - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -740,7 +734,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } From 1bc61e0476690b0767306f0d815d5bb54e0a875b Mon Sep 17 00:00:00 2001 From: "dps.lwk" Date: Tue, 7 Jan 2020 01:35:17 +0000 Subject: [PATCH 003/111] Fix README.md examples with mode --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e6089df..e55da8c 100644 --- a/README.md +++ b/README.md @@ -262,11 +262,11 @@ Example: ```typescript // send a message in text mode -let shell = new PythonShell('script.py', { mode: 'text '}); +let shell = new PythonShell('script.py', { mode: 'text'}); shell.send('hello world!'); // send a message in JSON mode -let shell = new PythonShell('script.py', { mode: 'json '}); +let shell = new PythonShell('script.py', { mode: 'json'}); shell.send({ command: "do_stuff", args: [1, 2, 3] }); ``` @@ -294,13 +294,13 @@ Example: ```typescript // receive a message in text mode -let shell = new PythonShell('script.py', { mode: 'text '}); +let shell = new PythonShell('script.py', { mode: 'text'}); shell.on('message', function (message) { // handle message (a line of text from stdout) }); // receive a message in JSON mode -let shell = new PythonShell('script.py', { mode: 'json '}); +let shell = new PythonShell('script.py', { mode: 'json'}); shell.on('message', function (message) { // handle message (a line of text from stdout, parsed as JSON) }); @@ -314,7 +314,7 @@ Example: ```typescript // receive a message in text mode -let shell = new PythonShell('script.py', { mode: 'text '}); +let shell = new PythonShell('script.py', { mode: 'text'}); shell.on('stderr', function (stderr) { // handle stderr (a line of text from stderr) }); From a587fbc911d110daef575bee0a7220ad5701d244 Mon Sep 17 00:00:00 2001 From: gazdagergo Date: Sun, 9 Feb 2020 04:48:38 +0100 Subject: [PATCH 004/111] Readme: remove duplicated row --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e55da8c..e75618d 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,6 @@ pyshell.end(function (err,code,signal) { console.log('The exit code was: ' + code); console.log('The exit signal was: ' + signal); console.log('finished'); - console.log('finished'); }); ``` From 7593c25155ed68e70b0ec170c4d45fcd63ee91c8 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:22:58 -0700 Subject: [PATCH 005/111] make sure casing is consistent for linux OS --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 325a047..7eb40ca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,8 @@ ], "sourceMap": true, "rootDir": ".", - "declaration": true + "declaration": true, + "forceConsistentCasingInFileNames": true }, "exclude": [ "node_modules", From 376ef58777b376ecfa7399ed680a49720e5db0d6 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:23:39 -0700 Subject: [PATCH 006/111] use ts-node to get correct line numbers --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a468a2c..d03990c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "python" ], "scripts": { - "test": "tsc -p ./ && mocha", + "test": "tsc -p ./ && mocha -r ts-node/register", "appveyorTest": "tsc -p ./ && nyc mocha --reporter mocha-appveyor-reporter test/*.js", "compile": "tsc -watch -p ./" }, From febb7eb38e030dd89aefc67691bd0d0378334e7e Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:28:54 -0700 Subject: [PATCH 007/111] update testing versions node8 and python 2 is no longer supported as of 2020 --- appveyor.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f1d99c1..5ea5534 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,17 +10,11 @@ image: environment: matrix: - - nodejs_version: "8" - PYTHON: "C:\\Python27" - - - nodejs_version: "8" - PYTHON: "C:\\Python36-x64" - - - nodejs_version: "10" - PYTHON: "C:\\Python27" - - nodejs_version: "10" PYTHON: "C:\\Python36-x64" + + - nodejs_version: "12" + PYTHON: "C:\\Python36-x64" install: - cmd: powershell Install-Product node $env:nodejs_version From 5dd240c9baa6b8ec6153fecc1455347ff16d23fb Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:33:36 -0700 Subject: [PATCH 008/111] simplify string splitting The simpler version does exact same thing --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 79d2cb3..bcfd66e 100644 --- a/index.ts +++ b/index.ts @@ -325,7 +325,7 @@ export class PythonShell extends EventEmitter{ if (/^Traceback/.test(text)) { // traceback data is available - let lines = (''+data).trim().split(new RegExp(newline, 'g')); + let lines = (''+data).trim().split(newline); let exception = lines.pop(); error = new PythonShellError(exception); error.traceback = data; @@ -376,7 +376,7 @@ export class PythonShell extends EventEmitter{ private receiveInternal(data:string|Buffer, emitType:'message'|'stderr'){ let self = this; - let parts = (''+data).split(new RegExp(newline,'g')); + let parts = (''+data).split(newline); if (parts.length === 1) { // an incomplete record, keep buffering From 517c768c9d9f3e609dbfd64c0a757cb2f7048481 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:37:09 -0700 Subject: [PATCH 009/111] fix spelling error --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index bcfd66e..7f73cb0 100644 --- a/index.ts +++ b/index.ts @@ -347,7 +347,7 @@ export class PythonShell extends EventEmitter{ * @returns {PythonShell} The same instance for chaining calls */ send(message:string|Object) { - if (!this.stdin) throw new Error("stdin not open for writting"); + if (!this.stdin) throw new Error("stdin not open for writing"); let data = this.formatter ? this.formatter(message) : message; if (this.mode !== 'binary') data += newline; this.stdin.write(data); From b44dd770df2f4f86d8cdbba52ce15d11e616d3d1 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:37:58 -0700 Subject: [PATCH 010/111] standardize spacing --- index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index 7f73cb0..089e141 100644 --- a/index.ts +++ b/index.ts @@ -1,8 +1,8 @@ -import {EventEmitter} from 'events'; -import { ChildProcess,spawn, SpawnOptions, exec, execSync } from 'child_process'; -import {EOL as newline, tmpdir} from 'os'; -import {join, sep} from 'path' -import {Readable,Writable} from 'stream' +import { EventEmitter } from 'events'; +import { ChildProcess, spawn, SpawnOptions, exec, execSync } from 'child_process'; +import { EOL as newline, tmpdir} from 'os'; +import { join, sep } from 'path' +import { Readable, Writable } from 'stream' import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; From 102552ead1ef93da3b7fd11a0ca9c92d857559eb Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 11:43:40 -0700 Subject: [PATCH 011/111] simplify lines declaration --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 089e141..11b5f40 100644 --- a/index.ts +++ b/index.ts @@ -325,7 +325,7 @@ export class PythonShell extends EventEmitter{ if (/^Traceback/.test(text)) { // traceback data is available - let lines = (''+data).trim().split(newline); + let lines = text.trim().split(newline); let exception = lines.pop(); error = new PythonShellError(exception); error.traceback = data; From b62dd9227d2e3485b7e1f07369eed3c6295509c2 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 19 Apr 2020 17:16:33 -0700 Subject: [PATCH 012/111] create bug issue template --- .github/ISSUE_TEMPLATE/bug_report.md | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..2b105b5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: 'bug' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**Python code** +Relevant Python code to reproduce the problem + +**Javascript code** +Relevant Javascript code to reproduce the problem + +**Expected behavior** +A description of what you expected to happen. + +**Actual behavior** +A description of what actually happened. + +**Other Information (please complete the following information):** + - OS: [e.g. Windows10] + - Python Version [e.g. 3.6] + - Node Version [e.g. 12] + +**Additional context** +Add any other context about the problem here. From 0a5fb67b4e3b1efdde8bfa2b340fc48b338ec411 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 19 Apr 2020 17:17:29 -0700 Subject: [PATCH 013/111] create feature request template --- .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..36014cd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: 'enhancement' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 303ba8941a82ccf41b0c21fc048077520ae13f88 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 19 Apr 2020 17:26:51 -0700 Subject: [PATCH 014/111] create question template --- .github/ISSUE_TEMPLATE/question.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/question.md diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..9d3c43b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,17 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: 'question' +assignees: '' + +--- + + +If you are having a problem inside your python code please do not create a issue here. +Python-shell just runs your python code, it is not responsible for any errors in the code itself. + +**The Question**: + + +**Any relevant python/javascript code:** From 6767559f4477921e1568819677f28b561349f11c Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 19 Apr 2020 17:27:19 -0700 Subject: [PATCH 015/111] Update question.md --- .github/ISSUE_TEMPLATE/question.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 9d3c43b..d9273ee 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,5 +1,5 @@ --- -name: Bug report +name: Question about: Create a report to help us improve title: '' labels: 'question' From 4d3c6e31a3b8a557913bc8355c452044b51287eb Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 19 Apr 2020 17:27:50 -0700 Subject: [PATCH 016/111] Update question.md --- .github/ISSUE_TEMPLATE/question.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index d9273ee..d58d042 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -1,6 +1,6 @@ --- name: Question -about: Create a report to help us improve +about: A question about python-shell title: '' labels: 'question' assignees: '' From f90f5e56004ee346697d1bf6ff1ecc5443ef95a2 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 19 Apr 2020 17:28:39 -0700 Subject: [PATCH 017/111] comment out message --- .github/ISSUE_TEMPLATE/question.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index d58d042..96d933f 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -8,8 +8,8 @@ assignees: '' --- -If you are having a problem inside your python code please do not create a issue here. -Python-shell just runs your python code, it is not responsible for any errors in the code itself. + **The Question**: From 8d3ce417a18141522ab2c6b7b9767639ecebd027 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 17:49:55 -0700 Subject: [PATCH 018/111] fix: stderr being emitted in binary mode --- index.ts | 5 ++++- test/test-python-shell.ts | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index 11b5f40..07a8ca2 100644 --- a/index.ts +++ b/index.ts @@ -37,6 +37,9 @@ function getRandomInt(){ } export interface Options extends SpawnOptions{ + /** + * if binary is enabled message and stderr events will not be emitted + */ mode?: 'text'|'json'|'binary' formatter?: (param:string)=>any parser?: (param:string)=>any @@ -147,7 +150,7 @@ export class PythonShell extends EventEmitter{ } // listen to stderr and emit errors for incoming data - if (this.stderr) { + if (this.stderrParser && this.stderr) { this.stderr.on('data', function (data) { errorData += ''+data; self.receiveStderr(data); diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index cc0e3e9..273f2f9 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -348,7 +348,8 @@ describe('PythonShell', function () { mode: 'binary' }); pyshell.receive = function () { - throw new Error('should not emit messages in binary mode'); + done('should not emit messages in binary mode'); + return undefined }; pyshell.end(done); }); @@ -385,12 +386,12 @@ describe('PythonShell', function () { }).send('hello').send('world').end(done); }); it('should not be invoked when mode is "binary"', function (done) { - let pyshell = new PythonShell('echo_args.py', { - args: ['hello', 'world'], + let pyshell = new PythonShell('stderrLogging.py', { mode: 'binary' }); pyshell.receiveStderr = function () { - throw new Error('should not emit stderr in binary mode'); + done('should not emit stderr in binary mode'); + return undefined }; pyshell.end(done); }); From 2145853503a9f9fedc939e2b7827443db920971d Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 19 Apr 2020 17:50:59 -0700 Subject: [PATCH 019/111] update version for breaking API change --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08ca7a9..ef54f23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "1.0.8", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d03990c..a026cc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "1.0.8", + "version": "2.0.0", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From d0497f837e77a8de97f3a32c79586869b4e25f5e Mon Sep 17 00:00:00 2001 From: Almenon Date: Sat, 25 Apr 2020 20:39:38 -0700 Subject: [PATCH 020/111] Update index.ts --- index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.ts b/index.ts index 07a8ca2..f95208d 100644 --- a/index.ts +++ b/index.ts @@ -155,7 +155,9 @@ export class PythonShell extends EventEmitter{ errorData += ''+data; self.receiveStderr(data); }); + } + if (this.stderr) { this.stderr.on('end', function(){ self.stderrHasEnded = true; terminateIfNeeded(); From 62a1d875826192a982dd4018276a5a000ab3b506 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:07:14 -0700 Subject: [PATCH 021/111] upgrade node types node 9 is no longer supported --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef54f23..f2d30db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,9 @@ "dev": true }, "@types/node": { - "version": "9.4.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.4.5.tgz", - "integrity": "sha512-DvC7bzO5797bkApgukxouHmkOdYN2D0yL5olw0RncDpXUa6n39qTVsUi/5g2QJjPgl8qn4zh+4h0sofNoWGLRg==", + "version": "10.17.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.21.tgz", + "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", "dev": true }, "ajv": { diff --git a/package.json b/package.json index a026cc9..f23130e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "dependencies": {}, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/node": "^9.3.0", + "@types/node": "^10.5.2", "mocha": "^5.2.0", "mocha-appveyor-reporter": "^0.4.0", "should": "^13.2.1", From 20dbdfa4f9e7d1b86c7514147b98f84224986e96 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:13:28 -0700 Subject: [PATCH 022/111] add failing test for stack trace --- test/test-python-shell.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 273f2f9..144cac0 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -150,6 +150,14 @@ describe('PythonShell', function () { done(); }); }); + it('should run the script and fail with an extended stack trace even when mode is binary', function (done) { + PythonShell.run('error.py', {mode: "binary"}, function (err, results) { + err.should.be.an.Error; + err.exitCode.should.be.exactly(1); + err.stack.should.containEql('----- Python Traceback -----'); + done(); + }); + }); it('should run multiple scripts and fail with an extended stack trace for each of them', function (done) { let numberOfTimesToRun = 5; for (let i = 0; i < numberOfTimesToRun; i++) { From 9621d280ac3e50a10220db22de39b63f13a4a483 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:13:41 -0700 Subject: [PATCH 023/111] fix stack trace not appearing in binary mode --- index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index f95208d..37967f6 100644 --- a/index.ts +++ b/index.ts @@ -151,13 +151,13 @@ export class PythonShell extends EventEmitter{ // listen to stderr and emit errors for incoming data if (this.stderrParser && this.stderr) { - this.stderr.on('data', function (data) { - errorData += ''+data; - self.receiveStderr(data); - }); + this.stderr.on('data', this.receiveStderr.bind(this)); } if (this.stderr) { + this.stderr.on('data', function (data) { + errorData += '' + data; + }); this.stderr.on('end', function(){ self.stderrHasEnded = true; terminateIfNeeded(); From 3ccb75201a3ae5013090d513f408499d7bbf9d64 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:14:36 -0700 Subject: [PATCH 024/111] fix documentation for terminate function --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 37967f6..6091683 100644 --- a/index.ts +++ b/index.ts @@ -416,7 +416,7 @@ export class PythonShell extends EventEmitter{ }; /** - * Closes the stdin stream, which should cause the process to finish its work and close + * Sends a kill signal to the process * @returns {PythonShell} The same instance for chaining calls */ terminate(signal?:string) { From 0936099870d3f863bed5012cc12cdf39feec43c3 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:15:39 -0700 Subject: [PATCH 025/111] fix documentation for end --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 6091683..2411f26 100644 --- a/index.ts +++ b/index.ts @@ -404,7 +404,8 @@ export class PythonShell extends EventEmitter{ } /** - * Closes the stdin stream, which should cause the process to finish its work and close + * Closes the stdin stream. Unless python is listening for stdin in a loop + * this should cause the process to finish its work and close. * @returns {PythonShell} The same instance for chaining calls */ end(callback:(err:PythonShellError, exitCode:number,exitSignal:string)=>any) { From 91e668eb3be7171f8110ac910d395f70fb3ece6a Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:19:39 -0700 Subject: [PATCH 026/111] deprecate terminate in favor of kill better to match name of childprocess method for consistency --- index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 2411f26..d737fd5 100644 --- a/index.ts +++ b/index.ts @@ -420,9 +420,17 @@ export class PythonShell extends EventEmitter{ * Sends a kill signal to the process * @returns {PythonShell} The same instance for chaining calls */ - terminate(signal?:string) { + kill(signal?: string) { this.childProcess.kill(signal); this.terminated = true; return this; }; + + /** + * Alias for kill. + * @deprecated + */ + terminate(signal?: string) { + return this.kill(signal) + } }; From db013da9cbf6aa8d79cdb1dcabd21e906809c828 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:20:37 -0700 Subject: [PATCH 027/111] improve typing of kill --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index d737fd5..a42aaca 100644 --- a/index.ts +++ b/index.ts @@ -420,7 +420,7 @@ export class PythonShell extends EventEmitter{ * Sends a kill signal to the process * @returns {PythonShell} The same instance for chaining calls */ - kill(signal?: string) { + kill(signal?: NodeJS.Signals) { this.childProcess.kill(signal); this.terminated = true; return this; @@ -430,7 +430,7 @@ export class PythonShell extends EventEmitter{ * Alias for kill. * @deprecated */ - terminate(signal?: string) { + terminate(signal?: NodeJS.Signals) { return this.kill(signal) } }; From 2c7df252c14e6cf7d775737549921b1b4342320b Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:21:33 -0700 Subject: [PATCH 028/111] add todo note --- index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.ts b/index.ts index a42aaca..d998706 100644 --- a/index.ts +++ b/index.ts @@ -431,6 +431,7 @@ export class PythonShell extends EventEmitter{ * @deprecated */ terminate(signal?: NodeJS.Signals) { + // todo: remove this next breaking release return this.kill(signal) } }; From a3d85181aa81b6726c004846fa1ea04a70bbead3 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:22:58 -0700 Subject: [PATCH 029/111] remove unnecessary doc line param is already clear --- index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/index.ts b/index.ts index d998706..dda6af7 100644 --- a/index.ts +++ b/index.ts @@ -348,7 +348,6 @@ export class PythonShell extends EventEmitter{ /** * Sends a message to the Python shell through stdin * Override this method to format data to be sent to the Python process - * @param {string|Object} data The message to send * @returns {PythonShell} The same instance for chaining calls */ send(message:string|Object) { From 0b8c20dfe98ddefcb17396af04990f8ebe8662c4 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:27:07 -0700 Subject: [PATCH 030/111] remove unnecessary doc line --- index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/index.ts b/index.ts index dda6af7..7f5bb3f 100644 --- a/index.ts +++ b/index.ts @@ -256,7 +256,6 @@ export class PythonShell extends EventEmitter{ /** * checks syntax without executing code - * @param {string} filePath * @returns {Promise} rejects w/ stderr if syntax failure */ static async checkSyntaxFile(filePath:string){ From 9421d01546056d89dae5951b36594c84c6b60965 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:27:42 -0700 Subject: [PATCH 031/111] remove unnecessary doc line --- index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/index.ts b/index.ts index 7f5bb3f..9859172 100644 --- a/index.ts +++ b/index.ts @@ -234,7 +234,6 @@ export class PythonShell extends EventEmitter{ /** * checks syntax without executing code - * @param {string} code * @returns {Promise} rejects w/ stderr if syntax failure */ static async checkSyntax(code:string){ From e4662ae636ed2fd1381e9647ba3d6e81504d0fe9 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 3 May 2020 09:38:14 -0700 Subject: [PATCH 032/111] update kill documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e75618d..96ec93e 100644 --- a/README.md +++ b/README.md @@ -281,9 +281,9 @@ Parses incoming logs from the Python script written via stderr and emits `stderr Closes the stdin stream, allowing the Python script to finish and exit. The optional callback is invoked when the process is terminated. -#### `.terminate(signal)` +#### `.kill(signal)` -Terminates the python script, the optional end callback is invoked if specified. A kill signal may be provided by `signal`, if `signal` is not specified SIGTERM is sent. +Terminates the python script. A kill signal may be provided by `signal`, if `signal` is not specified SIGTERM is sent. #### event: `message` From 206ca28b64017e5fbcc62e7732826b9ff8a25f41 Mon Sep 17 00:00:00 2001 From: Tira Odhner Date: Tue, 19 May 2020 01:16:16 -0400 Subject: [PATCH 033/111] Make stdout available on error When the process exits with an error, include the stdout output as well as the error. This makes debugging script failures more straightforward since the rest of the output is available. For example: print('hello world') raise Exception('goodbye world') callback() will now receive both "goodbye world" error, and the "hello world" output. --- index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 9859172..5a8d1a1 100644 --- a/index.ts +++ b/index.ts @@ -284,8 +284,7 @@ export class PythonShell extends EventEmitter{ return pyshell.on('message', function (message) { output.push(message); }).end(function (err) { - if (err) return callback(err); - return callback(null, output.length ? output : null); + return callback(err? err : null, output.length ? output : null); }); }; From a796363c34be52d25f332174eb4a4497a0d37d2e Mon Sep 17 00:00:00 2001 From: almenon Date: Tue, 19 May 2020 07:22:27 -0700 Subject: [PATCH 034/111] add test for #217 --- test/python/echo_hi_then_error.py | 2 ++ test/test-python-shell.ts | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 test/python/echo_hi_then_error.py diff --git a/test/python/echo_hi_then_error.py b/test/python/echo_hi_then_error.py new file mode 100644 index 0000000..b22a4ac --- /dev/null +++ b/test/python/echo_hi_then_error.py @@ -0,0 +1,2 @@ +print('hi') +raise Exception('fibble-fah') \ No newline at end of file diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 144cac0..b6f4bb0 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -142,6 +142,13 @@ describe('PythonShell', function () { done(); }); }); + it('should include both output and error', function (done) { + PythonShell.run('echo_hi_then_error.py', null, function (err, results) { + err.should.be.an.Error; + results.should.eql(['hi']) + done(); + }); + }); it('should run the script and fail with an extended stack trace', function (done) { PythonShell.run('error.py', null, function (err, results) { err.should.be.an.Error; From 47aa7b60256f75b5406c4af90f4bbee448abcf4b Mon Sep 17 00:00:00 2001 From: almenon Date: Tue, 19 May 2020 07:23:18 -0700 Subject: [PATCH 035/111] 2.0.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2d30db..4764058 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f23130e..0936519 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.0", + "version": "2.0.1", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From d15bbb97dcf47b7585f47fcfa2de98751a3b343e Mon Sep 17 00:00:00 2001 From: Almenon Date: Sat, 23 May 2020 14:02:43 -0700 Subject: [PATCH 036/111] fix status badge was pointing to last build overall instead of last build on master --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 96ec93e..c8b44ea 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [python-shell](https://www.npmjs.com/package/python-shell) [![Build status](https://ci.appveyor.com/api/projects/status/m8e3h53vvxg5wb2q?svg=true)](https://ci.appveyor.com/project/Almenon/python-shell) [![codecov](https://codecov.io/gh/extrabacon/python-shell/branch/master/graph/badge.svg)](https://codecov.io/gh/extrabacon/python-shell) +# [python-shell](https://www.npmjs.com/package/python-shell) [![Build status](https://ci.appveyor.com/api/projects/status/m8e3h53vvxg5wb2q/branch/master?svg=true)](https://ci.appveyor.com/project/Almenon/python-shell/branch/master) [![codecov](https://codecov.io/gh/extrabacon/python-shell/branch/master/graph/badge.svg)](https://codecov.io/gh/extrabacon/python-shell) A simple way to run Python scripts from Node.js with basic but efficient inter-process communication and better error handling. From 6d640794c35ad0e492a5adf7e06a12746162663c Mon Sep 17 00:00:00 2001 From: Ashley Setter Date: Thu, 30 Jul 2020 11:35:28 +0100 Subject: [PATCH 037/111] defaulting of text parser regardless of mode --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 5a8d1a1..296d92a 100644 --- a/index.ts +++ b/index.ts @@ -6,6 +6,7 @@ import { Readable, Writable } from 'stream' import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; + function toArray(source?:T|T[]):T[] { if (typeof source === 'undefined' || source === null) { return []; @@ -135,7 +136,7 @@ export class PythonShell extends EventEmitter{ this.mode = options.mode || 'text'; this.formatter = resolve('format', options.formatter || this.mode); this.parser = resolve('parse', options.parser || this.mode); - this.stderrParser = resolve('parse', options.stderrParser || this.mode); + this.stderrParser = resolve('parse', options.stderrParser || 'text'); this.terminated = false; this.childProcess = spawn(pythonPath, this.command, options); From 9c13839cd86ec386765cb3ea4172640418bffa68 Mon Sep 17 00:00:00 2001 From: Ashley Setter Date: Thu, 30 Jul 2020 11:41:29 +0100 Subject: [PATCH 038/111] removed extraneous space --- index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/index.ts b/index.ts index 296d92a..d218a10 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,6 @@ import { Readable, Writable } from 'stream' import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; - function toArray(source?:T|T[]):T[] { if (typeof source === 'undefined' || source === null) { return []; From 80ff18ab6e8dfc420ca0b62d64c6680965bd1816 Mon Sep 17 00:00:00 2001 From: Almenon Date: Thu, 30 Jul 2020 20:25:33 -0700 Subject: [PATCH 039/111] Update index.ts --- index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.ts b/index.ts index d218a10..ff4100c 100644 --- a/index.ts +++ b/index.ts @@ -135,6 +135,7 @@ export class PythonShell extends EventEmitter{ this.mode = options.mode || 'text'; this.formatter = resolve('format', options.formatter || this.mode); this.parser = resolve('parse', options.parser || this.mode); + // We don't expect users to ever format stderr as JSON so we default to text mode this.stderrParser = resolve('parse', options.stderrParser || 'text'); this.terminated = false; this.childProcess = spawn(pythonPath, this.command, options); From b9a952e34fc585d40437086f3d0b5491c9462827 Mon Sep 17 00:00:00 2001 From: Almenon Date: Thu, 30 Jul 2020 20:27:57 -0700 Subject: [PATCH 040/111] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c8b44ea..3b682c5 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ Use `options.mode` to quickly setup how data is sent and received between your N * use `json` mode for exchanging JSON fragments * use `binary` mode for anything else (data is sent and received as-is) +Stderr always uses text mode. + For more details and examples including Python source code, take a look at the tests. ### Error Handling and extended stack traces From 620abd5bd344ff46c193a57b9d7e5a017e486862 Mon Sep 17 00:00:00 2001 From: almenon Date: Tue, 22 Sep 2020 03:42:13 -0700 Subject: [PATCH 041/111] upgrade ts-node and typescript --- package-lock.json | 57 ++++++++++++++++++++++------------------------- package.json | 4 ++-- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4764058..f540855 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,10 +28,10 @@ "json-schema-traverse": "^0.3.0" } }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "asn1": { @@ -419,9 +419,9 @@ } }, "make-error": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "mime-db": { @@ -666,9 +666,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -717,25 +717,22 @@ } }, "ts-node": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz", - "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", "dev": true, "requires": { - "arrify": "^1.0.0", - "buffer-from": "^1.1.0", - "diff": "^3.1.0", + "arg": "^4.1.0", + "diff": "^4.0.1", "make-error": "^1.1.1", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "source-map-support": "^0.5.6", - "yn": "^2.0.0" + "source-map-support": "^0.5.17", + "yn": "3.1.1" }, "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true } } @@ -757,9 +754,9 @@ "optional": true }, "typescript": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", - "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==", + "version": "3.9.7", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true }, "uuid": { @@ -786,9 +783,9 @@ "dev": true }, "yn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true } } diff --git a/package.json b/package.json index 0936519..1d35d9f 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "mocha": "^5.2.0", "mocha-appveyor-reporter": "^0.4.0", "should": "^13.2.1", - "ts-node": "^7.0.1", - "typescript": "^3.0.1" + "ts-node": "^9.0.0", + "typescript": "^3.8.3" }, "files": [ "*.d.ts", From 70b67710de34c2739760685379a78a45ee854d40 Mon Sep 17 00:00:00 2001 From: almenon Date: Tue, 22 Sep 2020 03:44:34 -0700 Subject: [PATCH 042/111] update version for new release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d35d9f..45afa1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.1", + "version": "2.0.2", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From 8fdabccaa9594ed076ab0ee65f12a969ef831f0c Mon Sep 17 00:00:00 2001 From: Almenon Date: Tue, 22 Sep 2020 20:10:21 -0700 Subject: [PATCH 043/111] feat(docs): text mode requires newlines --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b682c5..fadcd18 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Use `.send(message)` to send a message to the Python script. Attach the `message Use `options.mode` to quickly setup how data is sent and received between your Node and Python applications. - * use `text` mode for exchanging lines of text + * use `text` mode for exchanging lines of text ending with a [newline character](http://hayne.net/MacDev/Notes/unixFAQ.html#endOfLine). * use `json` mode for exchanging JSON fragments * use `binary` mode for anything else (data is sent and received as-is) From 3e3636a71ce651393d7a28c04bfafc79073003af Mon Sep 17 00:00:00 2001 From: Emily Marigold Klassen Date: Tue, 17 Nov 2020 13:05:44 -0800 Subject: [PATCH 044/111] doc: add typings for events --- index.ts | 38 ++++++++++++++++++++++++++++++++++++++ package-lock.json | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index ff4100c..20e515f 100644 --- a/index.ts +++ b/index.ts @@ -432,3 +432,41 @@ export class PythonShell extends EventEmitter{ return this.kill(signal) } }; + +// This interface is merged in with the above class definition +export interface PythonShell { + addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + addListener(event: "message", listener: (parsedChunk: any) => void): this; + emit(event: "message", parsedChunk: any): boolean; + on(event: "message", listener: (parsedChunk: any) => void): this; + once(event: "message", listener: (parsedChunk: any) => void): this; + prependListener(event: "message", listener: (parsedChunk: any) => void): this; + prependOnceListener(event: "message", listener: (parsedChunk: any) => void): this; + + addListener(event: "stderr", listener: (parsedChunk: any) => void): this; + emit(event: "stderr", parsedChunk: any): boolean; + on(event: "stderr", listener: (parsedChunk: any) => void): this; + once(event: "stderr", listener: (parsedChunk: any) => void): this; + prependListener(event: "stderr", listener: (parsedChunk: any) => void): this; + prependOnceListener(event: "stderr", listener: (parsedChunk: any) => void): this; + + addListener(event: "close", listener: () => void): this; + emit(event: "close", ): boolean; + on(event: "close", listener: () => void): this; + once(event: "close", listener: () => void): this; + prependListener(event: "close", listener: () => void): this; + prependOnceListener(event: "close", listener: () => void): this; + + addListener(event: "error", listener: (error: PythonShellError) => void): this; + emit(event: "error", error: PythonShellError): boolean; + on(event: "error", listener: (error: PythonShellError) => void): this; + once(event: "error", listener: (error: PythonShellError) => void): this; + prependListener(event: "error", listener: (error: PythonShellError) => void): this; + prependOnceListener(event: "error", listener: (error: PythonShellError) => void): this; +} diff --git a/package-lock.json b/package-lock.json index f540855..6b507e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { From f3b64d3307d8dc15eb9c071d8aa774c1e7d5b2d7 Mon Sep 17 00:00:00 2001 From: almenon Date: Thu, 19 Nov 2020 21:45:51 -0800 Subject: [PATCH 045/111] 2.0.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b507e3..abe8484 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.2", + "version": "2.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45afa1f..92ef262 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.2", + "version": "2.0.3", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From c901e7191e49be4144d5210f423e9041894e7dbe Mon Sep 17 00:00:00 2001 From: Erin Cold <71356003+cynthi8@users.noreply.github.com> Date: Tue, 8 Dec 2020 00:20:11 -0500 Subject: [PATCH 046/111] Update README.md Update documentation because python3 is now the default pythonPath. Add Windows default value. [Link](https://github.com/extrabacon/python-shell/blob/f3b64d3307d8dc15eb9c071d8aa774c1e7d5b2d7/index.ts#L94) to relevant line. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fadcd18..a4eb522 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ Creates an instance of `PythonShell` and starts the Python process * `parser`: each line of data (ending with "\n") is parsed with this function and its result is emitted as a message * `stderrParser`: each line of logs (ending with "\n") is parsed with this function and its result is emitted as a message * `encoding`: the text encoding to apply on the child process streams (default: "utf8") - * `pythonPath`: The path where to locate the "python" executable. Default: "python" + * `pythonPath`: The path where to locate the "python" executable. Default: "python3" ("py" for Windows) * `pythonOptions`: Array of option switches to pass to "python" * `scriptPath`: The default path where to look for scripts. Default is the current working directory. * `args`: Array of arguments to pass to the script From b152f683f8b6b345ca276081ebe22ca6c2864261 Mon Sep 17 00:00:00 2001 From: Almenon Date: Tue, 9 Oct 2018 19:45:05 -0400 Subject: [PATCH 047/111] forcing consistent casing in file names --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 7eb40ca..414de00 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,8 @@ ], "sourceMap": true, "rootDir": ".", - "declaration": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "declaration": true }, "exclude": [ "node_modules", From c9bc3de5fc021e622a937d6e4782c666b16d2bc5 Mon Sep 17 00:00:00 2001 From: Almenon Date: Tue, 9 Oct 2018 21:46:42 -0400 Subject: [PATCH 048/111] checkSyntax now uses promises --- index.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/index.ts b/index.ts index 20e515f..88419ae 100644 --- a/index.ts +++ b/index.ts @@ -35,6 +35,7 @@ function extend(obj:{}, ...args) { function getRandomInt(){ return Math.floor(Math.random()*10000000000); } +const execPromise = promisify(exec) export interface Options extends SpawnOptions{ /** @@ -235,6 +236,7 @@ export class PythonShell extends EventEmitter{ /** * checks syntax without executing code +<<<<<<< HEAD * @returns {Promise} rejects w/ stderr if syntax failure */ static async checkSyntax(code:string){ @@ -253,12 +255,26 @@ export class PythonShell extends EventEmitter{ static getPythonPath(){ return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; } +======= + * @returns rejects promise w/ string error output if syntax failure + */ + static async checkSyntax(code:string){ + let randomInt = PythonShell.getRandomInt(); + let filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py` + + const writeFilePromise = promisify(writeFile) + return writeFilePromise(filePath, code).then(()=>{ + return this.checkSyntaxFile(filePath) + }) + } +>>>>>>> checkSyntax now uses promises /** * checks syntax without executing code * @returns {Promise} rejects w/ stderr if syntax failure */ static async checkSyntaxFile(filePath:string){ +<<<<<<< HEAD const pythonPath = this.getPythonPath() const compileCommand = `${pythonPath} -m py_compile ${filePath}` @@ -269,6 +285,10 @@ export class PythonShell extends EventEmitter{ else reject(stderr) }) }) +======= + let compileCommand = `${this.defaultPythonPath} -m py_compile ${filePath}` + return execPromise(compileCommand) +>>>>>>> checkSyntax now uses promises } /** @@ -307,8 +327,12 @@ export class PythonShell extends EventEmitter{ }; static getVersion(pythonPath?:string){ +<<<<<<< HEAD if(!pythonPath) pythonPath = this.getPythonPath() const execPromise = promisify(exec) +======= + if(!pythonPath) pythonPath = this.defaultPythonPath +>>>>>>> checkSyntax now uses promises return execPromise(pythonPath + " --version"); } From c08bef031c641543c2e61e9212f93216c61cb5ab Mon Sep 17 00:00:00 2001 From: Almenon Date: Tue, 9 Oct 2018 21:46:42 -0400 Subject: [PATCH 049/111] checkSyntax now uses promises --- index.ts | 44 +++----------------------------------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/index.ts b/index.ts index 88419ae..ff662ae 100644 --- a/index.ts +++ b/index.ts @@ -35,6 +35,7 @@ function extend(obj:{}, ...args) { function getRandomInt(){ return Math.floor(Math.random()*10000000000); } + const execPromise = promisify(exec) export interface Options extends SpawnOptions{ @@ -236,59 +237,25 @@ export class PythonShell extends EventEmitter{ /** * checks syntax without executing code -<<<<<<< HEAD - * @returns {Promise} rejects w/ stderr if syntax failure + * @returns rejects promise w/ string error output if syntax failure */ static async checkSyntax(code:string){ const randomInt = getRandomInt(); const filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py` - - // todo: replace this with util.promisify (once we no longer support node v7) - return new Promise((resolve, reject) => { - writeFile(filePath, code, (err)=>{ - if (err) reject(err); - resolve(this.checkSyntaxFile(filePath)); - }); - }); - } - - static getPythonPath(){ - return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; - } -======= - * @returns rejects promise w/ string error output if syntax failure - */ - static async checkSyntax(code:string){ - let randomInt = PythonShell.getRandomInt(); - let filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py` const writeFilePromise = promisify(writeFile) return writeFilePromise(filePath, code).then(()=>{ return this.checkSyntaxFile(filePath) }) } ->>>>>>> checkSyntax now uses promises /** * checks syntax without executing code * @returns {Promise} rejects w/ stderr if syntax failure */ static async checkSyntaxFile(filePath:string){ -<<<<<<< HEAD - - const pythonPath = this.getPythonPath() - const compileCommand = `${pythonPath} -m py_compile ${filePath}` - - return new Promise((resolve, reject) => { - exec(compileCommand, (error, stdout, stderr) => { - if(error == null) resolve() - else reject(stderr) - }) - }) -======= let compileCommand = `${this.defaultPythonPath} -m py_compile ${filePath}` return execPromise(compileCommand) ->>>>>>> checkSyntax now uses promises } /** @@ -327,17 +294,12 @@ export class PythonShell extends EventEmitter{ }; static getVersion(pythonPath?:string){ -<<<<<<< HEAD - if(!pythonPath) pythonPath = this.getPythonPath() - const execPromise = promisify(exec) -======= if(!pythonPath) pythonPath = this.defaultPythonPath ->>>>>>> checkSyntax now uses promises return execPromise(pythonPath + " --version"); } static getVersionSync(pythonPath?:string){ - if(!pythonPath) pythonPath = this.getPythonPath() + if(!pythonPath) pythonPath = this.defaultPythonPath return execSync(pythonPath + " --version").toString() } From cf88e7c3335bb7d7897ad35b5a6b9a3b6100bb1f Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 14 Feb 2021 10:37:08 -0800 Subject: [PATCH 050/111] remove broken path --- .vscode/launch.json | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 27b78d2..d3af754 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,20 +1,6 @@ { "version": "0.2.0", "configurations": [ - { - "name": "Python", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "RedirectOutput" - ] - }, { "name": "Current TS Tests File", "type": "node", From e17752d0b36d485c41bf12d53c4531d4e45c899a Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 14 Feb 2021 11:42:18 -0800 Subject: [PATCH 051/111] fix bad merge --- index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index ff662ae..168b7be 100644 --- a/index.ts +++ b/index.ts @@ -249,12 +249,17 @@ export class PythonShell extends EventEmitter{ }) } + static getPythonPath(){ + return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; + } + /** * checks syntax without executing code * @returns {Promise} rejects w/ stderr if syntax failure */ static async checkSyntaxFile(filePath:string){ - let compileCommand = `${this.defaultPythonPath} -m py_compile ${filePath}` + const pythonPath = this.getPythonPath() + let compileCommand = `${pythonPath} -m py_compile ${filePath}` return execPromise(compileCommand) } @@ -294,12 +299,12 @@ export class PythonShell extends EventEmitter{ }; static getVersion(pythonPath?:string){ - if(!pythonPath) pythonPath = this.defaultPythonPath + if(!pythonPath) pythonPath = this.getPythonPath() return execPromise(pythonPath + " --version"); } static getVersionSync(pythonPath?:string){ - if(!pythonPath) pythonPath = this.defaultPythonPath + if(!pythonPath) pythonPath = this.getPythonPath() return execSync(pythonPath + " --version").toString() } From a3272540b6e5cad91d6014ca8ab8da8679cef081 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 14 Feb 2021 11:45:35 -0800 Subject: [PATCH 052/111] fix bad merge --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 414de00..7eb40ca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,8 @@ ], "sourceMap": true, "rootDir": ".", - "forceConsistentCasingInFileNames": true, - "declaration": true + "declaration": true, + "forceConsistentCasingInFileNames": true }, "exclude": [ "node_modules", From 08b065084d8bd01929945f03e742390cb45e3b56 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 14 Feb 2021 11:50:27 -0800 Subject: [PATCH 053/111] spaces > tabs and i dare you to say otherwise --- index.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/index.ts b/index.ts index 168b7be..e7ecb84 100644 --- a/index.ts +++ b/index.ts @@ -236,10 +236,10 @@ export class PythonShell extends EventEmitter{ }; /** - * checks syntax without executing code - * @returns rejects promise w/ string error output if syntax failure - */ - static async checkSyntax(code:string){ + * checks syntax without executing code + * @returns rejects promise w/ string error output if syntax failure + */ + static async checkSyntax(code:string){ const randomInt = getRandomInt(); const filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py` @@ -247,21 +247,21 @@ export class PythonShell extends EventEmitter{ return writeFilePromise(filePath, code).then(()=>{ return this.checkSyntaxFile(filePath) }) - } + } - static getPythonPath(){ - return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; + static getPythonPath(){ + return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; } - /** - * checks syntax without executing code - * @returns {Promise} rejects w/ stderr if syntax failure - */ - static async checkSyntaxFile(filePath:string){ + /** + * checks syntax without executing code + * @returns {Promise} rejects w/ stderr if syntax failure + */ + static async checkSyntaxFile(filePath:string){ const pythonPath = this.getPythonPath() - let compileCommand = `${pythonPath} -m py_compile ${filePath}` + let compileCommand = `${pythonPath} -m py_compile ${filePath}` return execPromise(compileCommand) - } + } /** * Runs a Python script and returns collected messages From f2cf2f802f92d589504e9a4da8c13f0dd087e80a Mon Sep 17 00:00:00 2001 From: almenon Date: Wed, 3 Mar 2021 20:36:02 -0800 Subject: [PATCH 054/111] update launch.json add current ts file launch option remove deprecated python options change formatting of args --- .vscode/launch.json | 74 ++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 27b78d2..720ecc4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,28 +1,48 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Python", - "type": "python", - "request": "launch", - "stopOnEntry": true, - "pythonPath": "${config:python.pythonPath}", - "program": "${file}", - "cwd": "${workspaceRoot}", - "env": {}, - "envFile": "${workspaceRoot}/.env", - "debugOptions": [ - "RedirectOutput" - ] - }, - { - "name": "Current TS Tests File", - "type": "node", - "request": "launch", - "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "args": ["-r", "ts-node/register", "${relativeFile}","--ui","tdd","--no-timeouts"], - "cwd": "${workspaceRoot}", - "protocol": "inspector" - } - ] - } \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "name": "Current TS File", + "type": "node", + "request": "launch", + "args": [ + "${relativeFile}" + ], + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register" + ], + "sourceMaps": true, + "cwd": "${workspaceRoot}", + "protocol": "inspector", + }, + { + "name": "Python", + "type": "python", + "request": "launch", + "stopOnEntry": true, + "python": "${command:python.interpreterPath}", + "program": "${file}", + "cwd": "${workspaceRoot}", + "env": {}, + "envFile": "${workspaceRoot}/.env", + }, + { + "name": "Current TS Tests File", + "type": "node", + "request": "launch", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "args": [ + "-r", + "ts-node/register", + "${relativeFile}", + "--ui", + "tdd", + "--no-timeouts" + ], + "cwd": "${workspaceRoot}", + "protocol": "inspector" + } + ] +} \ No newline at end of file From b10164f26727e31ab2bd04e0115f6e95170c8e6f Mon Sep 17 00:00:00 2001 From: almenon Date: Thu, 4 Mar 2021 22:29:14 -0800 Subject: [PATCH 055/111] apply linting changes --- index.ts | 136 +++++++++++++++++++++++++++---------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/index.ts b/index.ts index e7ecb84..17f9ddc 100644 --- a/index.ts +++ b/index.ts @@ -1,12 +1,12 @@ import { EventEmitter } from 'events'; import { ChildProcess, spawn, SpawnOptions, exec, execSync } from 'child_process'; -import { EOL as newline, tmpdir} from 'os'; +import { EOL as newline, tmpdir } from 'os'; import { join, sep } from 'path' import { Readable, Writable } from 'stream' import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; -function toArray(source?:T|T[]):T[] { +function toArray(source?: T | T[]): T[] { if (typeof source === 'undefined' || source === null) { return []; } else if (!Array.isArray(source)) { @@ -18,7 +18,7 @@ function toArray(source?:T|T[]):T[] { /** * adds arguments as properties to obj */ -function extend(obj:{}, ...args) { +function extend(obj: {}, ...args) { Array.prototype.slice.call(arguments, 1).forEach(function (source) { if (source) { for (let key in source) { @@ -32,20 +32,20 @@ function extend(obj:{}, ...args) { /** * gets a random int from 0-10000000000 */ -function getRandomInt(){ - return Math.floor(Math.random()*10000000000); +function getRandomInt() { + return Math.floor(Math.random() * 10000000000); } const execPromise = promisify(exec) -export interface Options extends SpawnOptions{ +export interface Options extends SpawnOptions { /** * if binary is enabled message and stderr events will not be emitted */ - mode?: 'text'|'json'|'binary' - formatter?: (param:string)=>any - parser?: (param:string)=>any - stderrParser?: (param:string)=>any + mode?: 'text' | 'json' | 'binary' + formatter?: (param: string) => any + parser?: (param: string) => any + stderrParser?: (param: string) => any encoding?: string pythonPath?: string /** @@ -62,9 +62,9 @@ export interface Options extends SpawnOptions{ args?: string[] } -export class PythonShellError extends Error{ +export class PythonShellError extends Error { traceback: string | Buffer; - exitCode?:number; + exitCode?: number; } /** @@ -73,42 +73,42 @@ export class PythonShellError extends Error{ * @param {object} [options] The launch options (also passed to child_process.spawn) * @constructor */ -export class PythonShell extends EventEmitter{ - scriptPath:string - command:string[] - mode:string - formatter:(param:string|Object)=>any - parser:(param:string)=>any - stderrParser:(param:string)=>any - terminated:boolean - childProcess:ChildProcess +export class PythonShell extends EventEmitter { + scriptPath: string + command: string[] + mode: string + formatter: (param: string | Object) => any + parser: (param: string) => any + stderrParser: (param: string) => any + terminated: boolean + childProcess: ChildProcess stdin: Writable; stdout: Readable; stderr: Readable; - exitSignal:string; - exitCode:number; - private stderrHasEnded:boolean; - private stdoutHasEnded:boolean; - private _remaining:string - private _endCallback:(err:PythonShellError, exitCode:number, exitSignal:string)=>any + exitSignal: string; + exitCode: number; + private stderrHasEnded: boolean; + private stdoutHasEnded: boolean; + private _remaining: string + private _endCallback: (err: PythonShellError, exitCode: number, exitSignal: string) => any // starting 2020 python2 is deprecated so we choose 3 as default static defaultPythonPath = process.platform != "win32" ? "python3" : "py"; - static defaultOptions:Options = {}; //allow global overrides for options - + static defaultOptions: Options = {}; //allow global overrides for options + /** * spawns a python process * @param scriptPath path to script. Relative to current directory or options.scriptFolder if specified * @param options */ - constructor(scriptPath:string, options?:Options) { + constructor(scriptPath: string, options?: Options) { super(); /** * returns either pythonshell func (if val string) or custom func (if val Function) */ - function resolve(type, val:string|Function) { + function resolve(type, val: string | Function) { if (typeof val === 'string') { // use a built-in function using its name return PythonShell[type][val]; @@ -118,14 +118,14 @@ export class PythonShell extends EventEmitter{ } } - if(scriptPath.trim().length == 0) throw Error("scriptPath cannot be empty! You must give a script for python to run") + if (scriptPath.trim().length == 0) throw Error("scriptPath cannot be empty! You must give a script for python to run") let self = this; let errorData = ''; EventEmitter.call(this); options = extend({}, PythonShell.defaultOptions, options); - let pythonPath:string; + let pythonPath: string; if (!options.pythonPath) { pythonPath = PythonShell.defaultPythonPath; } else pythonPath = options.pythonPath; @@ -161,7 +161,7 @@ export class PythonShell extends EventEmitter{ this.stderr.on('data', function (data) { errorData += '' + data; }); - this.stderr.on('end', function(){ + this.stderr.on('end', function () { self.stderrHasEnded = true; terminateIfNeeded(); }); @@ -170,7 +170,7 @@ export class PythonShell extends EventEmitter{ } if (this.stdout) { - this.stdout.on('end', function(){ + this.stdout.on('end', function () { self.stdoutHasEnded = true; terminateIfNeeded(); }); @@ -178,16 +178,16 @@ export class PythonShell extends EventEmitter{ self.stdoutHasEnded = true; } - this.childProcess.on('exit', function (code,signal) { + this.childProcess.on('exit', function (code, signal) { self.exitCode = code; self.exitSignal = signal; terminateIfNeeded(); }); function terminateIfNeeded() { - if(!self.stderrHasEnded || !self.stdoutHasEnded || (self.exitCode == null && self.exitSignal == null)) return; + if (!self.stderrHasEnded || !self.stdoutHasEnded || (self.exitCode == null && self.exitSignal == null)) return; - let err:PythonShellError; + let err: PythonShellError; if (self.exitCode && self.exitCode !== 0) { if (errorData) { err = self.parseError(errorData); @@ -209,13 +209,13 @@ export class PythonShell extends EventEmitter{ self.terminated = true; self.emit('close'); - self._endCallback && self._endCallback(err,self.exitCode,self.exitSignal); + self._endCallback && self._endCallback(err, self.exitCode, self.exitSignal); }; } // built-in formatters static format = { - text: function toText(data):string { + text: function toText(data): string { if (!data) return ''; else if (typeof data !== 'string') return data.toString(); return data; @@ -227,10 +227,10 @@ export class PythonShell extends EventEmitter{ //built-in parsers static parse = { - text: function asText(data):string { + text: function asText(data): string { return data; }, - json: function asJson(data:string) { + json: function asJson(data: string) { return JSON.parse(data); } }; @@ -239,25 +239,25 @@ export class PythonShell extends EventEmitter{ * checks syntax without executing code * @returns rejects promise w/ string error output if syntax failure */ - static async checkSyntax(code:string){ + static async checkSyntax(code: string) { const randomInt = getRandomInt(); const filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py` const writeFilePromise = promisify(writeFile) - return writeFilePromise(filePath, code).then(()=>{ + return writeFilePromise(filePath, code).then(() => { return this.checkSyntaxFile(filePath) }) } - static getPythonPath(){ - return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; + static getPythonPath() { + return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; } /** * checks syntax without executing code * @returns {Promise} rejects w/ stderr if syntax failure */ - static async checkSyntaxFile(filePath:string){ + static async checkSyntaxFile(filePath: string) { const pythonPath = this.getPythonPath() let compileCommand = `${pythonPath} -m py_compile ${filePath}` return execPromise(compileCommand) @@ -270,14 +270,14 @@ export class PythonShell extends EventEmitter{ * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static run(scriptPath:string, options?:Options, callback?:(err?:PythonShellError, output?:any[])=>any) { + static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { let pyshell = new PythonShell(scriptPath, options); let output = []; return pyshell.on('message', function (message) { output.push(message); }).end(function (err) { - return callback(err? err : null, output.length ? output : null); + return callback(err ? err : null, output.length ? output : null); }); }; @@ -288,7 +288,7 @@ export class PythonShell extends EventEmitter{ * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static runString(code:string, options?:Options, callback?:(err:PythonShellError, output?:any[])=>any) { + static runString(code: string, options?: Options, callback?: (err: PythonShellError, output?: any[]) => any) { // put code in temp file const randomInt = getRandomInt(); @@ -298,13 +298,13 @@ export class PythonShell extends EventEmitter{ return PythonShell.run(filePath, options, callback); }; - static getVersion(pythonPath?:string){ - if(!pythonPath) pythonPath = this.getPythonPath() + static getVersion(pythonPath?: string) { + if (!pythonPath) pythonPath = this.getPythonPath() return execPromise(pythonPath + " --version"); } - static getVersionSync(pythonPath?:string){ - if(!pythonPath) pythonPath = this.getPythonPath() + static getVersionSync(pythonPath?: string) { + if (!pythonPath) pythonPath = this.getPythonPath() return execSync(pythonPath + " --version").toString() } @@ -313,9 +313,9 @@ export class PythonShell extends EventEmitter{ * @param {string|Buffer} data The stderr contents to parse * @return {Error} The parsed error with extended stack trace when traceback is available */ - private parseError(data:string|Buffer) { - let text = ''+data; - let error:PythonShellError; + private parseError(data: string | Buffer) { + let text = '' + data; + let error: PythonShellError; if (/^Traceback/.test(text)) { // traceback data is available @@ -324,8 +324,8 @@ export class PythonShell extends EventEmitter{ error = new PythonShellError(exception); error.traceback = data; // extend stack trace - error.stack += newline+' ----- Python Traceback -----'+newline+' '; - error.stack += lines.slice(1).join(newline+' '); + error.stack += newline + ' ----- Python Traceback -----' + newline + ' '; + error.stack += lines.slice(1).join(newline + ' '); } else { // otherwise, create a simpler error with stderr contents error = new PythonShellError(text); @@ -339,7 +339,7 @@ export class PythonShell extends EventEmitter{ * Override this method to format data to be sent to the Python process * @returns {PythonShell} The same instance for chaining calls */ - send(message:string|Object) { + send(message: string | Object) { if (!this.stdin) throw new Error("stdin not open for writing"); let data = this.formatter ? this.formatter(message) : message; if (this.mode !== 'binary') data += newline; @@ -353,7 +353,7 @@ export class PythonShell extends EventEmitter{ * Override this method to parse incoming data from the Python process into messages * @param {string|Buffer} data The data to parse into messages */ - receive(data:string|Buffer) { + receive(data: string | Buffer) { return this.receiveInternal(data, 'message'); }; @@ -363,13 +363,13 @@ export class PythonShell extends EventEmitter{ * Override this method to parse incoming logs from the Python process into messages * @param {string|Buffer} data The data to parse into messages */ - receiveStderr(data:string|Buffer) { + receiveStderr(data: string | Buffer) { return this.receiveInternal(data, 'stderr'); }; - private receiveInternal(data:string|Buffer, emitType:'message'|'stderr'){ + private receiveInternal(data: string | Buffer, emitType: 'message' | 'stderr') { let self = this; - let parts = (''+data).split(newline); + let parts = ('' + data).split(newline); if (parts.length === 1) { // an incomplete record, keep buffering @@ -384,8 +384,8 @@ export class PythonShell extends EventEmitter{ this._remaining = lastLine; parts.forEach(function (part) { - if(emitType == 'message') self.emit(emitType, self.parser(part)); - else if(emitType == 'stderr') self.emit(emitType, self.stderrParser(part)); + if (emitType == 'message') self.emit(emitType, self.parser(part)); + else if (emitType == 'stderr') self.emit(emitType, self.stderrParser(part)); }); return this; @@ -396,7 +396,7 @@ export class PythonShell extends EventEmitter{ * this should cause the process to finish its work and close. * @returns {PythonShell} The same instance for chaining calls */ - end(callback:(err:PythonShellError, exitCode:number,exitSignal:string)=>any) { + end(callback: (err: PythonShellError, exitCode: number, exitSignal: string) => any) { if (this.childProcess.stdin) { this.childProcess.stdin.end(); } @@ -448,7 +448,7 @@ export interface PythonShell { prependOnceListener(event: "stderr", listener: (parsedChunk: any) => void): this; addListener(event: "close", listener: () => void): this; - emit(event: "close", ): boolean; + emit(event: "close",): boolean; on(event: "close", listener: () => void): this; once(event: "close", listener: () => void): this; prependListener(event: "close", listener: () => void): this; From f4b2546e8dfa5e4e7786ca8d3a285f611bbdd8db Mon Sep 17 00:00:00 2001 From: almenon Date: Thu, 4 Mar 2021 22:30:28 -0800 Subject: [PATCH 056/111] switch to python as default see https://github.com/extrabacon/python-shell/issues/237 --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 17f9ddc..f68bd28 100644 --- a/index.ts +++ b/index.ts @@ -93,7 +93,7 @@ export class PythonShell extends EventEmitter { private _endCallback: (err: PythonShellError, exitCode: number, exitSignal: string) => any // starting 2020 python2 is deprecated so we choose 3 as default - static defaultPythonPath = process.platform != "win32" ? "python3" : "py"; + static defaultPythonPath = process.platform != "win32" ? "python3" : "python"; static defaultOptions: Options = {}; //allow global overrides for options From 74d0b63a3e58826636fa4d5aab4ce811ad2f99cf Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 10:50:10 -0800 Subject: [PATCH 057/111] update readme for pythonPath --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a4eb522..bed4b36 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [python-shell](https://www.npmjs.com/package/python-shell) [![Build status](https://ci.appveyor.com/api/projects/status/m8e3h53vvxg5wb2q/branch/master?svg=true)](https://ci.appveyor.com/project/Almenon/python-shell/branch/master) [![codecov](https://codecov.io/gh/extrabacon/python-shell/branch/master/graph/badge.svg)](https://codecov.io/gh/extrabacon/python-shell) - + A simple way to run Python scripts from Node.js with basic but efficient inter-process communication and better error handling. ## Features @@ -11,17 +11,15 @@ A simple way to run Python scripts from Node.js with basic but efficient inter-p + Simple and efficient data transfers through stdin and stdout streams + Extended stack traces when an error is thrown +## Requirements +First make sure you are able to run `python3` (Mac/Linux) or `python` (Windows) from the terminal. If you are not then you might need to add it to the PATH. If you want to use a version of python not in the PATH you should specify `options.pythonPath`. + ## Installation ```bash npm install python-shell ``` -To run the tests: -```bash -npm test -``` - ## Documentation ### Running python code: @@ -170,7 +168,7 @@ Creates an instance of `PythonShell` and starts the Python process * `parser`: each line of data (ending with "\n") is parsed with this function and its result is emitted as a message * `stderrParser`: each line of logs (ending with "\n") is parsed with this function and its result is emitted as a message * `encoding`: the text encoding to apply on the child process streams (default: "utf8") - * `pythonPath`: The path where to locate the "python" executable. Default: "python3" ("py" for Windows) + * `pythonPath`: The path where to locate the "python" executable. Default: "python3" ("python" for Windows) * `pythonOptions`: Array of option switches to pass to "python" * `scriptPath`: The default path where to look for scripts. Default is the current working directory. * `args`: Array of arguments to pass to the script From 5f526b7ac6e70e771748b72505f974d504f170b3 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 17:00:47 -0800 Subject: [PATCH 058/111] add test for pythonPath --- test/test-python-shell.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index b6f4bb0..2ecf1f8 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -55,6 +55,15 @@ describe('PythonShell', function () { pyshell.command.should.eql(['-u', 'test' + sep + 'python' + sep + 'exit-code.py']); pyshell.end(done); }); + it('should fail to spawn python with bad path', function (done) { + let pyshell = new PythonShell('exit-code.py', { + pythonPath: 'foeisjofseij' + }, ); + pyshell.on('error', (err: NodeJS.ErrnoException)=>{ + err.code.should.eql('ENOENT') + done() + }) + }); it('should spawn a Python process with script arguments', function (done) { let pyshell = new PythonShell('echo_args.py', { args: ['hello', 'world'] From 96dfae8c415e0c2736f2f12e5a117f7d3648ec01 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 17:38:34 -0800 Subject: [PATCH 059/111] fix #118 --- README.md | 11 ++++++++- index.ts | 48 +++++++++++++++++++++++---------------- test/test-python-shell.ts | 12 +++++----- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index bed4b36..a3f228d 100644 --- a/README.md +++ b/README.md @@ -323,10 +323,19 @@ shell.on('stderr', function (stderr) { Fires when the process has been terminated, with an error or not. -#### event: `error` +#### event: `pythonError` Fires when the process terminates with a non-zero exit code. +#### event: `error` + +Fires when: +* The process could not be spawned, or +* The process could not be killed, or +* Sending a message to the child process failed. + +If the process could not be spawned please double-check that python can be launched from the terminal. + ## Used By: Python-Shell is used by [arepl-vscode](https://github.com/almenon/arepl-vscode), [gitinspector](https://github.com/ejwa/gitinspector), [pyspreadsheet](https://github.com/extrabacon/pyspreadsheet), [AtlantOS Ocean Data QC](https://github.com/ocean-data-qc/ocean-data-qc) and more! diff --git a/index.ts b/index.ts index f68bd28..09f9bee 100644 --- a/index.ts +++ b/index.ts @@ -62,7 +62,7 @@ export interface Options extends SpawnOptions { args?: string[] } -export class PythonShellError extends Error { +export class PythonError extends Error { traceback: string | Buffer; exitCode?: number; } @@ -90,7 +90,7 @@ export class PythonShell extends EventEmitter { private stderrHasEnded: boolean; private stdoutHasEnded: boolean; private _remaining: string - private _endCallback: (err: PythonShellError, exitCode: number, exitSignal: string) => any + private _endCallback: (err: PythonError, exitCode: number, exitSignal: string) => any // starting 2020 python2 is deprecated so we choose 3 as default static defaultPythonPath = process.platform != "win32" ? "python3" : "python"; @@ -178,6 +178,9 @@ export class PythonShell extends EventEmitter { self.stdoutHasEnded = true; } + this.childProcess.on('error', function(err: NodeJS.ErrnoException){ + self.emit('error', err); + }) this.childProcess.on('exit', function (code, signal) { self.exitCode = code; self.exitSignal = signal; @@ -187,14 +190,14 @@ export class PythonShell extends EventEmitter { function terminateIfNeeded() { if (!self.stderrHasEnded || !self.stdoutHasEnded || (self.exitCode == null && self.exitSignal == null)) return; - let err: PythonShellError; + let err: PythonError; if (self.exitCode && self.exitCode !== 0) { if (errorData) { err = self.parseError(errorData); } else { - err = new PythonShellError('process exited with code ' + self.exitCode); + err = new PythonError('process exited with code ' + self.exitCode); } - err = extend(err, { + err = extend(err, { executable: pythonPath, options: pythonOptions.length ? pythonOptions : null, script: self.scriptPath, @@ -202,8 +205,8 @@ export class PythonShell extends EventEmitter { exitCode: self.exitCode }); // do not emit error if only a callback is used - if (self.listeners('error').length || !self._endCallback) { - self.emit('error', err); + if (self.listeners('pythonError').length || !self._endCallback) { + self.emit('pythonError', err); } } @@ -270,7 +273,7 @@ export class PythonShell extends EventEmitter { * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { + static run(scriptPath: string, options?: Options, callback?: (err?: PythonError, output?: any[]) => any) { let pyshell = new PythonShell(scriptPath, options); let output = []; @@ -288,7 +291,7 @@ export class PythonShell extends EventEmitter { * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static runString(code: string, options?: Options, callback?: (err: PythonShellError, output?: any[]) => any) { + static runString(code: string, options?: Options, callback?: (err: PythonError, output?: any[]) => any) { // put code in temp file const randomInt = getRandomInt(); @@ -315,20 +318,20 @@ export class PythonShell extends EventEmitter { */ private parseError(data: string | Buffer) { let text = '' + data; - let error: PythonShellError; + let error: PythonError; if (/^Traceback/.test(text)) { // traceback data is available let lines = text.trim().split(newline); let exception = lines.pop(); - error = new PythonShellError(exception); + error = new PythonError(exception); error.traceback = data; // extend stack trace error.stack += newline + ' ----- Python Traceback -----' + newline + ' '; error.stack += lines.slice(1).join(newline + ' '); } else { // otherwise, create a simpler error with stderr contents - error = new PythonShellError(text); + error = new PythonError(text); } return error; @@ -396,7 +399,7 @@ export class PythonShell extends EventEmitter { * this should cause the process to finish its work and close. * @returns {PythonShell} The same instance for chaining calls */ - end(callback: (err: PythonShellError, exitCode: number, exitSignal: string) => any) { + end(callback: (err: PythonError, exitCode: number, exitSignal: string) => any) { if (this.childProcess.stdin) { this.childProcess.stdin.end(); } @@ -454,10 +457,17 @@ export interface PythonShell { prependListener(event: "close", listener: () => void): this; prependOnceListener(event: "close", listener: () => void): this; - addListener(event: "error", listener: (error: PythonShellError) => void): this; - emit(event: "error", error: PythonShellError): boolean; - on(event: "error", listener: (error: PythonShellError) => void): this; - once(event: "error", listener: (error: PythonShellError) => void): this; - prependListener(event: "error", listener: (error: PythonShellError) => void): this; - prependOnceListener(event: "error", listener: (error: PythonShellError) => void): this; + addListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; + emit(event: "error", error: NodeJS.ErrnoException): boolean; + on(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; + once(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; + prependListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; + prependOnceListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; + + addListener(event: "pythonError", listener: (error: PythonError) => void): this; + emit(event: "pythonError", error: PythonError): boolean; + on(event: "pythonError", listener: (error: PythonError) => void): this; + once(event: "pythonError", listener: (error: PythonError) => void): this; + prependListener(event: "pythonError", listener: (error: PythonError) => void): this; + prependOnceListener(event: "pythonError", listener: (error: PythonError) => void): this; } diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 2ecf1f8..976d68b 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -59,7 +59,7 @@ describe('PythonShell', function () { let pyshell = new PythonShell('exit-code.py', { pythonPath: 'foeisjofseij' }, ); - pyshell.on('error', (err: NodeJS.ErrnoException)=>{ + pyshell.on('error', (err)=>{ err.code.should.eql('ENOENT') done() }) @@ -450,7 +450,7 @@ describe('PythonShell', function () { let pyshell = new PythonShell('exit-code.py', { args: ['3'] }); - pyshell.on('error', function (err) { + pyshell.on('pythonError', function (err) { err.should.have.properties({ message: 'process exited with code 3', exitCode: 3 @@ -460,7 +460,7 @@ describe('PythonShell', function () { }); it('should emit error when the program exits because of an unhandled exception', function (done) { let pyshell = new PythonShell('error.py'); - pyshell.on('error', function (err) { + pyshell.on('pythonError', function (err) { err.message.should.be.equalOneOf('ZeroDivisionError: integer division or modulo by zero','ZeroDivisionError: division by zero'); err.should.have.property('traceback'); err.traceback.should.containEql('Traceback (most recent call last)'); @@ -469,7 +469,7 @@ describe('PythonShell', function () { }); it('should NOT emit error when logging is written to stderr', function (done) { let pyshell = new PythonShell('stderrLogging.py'); - pyshell.on('error', function (err) { + pyshell.on('pythonError', function (err) { done(new Error("an error should not have been raised")); }); pyshell.on('close', function(){ @@ -483,14 +483,14 @@ describe('PythonShell', function () { let pyshell = new PythonShell('exit-code.py', { args: ['1'] }); - pyshell.on('error', function (err) { + pyshell.on('pythonError', function (err) { err.should.have.properties(['exitCode', 'script', 'options', 'args']); done(); }); }); it('should extend err.stack with traceback', function (done) { let pyshell = new PythonShell('error.py'); - pyshell.on('error', function (err) { + pyshell.on('pythonError', function (err) { err.stack.should.containEql('----- Python Traceback -----'); err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 4'); err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 6'); From 3483dcfa851dfcd49a37ec2d454c3232e6136fbf Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 18:03:30 -0800 Subject: [PATCH 060/111] revert name change should try to keep consistent to minimize API changes for upstream devs --- index.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/index.ts b/index.ts index 09f9bee..9287b90 100644 --- a/index.ts +++ b/index.ts @@ -62,7 +62,7 @@ export interface Options extends SpawnOptions { args?: string[] } -export class PythonError extends Error { +export class PythonShellError extends Error { traceback: string | Buffer; exitCode?: number; } @@ -90,7 +90,7 @@ export class PythonShell extends EventEmitter { private stderrHasEnded: boolean; private stdoutHasEnded: boolean; private _remaining: string - private _endCallback: (err: PythonError, exitCode: number, exitSignal: string) => any + private _endCallback: (err: PythonShellError, exitCode: number, exitSignal: string) => any // starting 2020 python2 is deprecated so we choose 3 as default static defaultPythonPath = process.platform != "win32" ? "python3" : "python"; @@ -190,14 +190,14 @@ export class PythonShell extends EventEmitter { function terminateIfNeeded() { if (!self.stderrHasEnded || !self.stdoutHasEnded || (self.exitCode == null && self.exitSignal == null)) return; - let err: PythonError; + let err: PythonShellError; if (self.exitCode && self.exitCode !== 0) { if (errorData) { err = self.parseError(errorData); } else { - err = new PythonError('process exited with code ' + self.exitCode); + err = new PythonShellError('process exited with code ' + self.exitCode); } - err = extend(err, { + err = extend(err, { executable: pythonPath, options: pythonOptions.length ? pythonOptions : null, script: self.scriptPath, @@ -273,7 +273,7 @@ export class PythonShell extends EventEmitter { * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static run(scriptPath: string, options?: Options, callback?: (err?: PythonError, output?: any[]) => any) { + static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { let pyshell = new PythonShell(scriptPath, options); let output = []; @@ -291,7 +291,7 @@ export class PythonShell extends EventEmitter { * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static runString(code: string, options?: Options, callback?: (err: PythonError, output?: any[]) => any) { + static runString(code: string, options?: Options, callback?: (err: PythonShellError, output?: any[]) => any) { // put code in temp file const randomInt = getRandomInt(); @@ -318,20 +318,20 @@ export class PythonShell extends EventEmitter { */ private parseError(data: string | Buffer) { let text = '' + data; - let error: PythonError; + let error: PythonShellError; if (/^Traceback/.test(text)) { // traceback data is available let lines = text.trim().split(newline); let exception = lines.pop(); - error = new PythonError(exception); + error = new PythonShellError(exception); error.traceback = data; // extend stack trace error.stack += newline + ' ----- Python Traceback -----' + newline + ' '; error.stack += lines.slice(1).join(newline + ' '); } else { // otherwise, create a simpler error with stderr contents - error = new PythonError(text); + error = new PythonShellError(text); } return error; @@ -399,7 +399,7 @@ export class PythonShell extends EventEmitter { * this should cause the process to finish its work and close. * @returns {PythonShell} The same instance for chaining calls */ - end(callback: (err: PythonError, exitCode: number, exitSignal: string) => any) { + end(callback: (err: PythonShellError, exitCode: number, exitSignal: string) => any) { if (this.childProcess.stdin) { this.childProcess.stdin.end(); } @@ -464,10 +464,10 @@ export interface PythonShell { prependListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; prependOnceListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; - addListener(event: "pythonError", listener: (error: PythonError) => void): this; - emit(event: "pythonError", error: PythonError): boolean; - on(event: "pythonError", listener: (error: PythonError) => void): this; - once(event: "pythonError", listener: (error: PythonError) => void): this; - prependListener(event: "pythonError", listener: (error: PythonError) => void): this; - prependOnceListener(event: "pythonError", listener: (error: PythonError) => void): this; + addListener(event: "pythonError", listener: (error: PythonShellError) => void): this; + emit(event: "pythonError", error: PythonShellError): boolean; + on(event: "pythonError", listener: (error: PythonShellError) => void): this; + once(event: "pythonError", listener: (error: PythonShellError) => void): this; + prependListener(event: "pythonError", listener: (error: PythonShellError) => void): this; + prependOnceListener(event: "pythonError", listener: (error: PythonShellError) => void): this; } From 101e71b1c0c773670585ab1b5fe626cefcd98fad Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 18:05:06 -0800 Subject: [PATCH 061/111] increment version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index abe8484..6cfb31d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.3", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 92ef262..6bad030 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "2.0.3", + "version": "3.0.0", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From 75e15ad4ee8f393acfd2853295e12090b4d75c46 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 21:12:42 -0800 Subject: [PATCH 062/111] standardize changelog format see https://keepachangelog.com/en/1.0.0/ --- CHANGELOG.md | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d2c157..72c18c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,26 @@ -## 1.0.8 -* @joaoe fixed a bug with pythonshell not working with unset std streams -* https://github.com/extrabacon/python-shell/milestone/9 +## [1.0.8] +### Fixed +- @joaoe fixed a bug with pythonshell not working with unset std streams +- https://github.com/extrabacon/python-shell/milestone/9 -## 1.0.7 -* default python path updated to py on windows +## [1.0.7] +### Changed +- default python path updated to py on windows -## 1.0.4 -* added getVersionSync +## [1.0.4] +### Added +- added getVersionSync -## 0.0.3 -* fixed buffering in `PythonShell.receive`, fixing [#1](https://github.com/extrabacon/python-shell/issues/1) +## [0.0.3] +### Fixed +- fixed buffering in `PythonShell.receive`, fixing [#1](https://github.com/extrabacon/python-shell/issues/1) -## 0.0.2 -* improved documentation +## [0.0.2] +### Changed +- improved documentation -## 0.0.1 -* initial version -* independent module moved from [extrabacon/pyspreadsheet](https://github.com/extrabacon/pyspreadsheet) +## [0.0.1] +### Added +- initial version +- independent module moved from [extrabacon/pyspreadsheet](https://github.com/extrabacon/pyspreadsheet) From 79042d83a5a0623e249c2d1e2769f3420bb9bd4e Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 21:13:16 -0800 Subject: [PATCH 063/111] Add changes to changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72c18c8..a44ee40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [3.0.0] - 2021-03-07 +### Changed +- **BREAKING** Default python path changed back to `python` on Windows. #237 +- **BREAKING** `error` event renamed to `pythonError` event + +### Added +- `error` event that is fired upon failure to launch process, among other things #118 + ## [1.0.8] ### Fixed - @joaoe fixed a bug with pythonshell not working with unset std streams From 230bec49550dba40936de1dc576641367e0da511 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 7 Mar 2021 21:20:53 -0800 Subject: [PATCH 064/111] added links --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a44ee40..da922de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,10 @@ ## [3.0.0] - 2021-03-07 ### Changed -- **BREAKING** Default python path changed back to `python` on Windows. #237 -- **BREAKING** `error` event renamed to `pythonError` event +- **BREAKING** Default python path changed back to `python` on Windows. [#237](https://github.com/extrabacon/python-shell/issues/237) +- **BREAKING** `error` event renamed to `pythonError` event. [#118](https://github.com/extrabacon/python-shell/issues/118) ### Added -- `error` event that is fired upon failure to launch process, among other things #118 +- `error` event that is fired upon failure to launch process, among other things. [#118](https://github.com/extrabacon/python-shell/issues/118) ## [1.0.8] ### Fixed From a2c79a3f5a92ea9bd99e1233225089feeb032c51 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 14 Mar 2021 13:02:20 -0700 Subject: [PATCH 065/111] formatting & remove deprecated buffer --- test/test-python-shell.ts | 70 +++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 976d68b..d0208ca 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -1,7 +1,7 @@ import * as should from 'should'; -import {PythonShell} from '..' -import {sep, join} from 'path' -import {EOL as newline} from 'os' +import { PythonShell } from '..' +import { sep, join } from 'path' +import { EOL as newline } from 'os' import { chdir, cwd } from 'process'; describe('PythonShell', function () { @@ -58,8 +58,8 @@ describe('PythonShell', function () { it('should fail to spawn python with bad path', function (done) { let pyshell = new PythonShell('exit-code.py', { pythonPath: 'foeisjofseij' - }, ); - pyshell.on('error', (err)=>{ + }); + pyshell.on('error', (err) => { err.code.should.eql('ENOENT') done() }) @@ -78,14 +78,14 @@ describe('PythonShell', function () { // note checkSyntax is a wrapper around checkSyntaxFile // so this tests checkSyntaxFile as well - it('should check syntax', function ( done) { - PythonShell.checkSyntax("x=1").then(()=>{ + it('should check syntax', function (done) { + PythonShell.checkSyntax("x=1").then(() => { done(); }) }) - it('should invalidate bad syntax', function ( done) { - PythonShell.checkSyntax("x=").catch(()=>{ + it('should invalidate bad syntax', function (done) { + PythonShell.checkSyntax("x=").catch(() => { done(); }) }) @@ -114,7 +114,7 @@ describe('PythonShell', function () { // }) describe('#runString(script, options)', function () { - before(()=>{ + before(() => { PythonShell.defaultOptions = {}; }) it('should be able to execute a string of python code', function (done) { @@ -125,7 +125,7 @@ describe('PythonShell', function () { done(); }); }); - after(()=>{ + after(() => { PythonShell.defaultOptions = { // reset to match initial value scriptPath: pythonFolder @@ -167,7 +167,7 @@ describe('PythonShell', function () { }); }); it('should run the script and fail with an extended stack trace even when mode is binary', function (done) { - PythonShell.run('error.py', {mode: "binary"}, function (err, results) { + PythonShell.run('error.py', { mode: "binary" }, function (err, results) { err.should.be.an.Error; err.exitCode.should.be.exactly(1); err.stack.should.containEql('----- Python Traceback -----'); @@ -183,7 +183,7 @@ describe('PythonShell', function () { function end() { count++; if (count === numberOfTimesToRun) { - done(); + done(); } } function runSingleErrorScript(callback) { @@ -205,7 +205,7 @@ describe('PythonShell', function () { function end() { count++; if (count === numberOfTimesToRun) { - done(); + done(); } } function runSingleScript(callback) { @@ -220,10 +220,10 @@ describe('PythonShell', function () { } }); - - it('should be able to run modules', function(done){ + + it('should be able to run modules', function (done) { PythonShell.defaultOptions = {}; - + PythonShell.run('-m', { args: ['timeit', '-n 1', `'x=5'`] }, function (err, results) { @@ -236,12 +236,12 @@ describe('PythonShell', function () { if (err) return done(err); results.should.be.an.Array(); results[0].should.be.an.String(); - results[0].slice(0,6).should.eql('1 loop'); + results[0].slice(0, 6).should.eql('1 loop'); done(); }); }) - after(()=>{ + after(() => { // should be able to run modules test should theoretically reset this // but we have this to in case something goes horribly wrong with the test PythonShell.defaultOptions = { @@ -263,7 +263,7 @@ describe('PythonShell', function () { should(pyshell.stdin).be.eql(null); should(pyshell.stdout).be.eql(null); should(pyshell.stderr).be.eql(null); - should.throws(() => {pyshell.send("asd")}); + should.throws(() => { pyshell.send("asd") }); }); }); @@ -274,11 +274,11 @@ describe('PythonShell', function () { }); let output = ''; pyshell.stdout.on('data', function (data) { - output += ''+data; + output += '' + data; }); pyshell.send('hello').send('world').end(function (err) { if (err) return done(err); - output.should.be.exactly('hello'+newline+'world'+newline); + output.should.be.exactly('hello' + newline + 'world' + newline); done(); }); }); @@ -288,11 +288,11 @@ describe('PythonShell', function () { }); let output = ''; pyshell.stdout.on('data', function (data) { - output += ''+data; + output += '' + data; }); pyshell.send({ a: 'b' }).send(null).send([1, 2, 3]).end(function (err) { if (err) return done(err); - output.should.be.exactly('{"a": "b"}'+newline+'null'+newline+'[1, 2, 3]'+newline); + output.should.be.exactly('{"a": "b"}' + newline + 'null' + newline + '[1, 2, 3]' + newline); done(); }); }); @@ -304,11 +304,11 @@ describe('PythonShell', function () { }); let output = ''; pyshell.stdout.on('data', function (data) { - output += ''+data; + output += '' + data; }); pyshell.send('hello').send('world').end(function (err) { if (err) return done(err); - output.should.be.exactly('HELLO'+newline+'WORLD'+newline+''); + output.should.be.exactly('HELLO' + newline + 'WORLD' + newline + ''); done(); }); }); @@ -318,9 +318,9 @@ describe('PythonShell', function () { }); let output = ''; pyshell.stdout.on('data', function (data) { - output += ''+data; + output += '' + data; }); - pyshell.send(new Buffer('i am not a string')).end(function (err) { + pyshell.send(Buffer.from('i am not a string')).end(function (err) { if (err) return done(err); output.should.be.exactly('i am not a string'); done(); @@ -364,7 +364,7 @@ describe('PythonShell', function () { pyshell.on('message', function (message) { message.should.be.an.Object; message.should.eql({ a: true }); - }).receive('{"a"').receive(':').receive('true}'+newline+'').end(done); + }).receive('{"a"').receive(':').receive('true}' + newline + '').end(done); }); it('should not be invoked when mode is "binary"', function (done) { let pyshell = new PythonShell('echo_args.py', { @@ -440,7 +440,7 @@ describe('PythonShell', function () { describe('.end(callback)', function () { it('should end normally when exit code is zero', function (done) { let pyshell = new PythonShell('exit-code.py'); - pyshell.end(function (err,code,signal) { + pyshell.end(function (err, code, signal) { if (err) return done(err); code.should.be.exactly(0); done(); @@ -461,7 +461,7 @@ describe('PythonShell', function () { it('should emit error when the program exits because of an unhandled exception', function (done) { let pyshell = new PythonShell('error.py'); pyshell.on('pythonError', function (err) { - err.message.should.be.equalOneOf('ZeroDivisionError: integer division or modulo by zero','ZeroDivisionError: division by zero'); + err.message.should.be.equalOneOf('ZeroDivisionError: integer division or modulo by zero', 'ZeroDivisionError: division by zero'); err.should.have.property('traceback'); err.traceback.should.containEql('Traceback (most recent call last)'); done(); @@ -472,7 +472,7 @@ describe('PythonShell', function () { pyshell.on('pythonError', function (err) { done(new Error("an error should not have been raised")); }); - pyshell.on('close', function(){ + pyshell.on('close', function () { done(); }) }); @@ -509,7 +509,7 @@ describe('PythonShell', function () { it('run the end callback if specified', function (done) { let pyshell = new PythonShell('infinite_loop.py'); let endCalled = false; - pyshell.end(()=>{ + pyshell.end(() => { endCalled = true; }) pyshell.terminate(); @@ -519,12 +519,12 @@ describe('PythonShell', function () { it('terminate with correct kill signal', function (done) { let pyshell = new PythonShell('infinite_loop.py'); let endCalled = false; - pyshell.end(()=>{ + pyshell.end(() => { endCalled = true; }) pyshell.terminate('SIGKILL'); pyshell.terminated.should.be.true; - setTimeout(()=>{pyshell.exitSignal.should.be.exactly('SIGKILL');},500); + setTimeout(() => { pyshell.exitSignal.should.be.exactly('SIGKILL'); }, 500); done(); }); }); From 59d029ea2af9a0c46952942c1d153eac9f85ac82 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 14 Mar 2021 13:15:46 -0700 Subject: [PATCH 066/111] made test more comprehensive --- test/test-python-shell.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index d0208ca..aae6500 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -364,7 +364,7 @@ describe('PythonShell', function () { pyshell.on('message', function (message) { message.should.be.an.Object; message.should.eql({ a: true }); - }).receive('{"a"').receive(':').receive('true}' + newline + '').end(done); + }).receive('{"a"').receive(':').receive('true}' + newline + '{').receive('"a":true}' + newline).end(done); }); it('should not be invoked when mode is "binary"', function (done) { let pyshell = new PythonShell('echo_args.py', { From 4d8a841cbf143dd63ddeb3db43aa2014afe4fef2 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 20 Mar 2021 12:00:52 -0700 Subject: [PATCH 067/111] switch to LineTransformStream this breaks unit tests for some reason :( --- index.ts | 62 +--- package-lock.json | 712 ++++++++++++++++++++++++++++++++++---- package.json | 8 +- test/test-python-shell.ts | 10 +- 4 files changed, 661 insertions(+), 131 deletions(-) diff --git a/index.ts b/index.ts index 9287b90..1ca0e75 100644 --- a/index.ts +++ b/index.ts @@ -5,6 +5,7 @@ import { join, sep } from 'path' import { Readable, Writable } from 'stream' import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; +const LineTransformStream = require('line-transform-stream') function toArray(source?: T | T[]): T[] { if (typeof source === 'undefined' || source === null) { @@ -147,14 +148,19 @@ export class PythonShell extends EventEmitter { self.parser && self[name] && self[name].setEncoding(options.encoding || 'utf8'); }); - // parse incoming data on stdout + // Node buffers stdout&stderr in batches regardless of newline placement + // This is troublesome if you want to recieve distinct individual messages + // for example JSON parsing breaks if it recieves partial JSON + // so we use LineTransformStream to emit each batch seperated by newline if (this.parser && this.stdout) { - this.stdout.on('data', this.receive.bind(this)); + this.stdout.pipe(new LineTransformStream((data) => { + this.emit('message', self.parser(data)); + })) } - - // listen to stderr and emit errors for incoming data if (this.stderrParser && this.stderr) { - this.stderr.on('data', this.receiveStderr.bind(this)); + this.stdout.pipe(new LineTransformStream((data) => { + this.emit('stderr', self.stderrParser(data)); + })) } if (this.stderr) { @@ -178,7 +184,7 @@ export class PythonShell extends EventEmitter { self.stdoutHasEnded = true; } - this.childProcess.on('error', function(err: NodeJS.ErrnoException){ + this.childProcess.on('error', function (err: NodeJS.ErrnoException) { self.emit('error', err); }) this.childProcess.on('exit', function (code, signal) { @@ -350,50 +356,6 @@ export class PythonShell extends EventEmitter { return this; }; - /** - * Parses data received from the Python shell stdout stream and emits "message" events - * This method is not used in binary mode - * Override this method to parse incoming data from the Python process into messages - * @param {string|Buffer} data The data to parse into messages - */ - receive(data: string | Buffer) { - return this.receiveInternal(data, 'message'); - }; - - /** - * Parses data received from the Python shell stderr stream and emits "stderr" events - * This method is not used in binary mode - * Override this method to parse incoming logs from the Python process into messages - * @param {string|Buffer} data The data to parse into messages - */ - receiveStderr(data: string | Buffer) { - return this.receiveInternal(data, 'stderr'); - }; - - private receiveInternal(data: string | Buffer, emitType: 'message' | 'stderr') { - let self = this; - let parts = ('' + data).split(newline); - - if (parts.length === 1) { - // an incomplete record, keep buffering - this._remaining = (this._remaining || '') + parts[0]; - return this; - } - - let lastLine = parts.pop(); - // fix the first line with the remaining from the previous iteration of 'receive' - parts[0] = (this._remaining || '') + parts[0]; - // keep the remaining for the next iteration of 'receive' - this._remaining = lastLine; - - parts.forEach(function (part) { - if (emitType == 'message') self.emit(emitType, self.parser(part)); - else if (emitType == 'stderr') self.emit(emitType, self.stderrParser(part)); - }); - - return this; - } - /** * Closes the stdin stream. Unless python is listening for stdin in a loop * this should cause the process to finish its work and close. diff --git a/package-lock.json b/package-lock.json index 6cfb31d..3a732f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@types/mocha": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", - "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", + "integrity": "sha512-NysN+bNqj6E0Hv4CTGWSlPzMW6vTKjDpOteycDkV4IWBsO+PU48JonrPzV9ODjiI2XrjmA05KInLgF5ivZ/YGQ==", "dev": true }, "@types/node": { @@ -16,6 +16,12 @@ "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", "dev": true }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -28,12 +34,49 @@ "json-schema-traverse": "^0.3.0" } }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -83,6 +126,12 @@ "tweetnacl": "^0.14.3" } }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, "boom": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", @@ -102,6 +151,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -114,18 +172,121 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "dev": true }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.3.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "combined-stream": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", @@ -135,12 +296,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.15.1", - "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -183,14 +338,28 @@ } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -204,9 +373,9 @@ "dev": true }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, "ecc-jsbn": { @@ -220,6 +389,24 @@ "safer-buffer": "^2.1.0" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -244,6 +431,31 @@ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", "dev": true }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -267,6 +479,19 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -277,9 +502,9 @@ } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -290,6 +515,15 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", @@ -313,9 +547,9 @@ } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "hawk": { @@ -331,9 +565,9 @@ } }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "hoek": { @@ -364,9 +598,51 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, "is-typedarray": { @@ -375,12 +651,27 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -418,6 +709,29 @@ "verror": "1.10.0" } }, + "line-transform-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/line-transform-stream/-/line-transform-stream-0.1.0.tgz", + "integrity": "sha1-Hvhnmsy/cbBkREwroTsheFs+vXg=" + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -448,46 +762,37 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", + "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", "dev": true, "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - } + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" } }, "mocha-appveyor-reporter": { @@ -500,9 +805,21 @@ } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "nanoid": { + "version": "3.1.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", + "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "oauth-sign": { @@ -520,6 +837,30 @@ "wrappy": "1" } }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -532,6 +873,12 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -544,6 +891,24 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, "request": { "version": "2.83.0", "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", @@ -584,6 +949,12 @@ "request": "2.83.0" } }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -596,10 +967,19 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, + "serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, "should": { - "version": "13.2.1", - "resolved": "https://registry.npmjs.org/should/-/should-13.2.1.tgz", - "integrity": "sha512-l+/NwEMO+DcstsHEwPHRHzC9j4UOE3VQwJGcMWSsD/vqpqHbnQ+1iSHy64Ihmmjx1uiRPD9pFadTSc3MJtXAgw==", + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", "dev": true, "requires": { "should-equal": "^2.0.0", @@ -645,9 +1025,9 @@ } }, "should-util": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", - "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", + "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, "sntp": { @@ -692,19 +1072,53 @@ "tweetnacl": "~0.14.0" } }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, "stringstream": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", "dev": true }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "is-number": "^7.0.0" } }, "tough-cookie": { @@ -776,17 +1190,165 @@ "extsprintf": "^1.2.0" } }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "workerpool": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", + "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } } } diff --git a/package.json b/package.json index 6bad030..21e1507 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,13 @@ "appveyorTest": "tsc -p ./ && nyc mocha --reporter mocha-appveyor-reporter test/*.js", "compile": "tsc -watch -p ./" }, - "dependencies": {}, + "dependencies": { + "line-transform-stream": "^0.1.0" + }, "devDependencies": { - "@types/mocha": "^5.2.5", + "@types/mocha": "^8.2.1", "@types/node": "^10.5.2", - "mocha": "^5.2.0", + "mocha": "^8.2.1", "mocha-appveyor-reporter": "^0.4.0", "should": "^13.2.1", "ts-node": "^9.0.0", diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index aae6500..b4c510d 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -358,13 +358,17 @@ describe('PythonShell', function () { }).end(done); }); it('should properly buffer partial messages', function (done) { - let pyshell = new PythonShell('echo_json.py', { + let pyshell = new PythonShell('echo_text.py', { mode: 'json' }); - pyshell.on('message', function (message) { + pyshell.on('message', (message) => { + console.log(message) message.should.be.an.Object; message.should.eql({ a: true }); - }).receive('{"a"').receive(':').receive('true}' + newline + '{').receive('"a":true}' + newline).end(done); + }).send('{"a"').send(':').send('true}' + newline + '{').send('"a":true}' + newline).end(() => { + console.log('done called') + done() + }); }); it('should not be invoked when mode is "binary"', function (done) { let pyshell = new PythonShell('echo_args.py', { From 9c7be5f34f2beaeb032434fa94544c7eee2f14c4 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 21 Mar 2021 10:56:58 -0700 Subject: [PATCH 068/111] fix typo --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 1ca0e75..4210528 100644 --- a/index.ts +++ b/index.ts @@ -158,7 +158,7 @@ export class PythonShell extends EventEmitter { })) } if (this.stderrParser && this.stderr) { - this.stdout.pipe(new LineTransformStream((data) => { + this.stderr.pipe(new LineTransformStream((data) => { this.emit('stderr', self.stderrParser(data)); })) } From 22aa8bc16c4067987b7c235a2c9d240970760187 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 27 Mar 2021 12:48:28 -0700 Subject: [PATCH 069/111] remove LineTransformStream I went in favor of a native solution. LineTransformStream had some bugs. --- CHANGELOG.md | 1 + README.md | 28 +++++----- index.ts | 55 ++++++++++++++----- package.json | 4 +- test/python/echo_text_with_newline_control.py | 5 ++ test/test-python-shell.ts | 41 +++++++++----- 6 files changed, 88 insertions(+), 46 deletions(-) create mode 100644 test/python/echo_text_with_newline_control.py diff --git a/CHANGELOG.md b/CHANGELOG.md index da922de..731ebca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Changed - **BREAKING** Default python path changed back to `python` on Windows. [#237](https://github.com/extrabacon/python-shell/issues/237) - **BREAKING** `error` event renamed to `pythonError` event. [#118](https://github.com/extrabacon/python-shell/issues/118) +- **BREAKING** `receive` methods removed in favor of `splitter` arguments in the constructor. This lets the default splitting logic reside in a reuseable stream transformer. Now if you have extra pipes you can reuse `newlineTransformer` to split incoming data into newline-seperated lines. ### Added - `error` event that is fired upon failure to launch process, among other things. [#118](https://github.com/extrabacon/python-shell/issues/118) diff --git a/README.md b/README.md index a3f228d..e408cb5 100644 --- a/README.md +++ b/README.md @@ -161,17 +161,19 @@ Creates an instance of `PythonShell` and starts the Python process * `script`: the path of the script to execute * `options`: the execution options, consisting of: * `mode`: Configures how data is exchanged when data flows through stdin and stdout. The possible values are: - * `text`: each line of data (ending with "\n") is emitted as a message (default) - * `json`: each line of data (ending with "\n") is parsed as JSON and emitted as a message + * `text`: each line of data is emitted as a message (default) + * `json`: each line of data is parsed as JSON and emitted as a message * `binary`: data is streamed as-is through `stdout` and `stdin` - * `formatter`: each message to send is transformed using this method, then appended with "\n" - * `parser`: each line of data (ending with "\n") is parsed with this function and its result is emitted as a message - * `stderrParser`: each line of logs (ending with "\n") is parsed with this function and its result is emitted as a message + * `formatter`: each message to send is transformed using this method, then appended with a newline + * `parser`: each line of data is parsed with this function and its result is emitted as a message + * `stderrParser`: each line of logs is parsed with this function and its result is emitted as a message * `encoding`: the text encoding to apply on the child process streams (default: "utf8") * `pythonPath`: The path where to locate the "python" executable. Default: "python3" ("python" for Windows) * `pythonOptions`: Array of option switches to pass to "python" * `scriptPath`: The default path where to look for scripts. Default is the current working directory. * `args`: Array of arguments to pass to the script +* `stdoutSplitter`: splits stdout into chunks, defaulting to splitting into newline-seperated lines +* `stderrSplitter`: splits stderr into chunks, defaulting to splitting into newline-seperated lines Other options are forwarded to `child_process.spawn`. @@ -269,14 +271,6 @@ let shell = new PythonShell('script.py', { mode: 'json'}); shell.send({ command: "do_stuff", args: [1, 2, 3] }); ``` -#### `.receive(data)` - -Parses incoming data from the Python script written via stdout and emits `message` events. This method is called automatically as data is being received from stdout. - -#### `.receiveStderr(data)` - -Parses incoming logs from the Python script written via stderr and emits `stderr` events. This method is called automatically as data is being received from stderr. - #### `.end(callback)` Closes the stdin stream, allowing the Python script to finish and exit. The optional callback is invoked when the process is terminated. @@ -287,7 +281,7 @@ Terminates the python script. A kill signal may be provided by `signal`, if `sig #### event: `message` -Fires when a chunk of data is parsed from the stdout stream via the `receive` method. If a `parser` method is specified, the result of this function will be the message value. This event is not emitted in binary mode. +After the stdout stream is split into chunks by stdoutSplitter the chunks are parsed by the parser and a message event is emitted for each parsed chunk. This event is not emitted in binary mode. Example: @@ -307,7 +301,7 @@ shell.on('message', function (message) { #### event: `stderr` -Fires when a chunk of logs is parsed from the stderr stream via the `receiveStderr` method. If a `stderrParser` method is specified, the result of this function will be the message value. This event is not emitted in binary mode. +After the stderr stream is split into chunks by stderrSplitter the chunks are parsed by the parser and a message event is emitted for each parsed chunk. This event is not emitted in binary mode. Example: @@ -336,6 +330,10 @@ Fires when: If the process could not be spawned please double-check that python can be launched from the terminal. +### NewlineTransformer + +A utility class for splitting stream data into newlines. Used as the default for stdoutSplitter and stderrSplitter if they are unspecified. You can use this class for any extra python streams if you'd like. + ## Used By: Python-Shell is used by [arepl-vscode](https://github.com/almenon/arepl-vscode), [gitinspector](https://github.com/ejwa/gitinspector), [pyspreadsheet](https://github.com/extrabacon/pyspreadsheet), [AtlantOS Ocean Data QC](https://github.com/ocean-data-qc/ocean-data-qc) and more! diff --git a/index.ts b/index.ts index 4210528..1e5032d 100644 --- a/index.ts +++ b/index.ts @@ -2,10 +2,9 @@ import { EventEmitter } from 'events'; import { ChildProcess, spawn, SpawnOptions, exec, execSync } from 'child_process'; import { EOL as newline, tmpdir } from 'os'; import { join, sep } from 'path' -import { Readable, Writable } from 'stream' +import { Readable, Transform, TransformCallback, Writable } from 'stream' import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; -const LineTransformStream = require('line-transform-stream') function toArray(source?: T | T[]): T[] { if (typeof source === 'undefined' || source === null) { @@ -44,9 +43,9 @@ export interface Options extends SpawnOptions { * if binary is enabled message and stderr events will not be emitted */ mode?: 'text' | 'json' | 'binary' - formatter?: (param: string) => any - parser?: (param: string) => any - stderrParser?: (param: string) => any + formatter?: string | ((param: string) => any) + parser?: string | ((param: string) => any) + stderrParser?: string | ((param: string) => any) encoding?: string pythonPath?: string /** @@ -68,6 +67,28 @@ export class PythonShellError extends Error { exitCode?: number; } +/** + * Takes in a string stream and emits batches seperated by newlines + */ +export class NewlineTransformer extends Transform { + // NewlineTransformer: Megatron's little known once-removed cousin + private _lastLineData: string; + _transform(chunk: any, encoding: string, callback: TransformCallback){ + let data: string = chunk.toString() + if (this._lastLineData) data = this._lastLineData + data + const lines = data.split(newline) + this._lastLineData = lines.pop() + //@ts-ignore this works, node ignores the encoding if it's a number + lines.forEach(this.push.bind(this)) + callback() + } + _flush(done: TransformCallback){ + if (this._lastLineData) this.push(this._lastLineData) + this._lastLineData = null; + done() + } +} + /** * An interactive Python shell exchanging data through stdio * @param {string} script The python script to execute @@ -103,7 +124,7 @@ export class PythonShell extends EventEmitter { * @param scriptPath path to script. Relative to current directory or options.scriptFolder if specified * @param options */ - constructor(scriptPath: string, options?: Options) { + constructor(scriptPath: string, options?: Options, stdoutSplitter: Transform = null, stderrSplitter: Transform = null) { super(); /** @@ -151,16 +172,24 @@ export class PythonShell extends EventEmitter { // Node buffers stdout&stderr in batches regardless of newline placement // This is troublesome if you want to recieve distinct individual messages // for example JSON parsing breaks if it recieves partial JSON - // so we use LineTransformStream to emit each batch seperated by newline + // so we use newlineTransformer to emit each batch seperated by newline if (this.parser && this.stdout) { - this.stdout.pipe(new LineTransformStream((data) => { - this.emit('message', self.parser(data)); - })) + if(!stdoutSplitter) stdoutSplitter = new NewlineTransformer() + // note that setting the encoding turns the chunk into a string + stdoutSplitter.setEncoding(options.encoding || 'utf8') + this.stdout.pipe(stdoutSplitter).on('data', (chunk: string) => { + this.emit('message', self.parser(chunk)); + }); } + + // listen to stderr and emit errors for incoming data if (this.stderrParser && this.stderr) { - this.stderr.pipe(new LineTransformStream((data) => { - this.emit('stderr', self.stderrParser(data)); - })) + if(!stderrSplitter) stderrSplitter = new NewlineTransformer() + // note that setting the encoding turns the chunk into a string + stderrSplitter.setEncoding(options.encoding || 'utf8') + this.stderr.pipe(stderrSplitter).on('data', (chunk: string) => { + this.emit('stderr', self.stderrParser(chunk)); + }); } if (this.stderr) { diff --git a/package.json b/package.json index 21e1507..a8a30df 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,10 @@ "appveyorTest": "tsc -p ./ && nyc mocha --reporter mocha-appveyor-reporter test/*.js", "compile": "tsc -watch -p ./" }, - "dependencies": { - "line-transform-stream": "^0.1.0" - }, "devDependencies": { "@types/mocha": "^8.2.1", "@types/node": "^10.5.2", + "@types/should": "^13.0.0", "mocha": "^8.2.1", "mocha-appveyor-reporter": "^0.4.0", "should": "^13.2.1", diff --git a/test/python/echo_text_with_newline_control.py b/test/python/echo_text_with_newline_control.py new file mode 100644 index 0000000..0ce4fc2 --- /dev/null +++ b/test/python/echo_text_with_newline_control.py @@ -0,0 +1,5 @@ +import sys, json, os + +for line in sys.stdin: + line = line.replace('$', os.linesep) + print(line[:-1], end='') diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index b4c510d..5635f83 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -328,7 +328,7 @@ describe('PythonShell', function () { }); }); - describe('.receive(data)', function () { + describe('stdout', function () { it('should emit messages as strings when mode is "text"', function (done) { let pyshell = new PythonShell('echo_text.py', { mode: 'text' @@ -358,15 +358,16 @@ describe('PythonShell', function () { }).end(done); }); it('should properly buffer partial messages', function (done) { - let pyshell = new PythonShell('echo_text.py', { - mode: 'json' + // echo_text_with_newline_control echoes text with $'s replaced with newlines + let pyshell = new PythonShell('echo_text_with_newline_control.py', { + mode: 'text' }); pyshell.on('message', (message) => { console.log(message) - message.should.be.an.Object; - message.should.eql({ a: true }); - }).send('{"a"').send(':').send('true}' + newline + '{').send('"a":true}' + newline).end(() => { - console.log('done called') + let messageObject = JSON.parse(message) + messageObject.should.be.an.Object; + messageObject.should.eql({ a: true }); + }).send('{"a"').send(':').send('true}${').send('"a":true}$').end(() => { done() }); }); @@ -375,10 +376,10 @@ describe('PythonShell', function () { args: ['hello', 'world'], mode: 'binary' }); - pyshell.receive = function () { + pyshell.on('message', ()=>{ done('should not emit messages in binary mode'); return undefined - }; + }); pyshell.end(done); }); it('should use a custom parser function', function (done) { @@ -399,7 +400,7 @@ describe('PythonShell', function () { }); }); - describe('.receiveStderr(data)', function () { + describe('stderr', function () { it('should emit stderr logs as strings when mode is "text"', function (done) { let pyshell = new PythonShell('stderrLogging.py', { mode: 'text' @@ -415,13 +416,14 @@ describe('PythonShell', function () { }); it('should not be invoked when mode is "binary"', function (done) { let pyshell = new PythonShell('stderrLogging.py', { - mode: 'binary' + stderrParser: 'binary' }); - pyshell.receiveStderr = function () { + pyshell.on('stderr', ()=>{ done('should not emit stderr in binary mode'); - return undefined - }; - pyshell.end(done); + }); + pyshell.end(()=>{ + done() + }); }); it('should use a custom parser function', function (done) { let pyshell = new PythonShell('stderrLogging.py', { @@ -501,6 +503,15 @@ describe('PythonShell', function () { done(); }); }); + it('should work in json mode', function (done) { + let pyshell = new PythonShell('error.py', {mode: 'json'}); + pyshell.on('pythonError', function (err) { + err.stack.should.containEql('----- Python Traceback -----'); + err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 4'); + err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 6'); + done(); + }); + }); }); describe('.terminate()', function () { From 0ab46240f1076c371e4a914d7c7fdca3e187f203 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 27 Mar 2021 13:12:31 -0700 Subject: [PATCH 070/111] add comment --- index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.ts b/index.ts index 1e5032d..44209e6 100644 --- a/index.ts +++ b/index.ts @@ -93,6 +93,8 @@ export class NewlineTransformer extends Transform { * An interactive Python shell exchanging data through stdio * @param {string} script The python script to execute * @param {object} [options] The launch options (also passed to child_process.spawn) + * @param [stdoutSplitter] Optional. Splits stdout into chunks, defaulting to splitting into newline-seperated lines + * @param [stderrSplitter] Optional. splits stderr into chunks, defaulting to splitting into newline-seperated lines * @constructor */ export class PythonShell extends EventEmitter { @@ -123,6 +125,8 @@ export class PythonShell extends EventEmitter { * spawns a python process * @param scriptPath path to script. Relative to current directory or options.scriptFolder if specified * @param options + * @param stdoutSplitter Optional. Splits stdout into chunks, defaulting to splitting into newline-seperated lines + * @param stderrSplitter Optional. splits stderr into chunks, defaulting to splitting into newline-seperated lines */ constructor(scriptPath: string, options?: Options, stdoutSplitter: Transform = null, stderrSplitter: Transform = null) { super(); From a5af708ca5d5dab97dabeefa82647931a4d5e45b Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 27 Mar 2021 14:47:02 -0700 Subject: [PATCH 071/111] small change for incresed code coverage --- test/test-python-shell.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 5635f83..3016eb2 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -257,7 +257,10 @@ describe('PythonShell', function () { // * inherit - inherit fd from parent process; // * process.stderr - pass output directly to that stream. stdio: ['ignore', 'inherit', process.stderr], - args: ["0"] + // @ts-expect-error python-shell technically allows a non-array arg, + // although the user shouldn't be doing this. We are just testing for + // increased code coverage + args: "0" }, done); should(pyshell.stdin).be.eql(null); @@ -376,7 +379,7 @@ describe('PythonShell', function () { args: ['hello', 'world'], mode: 'binary' }); - pyshell.on('message', ()=>{ + pyshell.on('message', () => { done('should not emit messages in binary mode'); return undefined }); @@ -418,10 +421,10 @@ describe('PythonShell', function () { let pyshell = new PythonShell('stderrLogging.py', { stderrParser: 'binary' }); - pyshell.on('stderr', ()=>{ + pyshell.on('stderr', () => { done('should not emit stderr in binary mode'); }); - pyshell.end(()=>{ + pyshell.end(() => { done() }); }); @@ -504,7 +507,7 @@ describe('PythonShell', function () { }); }); it('should work in json mode', function (done) { - let pyshell = new PythonShell('error.py', {mode: 'json'}); + let pyshell = new PythonShell('error.py', { mode: 'json' }); pyshell.on('pythonError', function (err) { err.stack.should.containEql('----- Python Traceback -----'); err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 4'); From 5b6c3165136bfb320615dd2e8c12fcceceeb3164 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 27 Mar 2021 16:02:43 -0700 Subject: [PATCH 072/111] add example of NewlineTransformer [skip ci] --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e408cb5..be2fba1 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,27 @@ If the process could not be spawned please double-check that python can be launc ### NewlineTransformer -A utility class for splitting stream data into newlines. Used as the default for stdoutSplitter and stderrSplitter if they are unspecified. You can use this class for any extra python streams if you'd like. +A utility class for splitting stream data into newlines. Used as the default for stdoutSplitter and stderrSplitter if they are unspecified. You can use this class for any extra python streams if you'd like. For example: + +```python +# foo.py +print('hello world', file=open(3, "w")) +``` + +```typescript +import { PythonShell, NewlineTransformer, Options } from 'python-shell' + +const options: Options = { + 'stdio': + ['pipe', 'pipe', 'pipe', 'pipe'] // stdin, stdout, stderr, custom +} +const pyshell = new PythonShell('foo.py', options) + +const customPipe = pyshell.childProcess.stdio[3] +customPipe.pipe(new NewlineTransformer()).on('data', (customResult: Buffer) => { + console.log(customResult.toString()) +}) +``` ## Used By: From 7de125820ade9f7666b889b16e2142e249787e7e Mon Sep 17 00:00:00 2001 From: luke-waymark-sage <90733585+luke-waymark-sage@users.noreply.github.com> Date: Tue, 5 Oct 2021 08:47:23 +1030 Subject: [PATCH 073/111] Use kill signal's returned value --- index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 44209e6..6c4610b 100644 --- a/index.ts +++ b/index.ts @@ -407,8 +407,7 @@ export class PythonShell extends EventEmitter { * @returns {PythonShell} The same instance for chaining calls */ kill(signal?: NodeJS.Signals) { - this.childProcess.kill(signal); - this.terminated = true; + this.terminated = this.childProcess.kill(signal); return this; }; From 042de94ebe8fd3f601743ce2c26951167f4301f4 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 9 Oct 2021 11:06:38 -0700 Subject: [PATCH 074/111] fix(tests): stop using deprecated method --- test/test-python-shell.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 3016eb2..1ed1f40 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -534,13 +534,13 @@ describe('PythonShell', function () { pyshell.terminated.should.be.true done(); }); - it('terminate with correct kill signal', function (done) { + it('kill with correct signal', function (done) { let pyshell = new PythonShell('infinite_loop.py'); let endCalled = false; pyshell.end(() => { endCalled = true; }) - pyshell.terminate('SIGKILL'); + pyshell.kill('SIGKILL'); pyshell.terminated.should.be.true; setTimeout(() => { pyshell.exitSignal.should.be.exactly('SIGKILL'); }, 500); done(); From f6e464f13ee3d32fc19f95264516533cd3998281 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 9 Oct 2021 11:12:54 -0700 Subject: [PATCH 075/111] Upgrade typescript --- package-lock.json | 1726 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 1718 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a732f1..8b88ba7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,1712 @@ { "name": "python-shell", "version": "3.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "3.0.0", + "license": "MIT", + "devDependencies": { + "@types/mocha": "^8.2.1", + "@types/node": "^10.5.2", + "@types/should": "^13.0.0", + "mocha": "^8.2.1", + "mocha-appveyor-reporter": "^0.4.0", + "should": "^13.2.1", + "ts-node": "^9.0.0", + "typescript": "^4.4.3" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@types/mocha": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", + "integrity": "sha512-NysN+bNqj6E0Hv4CTGWSlPzMW6vTKjDpOteycDkV4IWBsO+PU48JonrPzV9ODjiI2XrjmA05KInLgF5ivZ/YGQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "10.17.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.21.tgz", + "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", + "dev": true + }, + "node_modules/@types/should": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@types/should/-/should-13.0.0.tgz", + "integrity": "sha512-Mi6YZ2ABnnGGFMuiBDP0a8s1ZDCDNHqP97UH8TyDmCWuGGavpsFMfJnAMYaaqmDlSCOCNbVLHBrSDEOpx/oLhw==", + "deprecated": "This is a stub types definition for should.js (https://github.com/shouldjs/should.js). should.js provides its own type definitions, so you don't need @types/should installed!", + "dev": true, + "dependencies": { + "should": "*" + } + }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "node_modules/ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "dependencies": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "optional": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "dev": true, + "dependencies": { + "hoek": "4.x.x" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", + "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.5.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.1" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "dev": true, + "dependencies": { + "boom": "5.x.x" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/cryptiles/node_modules/boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "dev": true, + "dependencies": { + "hoek": "4.x.x" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "optional": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "engines": { + "node": ">=4.x" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "dependencies": { + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "dev": true, + "dependencies": { + "boom": "4.x.x", + "cryptiles": "3.x.x", + "hoek": "4.x.x", + "sntp": "2.x.x" + }, + "engines": { + "node": ">=4.5.0" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, + "node_modules/hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "node_modules/json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "node_modules/jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/mime-db": { + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", + "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "dev": true, + "dependencies": { + "mime-db": "~1.36.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mocha": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", + "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "dev": true, + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/mocha-appveyor-reporter": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.0.tgz", + "integrity": "sha1-gpOC/8Bla2Z+e+ZQoJSgba69Uk8=", + "dev": true, + "dependencies": { + "request-json": "^0.6.1" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.1.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", + "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", + "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "hawk": "~6.0.2", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "stringstream": "~0.0.5", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/request-json": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.3.tgz", + "integrity": "sha512-5TVnMD3LaeK0GRCyFlsNgJf5Fjg8J8j7VEfsoJESSWZlWRgPIf7IojsBLbTHcg2798JrrRkJ6L3k1+wj4sglgw==", + "dev": true, + "dependencies": { + "depd": "1.1.2", + "request": "2.83.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/serialize-javascript": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/should": { + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", + "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", + "dev": true, + "dependencies": { + "should-equal": "^2.0.0", + "should-format": "^3.0.3", + "should-type": "^1.4.0", + "should-type-adaptors": "^1.0.1", + "should-util": "^1.0.0" + } + }, + "node_modules/should-equal": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", + "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", + "dev": true, + "dependencies": { + "should-type": "^1.4.0" + } + }, + "node_modules/should-format": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", + "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", + "dev": true, + "dependencies": { + "should-type": "^1.3.0", + "should-type-adaptors": "^1.0.1" + } + }, + "node_modules/should-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", + "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", + "dev": true + }, + "node_modules/should-type-adaptors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", + "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", + "dev": true, + "dependencies": { + "should-type": "^1.3.0", + "should-util": "^1.0.0" + } + }, + "node_modules/should-util": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.1.tgz", + "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", + "dev": true + }, + "node_modules/sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "dev": true, + "dependencies": { + "hoek": "4.x.x" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "dashdash": "^1.12.0", + "getpass": "^0.1.1", + "safer-buffer": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + }, + "optionalDependencies": { + "bcrypt-pbkdf": "^1.0.0", + "ecc-jsbn": "~0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" + } + }, + "node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/stringstream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", + "dev": true + }, + "node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "dev": true, + "dependencies": { + "punycode": "^1.4.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ts-node": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "dev": true, + "dependencies": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "node_modules/typescript": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "node_modules/workerpool": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", + "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", + "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + } + } + }, "dependencies": { "@types/mocha": { "version": "8.2.1", @@ -16,6 +1720,15 @@ "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", "dev": true }, + "@types/should": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@types/should/-/should-13.0.0.tgz", + "integrity": "sha512-Mi6YZ2ABnnGGFMuiBDP0a8s1ZDCDNHqP97UH8TyDmCWuGGavpsFMfJnAMYaaqmDlSCOCNbVLHBrSDEOpx/oLhw==", + "dev": true, + "requires": { + "should": "*" + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -709,11 +2422,6 @@ "verror": "1.10.0" } }, - "line-transform-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/line-transform-stream/-/line-transform-stream-0.1.0.tgz", - "integrity": "sha1-Hvhnmsy/cbBkREwroTsheFs+vXg=" - }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -1168,9 +2876,9 @@ "optional": true }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true }, "uuid": { diff --git a/package.json b/package.json index a8a30df..3b96fb5 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "mocha-appveyor-reporter": "^0.4.0", "should": "^13.2.1", "ts-node": "^9.0.0", - "typescript": "^3.8.3" + "typescript": "^4.4.3" }, "files": [ "*.d.ts", From e6bcaee3c97755056a5dd7b20961e5f4e2dc39d1 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 9 Oct 2021 12:21:39 -0700 Subject: [PATCH 076/111] improve tests --- test/test-python-shell.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 1ed1f40..8278c21 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -517,33 +517,29 @@ describe('PythonShell', function () { }); }); - describe('.terminate()', function () { - it('set terminated to true', function (done) { + describe('.kill()', function () { + it('set terminated to correct value', function (done) { let pyshell = new PythonShell('infinite_loop.py'); - pyshell.terminate(); + pyshell.kill(); pyshell.terminated.should.be.true done(); }); it('run the end callback if specified', function (done) { let pyshell = new PythonShell('infinite_loop.py'); - let endCalled = false; pyshell.end(() => { - endCalled = true; + done(); }) - pyshell.terminate(); - pyshell.terminated.should.be.true - done(); + pyshell.kill(); }); it('kill with correct signal', function (done) { let pyshell = new PythonShell('infinite_loop.py'); - let endCalled = false; - pyshell.end(() => { - endCalled = true; - }) + pyshell.terminated.should.be.false; pyshell.kill('SIGKILL'); pyshell.terminated.should.be.true; - setTimeout(() => { pyshell.exitSignal.should.be.exactly('SIGKILL'); }, 500); - done(); + setTimeout(() => { + pyshell.exitSignal.should.be.exactly('SIGKILL'); + done(); + }, 500); }); }); }); From c129cb96a0cb75ffb1bbcb2db0c9c417067e557a Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 9 Oct 2021 12:30:29 -0700 Subject: [PATCH 077/111] update supported software --- appveyor.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5ea5534..dde25a4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,11 +10,15 @@ image: environment: matrix: - - nodejs_version: "10" - PYTHON: "C:\\Python36-x64" - nodejs_version: "12" - PYTHON: "C:\\Python36-x64" + PYTHON: "C:\\Python37-x64" + + - nodejs_version: "14" + PYTHON: "C:\\Python37-x64" + + - nodejs_version: "16" + PYTHON: "C:\\Python37-x64" install: - cmd: powershell Install-Product node $env:nodejs_version From 975de8ad02543900310120a8c215e2b56cfb3cf2 Mon Sep 17 00:00:00 2001 From: almenon Date: Sat, 9 Oct 2021 12:37:47 -0700 Subject: [PATCH 078/111] upgrade types --- index.ts | 2 +- package-lock.json | 17 +++++++++-------- package.json | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/index.ts b/index.ts index 44209e6..8ef86ec 100644 --- a/index.ts +++ b/index.ts @@ -46,7 +46,7 @@ export interface Options extends SpawnOptions { formatter?: string | ((param: string) => any) parser?: string | ((param: string) => any) stderrParser?: string | ((param: string) => any) - encoding?: string + encoding?: BufferEncoding pythonPath?: string /** * see https://docs.python.org/3.7/using/cmdline.html diff --git a/package-lock.json b/package-lock.json index 8b88ba7..eeae64c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "license": "MIT", "devDependencies": { "@types/mocha": "^8.2.1", - "@types/node": "^10.5.2", + "@types/node": "^14.17.21", "@types/should": "^13.0.0", "mocha": "^8.2.1", "mocha-appveyor-reporter": "^0.4.0", @@ -28,10 +28,11 @@ "dev": true }, "node_modules/@types/node": { - "version": "10.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.21.tgz", - "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", - "dev": true + "version": "14.17.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", + "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", + "dev": true, + "license": "MIT" }, "node_modules/@types/should": { "version": "13.0.0", @@ -1715,9 +1716,9 @@ "dev": true }, "@types/node": { - "version": "10.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.21.tgz", - "integrity": "sha512-PQKsydPxYxF1DsAFWmunaxd3sOi3iMt6Zmx/tgaagHYmwJ/9cRH91hQkeJZaUGWbvn0K5HlSVEXkn5U/llWPpQ==", + "version": "14.17.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", + "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", "dev": true }, "@types/should": { diff --git a/package.json b/package.json index 3b96fb5..36e9f87 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "@types/mocha": "^8.2.1", - "@types/node": "^10.5.2", + "@types/node": "^14.17.21", "@types/should": "^13.0.0", "mocha": "^8.2.1", "mocha-appveyor-reporter": "^0.4.0", From 502bb3d81152ef9a16fb618f71f9e9fc43777349 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sat, 9 Oct 2021 13:06:46 -0700 Subject: [PATCH 079/111] feat(changelog): add 3.0.1 notes [skip ci] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 731ebca..06a8ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.0.1] - 2021-10-09 +### Fixed +- Previously when you called the kill method the terminated attribute was always set to true, regardless of whether the process was actually killed. Now the terminated boolean is set to true if kill succeeds, false otherwise. [#255](https://github.com/extrabacon/python-shell/issues/255) + ## [3.0.0] - 2021-03-07 ### Changed - **BREAKING** Default python path changed back to `python` on Windows. [#237](https://github.com/extrabacon/python-shell/issues/237) From 17d494222f4ead5b11f3c927ee817c6f6eeebd78 Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Tue, 31 May 2022 22:34:13 +0300 Subject: [PATCH 080/111] feat: promisify the "run" command --- index.ts | 15 ++++++++++----- test/test-python-shell.ts | 9 +++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/index.ts b/index.ts index b00307c..5a60680 100644 --- a/index.ts +++ b/index.ts @@ -310,19 +310,24 @@ export class PythonShell extends EventEmitter { * @param {string} scriptPath The path to the script to execute * @param {Options} options The execution options * @param {Function} callback The callback function to invoke with the script results - * @return {PythonShell} The PythonShell instance + * @return {Promise} the output from the python script */ static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { let pyshell = new PythonShell(scriptPath, options); let output = []; - return pyshell.on('message', function (message) { - output.push(message); - }).end(function (err) { - return callback(err ? err : null, output.length ? output : null); + return new Promise((resolve, reject) => { + return pyshell.on('message', function (message) { + output.push(message); + }).end(function (err) { + if(err) reject(err); + else resolve(output); + return callback(err ? err : null, output.length ? output : null); + }); }); }; + /** * Runs the inputted string of python code and returns collected messages. DO NOT ALLOW UNTRUSTED USER INPUT HERE! * @param {string} code The python code to execute diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 8278c21..09eb050 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -250,8 +250,8 @@ describe('PythonShell', function () { }; }) - it('should run PythonShell normally without access to std streams', function (done) { - var pyshell = PythonShell.run('exit-code.py', { + it('should run PythonShell normally without access to std streams', async function (done) { + var pyshell = await PythonShell.run('exit-code.py', { // 3 different ways of assigning values to the std streams in child_process.spawn() // * ignore - pipe to /dev/null // * inherit - inherit fd from parent process; @@ -263,10 +263,7 @@ describe('PythonShell', function () { args: "0" }, done); - should(pyshell.stdin).be.eql(null); - should(pyshell.stdout).be.eql(null); - should(pyshell.stderr).be.eql(null); - should.throws(() => { pyshell.send("asd") }); + should(pyshell).be.eql([]); }); }); From 79e66216d2cb9d485c0b2cbe37cb5d5e6a0e1ba0 Mon Sep 17 00:00:00 2001 From: Almenon Date: Mon, 26 Sep 2022 22:14:33 -0700 Subject: [PATCH 081/111] Test new Node version I also removed a node version that is no longer supported --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index dde25a4..861ca68 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,14 +11,14 @@ image: environment: matrix: - - nodejs_version: "12" - PYTHON: "C:\\Python37-x64" - - nodejs_version: "14" PYTHON: "C:\\Python37-x64" - nodejs_version: "16" PYTHON: "C:\\Python37-x64" + + - nodejs_version: "18" + PYTHON: "C:\\Python37-x64" install: - cmd: powershell Install-Product node $env:nodejs_version From c121879ff2f022d9e3f2d612d209b1285368bfce Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Thu, 13 Oct 2022 16:39:35 +0300 Subject: [PATCH 082/111] feat: support both callbacks and promises --- index.ts | 43 ++++++++++++++++++++++++++++----------- package-lock.json | 1 + test/test-python-shell.ts | 5 +++-- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/index.ts b/index.ts index 5a60680..634232b 100644 --- a/index.ts +++ b/index.ts @@ -309,25 +309,44 @@ export class PythonShell extends EventEmitter { * Runs a Python script and returns collected messages * @param {string} scriptPath The path to the script to execute * @param {Options} options The execution options - * @param {Function} callback The callback function to invoke with the script results - * @return {Promise} the output from the python script + * @param {Function} (deprecated argument) callback The callback function to invoke with the script results + * @return {Promise | PythonShell} the output from the python script */ - static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { + static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { + + if(callback) { + console.warn('PythonShell.run() callback is deprecated. Use PythonShell.run() promise instead.') + + return this.runLegacy(scriptPath, options, callback); + } + else { + return new Promise((resolve, reject) => { + let pyshell = new PythonShell(scriptPath, options); + let output = []; + + pyshell.on('message', function (message) { + output.push(message); + }).end(function (err) { + if(err) reject(err); + else resolve(output); + }); + }); + } + }; + + private static runLegacy(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { let pyshell = new PythonShell(scriptPath, options); let output = []; - return new Promise((resolve, reject) => { - return pyshell.on('message', function (message) { - output.push(message); - }).end(function (err) { - if(err) reject(err); - else resolve(output); - return callback(err ? err : null, output.length ? output : null); - }); + return pyshell.on('message', function (message) { + output.push(message); + }).end(function (err) { + return callback(err ? err : null, output.length ? output : null); }); }; + /** * Runs the inputted string of python code and returns collected messages. DO NOT ALLOW UNTRUSTED USER INPUT HERE! * @param {string} code The python code to execute @@ -335,7 +354,7 @@ export class PythonShell extends EventEmitter { * @param {Function} callback The callback function to invoke with the script results * @return {PythonShell} The PythonShell instance */ - static runString(code: string, options?: Options, callback?: (err: PythonShellError, output?: any[]) => any) { + static runString(code: string, options?: Options, callback?: (err: PythonShellError, output?: any[]) => any) { // put code in temp file const randomInt = getRandomInt(); diff --git a/package-lock.json b/package-lock.json index eeae64c..0528940 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "python-shell", "version": "3.0.0", "license": "MIT", "devDependencies": { diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 09eb050..f371d80 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -250,7 +250,7 @@ describe('PythonShell', function () { }; }) - it('should run PythonShell normally without access to std streams', async function (done) { + it('should run PythonShell normally without access to std streams', async function () { var pyshell = await PythonShell.run('exit-code.py', { // 3 different ways of assigning values to the std streams in child_process.spawn() // * ignore - pipe to /dev/null @@ -261,9 +261,10 @@ describe('PythonShell', function () { // although the user shouldn't be doing this. We are just testing for // increased code coverage args: "0" - }, done); + }); should(pyshell).be.eql([]); + }); }); From f89cb95d94732b2b52429ac44e77515fa351ac3f Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Thu, 13 Oct 2022 16:47:20 +0300 Subject: [PATCH 083/111] test: test the promise based mechanism --- test/test-python-shell.ts | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index f371d80..5d6c3e5 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -117,7 +117,7 @@ describe('PythonShell', function () { before(() => { PythonShell.defaultOptions = {}; }) - it('should be able to execute a string of python code', function (done) { + it('should be able to execute a string of python code using callbacks', function (done) { PythonShell.runString('print("hello");print("world")', null, function (err, results) { if (err) return done(err); results.should.be.an.Array().and.have.lengthOf(2); @@ -125,6 +125,11 @@ describe('PythonShell', function () { done(); }); }); + it('should be able to execute a string of python code using promises', async function () { + let results = await PythonShell.runString('print("hello");print("world")'); + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + }); after(() => { PythonShell.defaultOptions = { // reset to match initial value @@ -134,7 +139,7 @@ describe('PythonShell', function () { }); describe('#run(script, options)', function () { - it('should run the script and return output data', function (done) { + it('should run the script and return output data using callbacks', function (done) { PythonShell.run('echo_args.py', { args: ['hello', 'world'] }, function (err, results) { @@ -144,6 +149,13 @@ describe('PythonShell', function () { done(); }); }); + it('should run the script and return output data using promise', async function () { + let results = await PythonShell.run('echo_args.py', { + args: ['hello', 'world'] + }); + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + }); it('should try to run the script and fail appropriately', function (done) { PythonShell.run('unknown_script.py', null, function (err, results) { err.should.be.an.Error; @@ -151,6 +163,15 @@ describe('PythonShell', function () { done(); }); }); + it('should try to run the script and fail appropriately', async function () { + try { + let results = await PythonShell.run('unknown_script.py'); + throw new Error(`should not get here because the script should fail` + results); + } catch (err) { + err.should.be.an.Error; + err.exitCode.should.be.exactly(2); + } + }); it('should include both output and error', function (done) { PythonShell.run('echo_hi_then_error.py', null, function (err, results) { err.should.be.an.Error; From 21571c650135de735db0649fdcdfa385e6dd5c22 Mon Sep 17 00:00:00 2001 From: Noam Gaash Date: Thu, 13 Oct 2022 16:53:29 +0300 Subject: [PATCH 084/111] test: verify backward compatability --- test/test-python-shell.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 5d6c3e5..947e287 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -118,12 +118,14 @@ describe('PythonShell', function () { PythonShell.defaultOptions = {}; }) it('should be able to execute a string of python code using callbacks', function (done) { - PythonShell.runString('print("hello");print("world")', null, function (err, results) { + let pythonshell = PythonShell.runString('print("hello");print("world")', null, function (err, results) { if (err) return done(err); results.should.be.an.Array().and.have.lengthOf(2); results.should.eql(['hello', 'world']); done(); }); + + pythonshell.should.be.an.instanceOf(PythonShell); }); it('should be able to execute a string of python code using promises', async function () { let results = await PythonShell.runString('print("hello");print("world")'); From 30055ad7609bca4b22f81245dd996a5dd17a136b Mon Sep 17 00:00:00 2001 From: Almenon Date: Fri, 18 Nov 2022 13:59:33 -0800 Subject: [PATCH 085/111] check node version --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 861ca68..b18f818 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,6 +23,7 @@ environment: install: - cmd: powershell Install-Product node $env:nodejs_version - sh: nvm install $nodejs_version + - node --version - npm install - npm install codecov -g - npm install nyc -g From 452db07f96f2db2ae235584e68d65ec4440c3f8c Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 15 Jan 2023 16:16:14 -0800 Subject: [PATCH 086/111] Upgrade ubuntu needed to run node v18 - https://www.appveyor.com/docs/linux-images-software/ https://help.appveyor.com/discussions/problems/33559-please-add-node-v18-x86-version-to-the-windows-build-vms --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b18f818..d59efae 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ branches: image: - Visual Studio 2017 -- Ubuntu +- Ubuntu2004 environment: matrix: From 3fd0fa98b784c0a23ca283fd41904f9ed31fd5bb Mon Sep 17 00:00:00 2001 From: Almenon Date: Fri, 10 Feb 2023 20:57:05 -0800 Subject: [PATCH 087/111] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06a8ffe..295a6ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [4.0.0] - 2023-02-10 +### Changed +- run and runString now return a promise instead of a using a callback. +- This is somewhat backwards compatible with previous behavior + ## [3.0.1] - 2021-10-09 ### Fixed - Previously when you called the kill method the terminated attribute was always set to true, regardless of whether the process was actually killed. Now the terminated boolean is set to true if kill succeeds, false otherwise. [#255](https://github.com/extrabacon/python-shell/issues/255) From 56f8d1fe395ca044c1c935c11d96a2cb8d7166d7 Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 21:05:49 -0800 Subject: [PATCH 088/111] 4.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0528940..14981de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "python-shell", - "version": "3.0.0", + "version": "4.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "python-shell", - "version": "3.0.0", + "version": "4.0.0", "license": "MIT", "devDependencies": { "@types/mocha": "^8.2.1", diff --git a/package.json b/package.json index 36e9f87..ede5a33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "3.0.0", + "version": "4.0.0", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From bea01afdad6cbdfd783aac5feb54aa2637150e38 Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 20:42:10 -0800 Subject: [PATCH 089/111] remove callbacks --- CHANGELOG.md | 9 ++++++ README.md | 28 ++++++---------- index.ts | 68 ++++++++++++++++----------------------- test/test-python-shell.ts | 53 +++++++++++++++--------------- 4 files changed, 73 insertions(+), 85 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 295a6ea..d19321e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [5.0.0] - 2023-02-10 +### BREAKING CHANGES +- run and runString now return a promise instead of a using a callback. +- You will need to 1) check the return value, 2) remove the callback argument, and 3) change to a promise +- see readme for usage examples + +### Other notes +- I confirmed that python-shell works with python 3.11 and node v18. + ## [4.0.0] - 2023-02-10 ### Changed - run and runString now return a promise instead of a using a callback. diff --git a/README.md b/README.md index be2fba1..e4d06cf 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,7 @@ npm install python-shell ```typescript import {PythonShell} from 'python-shell'; -PythonShell.runString('x=1+1;print(x)', null, function (err) { - if (err) throw err; +PythonShell.runString('x=1+1;print(x)', null).then(messages=>{ console.log('finished'); }); ``` @@ -47,8 +46,7 @@ let {PythonShell} = require('python-shell') ```typescript import {PythonShell} from 'python-shell'; -PythonShell.run('my_script.py', null, function (err) { - if (err) throw err; +PythonShell.run('my_script.py', null).then(messages=>{ console.log('finished'); }); ``` @@ -68,8 +66,7 @@ let options = { args: ['value1', 'value2', 'value3'] }; -PythonShell.run('my_script.py', options, function (err, results) { - if (err) throw err; +PythonShell.run('my_script.py', options).then(messages=>{ // results is an array consisting of messages collected during execution console.log('results: %j', results); }); @@ -91,7 +88,6 @@ pyshell.on('message', function (message) { // end the input stream and allow the process to exit pyshell.end(function (err,code,signal) { - if (err) throw err; console.log('The exit code was: ' + code); console.log('The exit signal was: ' + signal); console.log('finished'); @@ -205,32 +201,28 @@ Example: PythonShell.defaultOptions = { scriptPath: '../scripts' }; ``` -#### `#run(script, options, callback)` +#### `#run(script, options)` -Runs the Python script and invokes `callback` with the results. The callback contains the execution error (if any) as well as an array of messages emitted from the Python script. - -This method is also returning the `PythonShell` instance. +Runs the Python script and returns a promise. When you handle the promise the argument will be an array of messages emitted from the Python script. Example: ```typescript // run a simple script -PythonShell.run('script.py', null, function (err, results) { +PythonShell.run('script.py', null).then(results => { // script finished }); ``` #### `#runString(code, options, callback)` -Runs the Python code and invokes `callback` with the results. The callback contains the execution error (if any) as well as an array of messages emitted from the Python script. - -This method is also returning the `PythonShell` instance. +Runs the Python script and returns a promise. When you handle the promise the argument will be an array of messages emitted from the Python script. Example: ```typescript -// run a simple script -PythonShell.runString('x=1;print(x)', null, function (err, results) { +// run some simple code +PythonShell.runString('x=1;print(x)', null).then(messages=>{ // script finished }); ``` @@ -247,7 +239,7 @@ Promise is rejected if there is a syntax error. #### `#getVersion(pythonPath?:string)` -Returns the python version. Optional pythonPath param to get the version +Returns the python version as a promise. Optional pythonPath param to get the version of a specific python interpreter. #### `#getVersionSync(pythonPath?:string)` diff --git a/index.ts b/index.ts index 634232b..27fd62c 100644 --- a/index.ts +++ b/index.ts @@ -67,6 +67,10 @@ export class PythonShellError extends Error { exitCode?: number; } +export class PythonShellErrorWithLogs extends PythonShellError { + logs: any[] +} + /** * Takes in a string stream and emits batches seperated by newlines */ @@ -306,62 +310,44 @@ export class PythonShell extends EventEmitter { } /** - * Runs a Python script and returns collected messages - * @param {string} scriptPath The path to the script to execute - * @param {Options} options The execution options - * @param {Function} (deprecated argument) callback The callback function to invoke with the script results - * @return {Promise | PythonShell} the output from the python script + * Runs a Python script and returns collected messages as a promise + * @param scriptPath The path to the script to execute + * @param options The execution options + * @return a promise with the output from the python script */ - static run(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { - - if(callback) { - console.warn('PythonShell.run() callback is deprecated. Use PythonShell.run() promise instead.') - - return this.runLegacy(scriptPath, options, callback); - } - else { - return new Promise((resolve, reject) => { - let pyshell = new PythonShell(scriptPath, options); - let output = []; - - pyshell.on('message', function (message) { - output.push(message); - }).end(function (err) { - if(err) reject(err); - else resolve(output); - }); + static run(scriptPath: string, options?: Options) { + return new Promise((resolve, reject) => { + let pyshell = new PythonShell(scriptPath, options); + let output = []; + + pyshell.on('message', function (message) { + output.push(message); + }).end(function (err) { + if(err){ + (err as PythonShellErrorWithLogs).logs = output + reject(err); + } + else resolve(output); }); - } - }; - - private static runLegacy(scriptPath: string, options?: Options, callback?: (err?: PythonShellError, output?: any[]) => any) { - let pyshell = new PythonShell(scriptPath, options); - let output = []; - - return pyshell.on('message', function (message) { - output.push(message); - }).end(function (err) { - return callback(err ? err : null, output.length ? output : null); }); }; /** - * Runs the inputted string of python code and returns collected messages. DO NOT ALLOW UNTRUSTED USER INPUT HERE! - * @param {string} code The python code to execute - * @param {Options} options The execution options - * @param {Function} callback The callback function to invoke with the script results - * @return {PythonShell} The PythonShell instance + * Runs the inputted string of python code and returns collected messages as a promise. DO NOT ALLOW UNTRUSTED USER INPUT HERE! + * @param code The python code to execute + * @param options The execution options + * @return a promise with the output from the python script */ - static runString(code: string, options?: Options, callback?: (err: PythonShellError, output?: any[]) => any) { + static runString(code: string, options?: Options) { // put code in temp file const randomInt = getRandomInt(); const filePath = tmpdir + sep + `pythonShellFile${randomInt}.py` writeFileSync(filePath, code); - return PythonShell.run(filePath, options, callback); + return PythonShell.run(filePath, options); }; static getVersion(pythonPath?: string) { diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 947e287..309fe58 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -117,9 +117,8 @@ describe('PythonShell', function () { before(() => { PythonShell.defaultOptions = {}; }) - it('should be able to execute a string of python code using callbacks', function (done) { - let pythonshell = PythonShell.runString('print("hello");print("world")', null, function (err, results) { - if (err) return done(err); + it('should be able to execute a string of python code', function (done) { + PythonShell.runString('print("hello");print("world")', null).then((results) => { results.should.be.an.Array().and.have.lengthOf(2); results.should.eql(['hello', 'world']); done(); @@ -132,6 +131,11 @@ describe('PythonShell', function () { results.should.be.an.Array().and.have.lengthOf(2); results.should.eql(['hello', 'world']); }); + it('should be able to execute a string of python code async', async function () { + let results = await PythonShell.runString('print("hello");print("world")'); + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + }); after(() => { PythonShell.defaultOptions = { // reset to match initial value @@ -144,14 +148,13 @@ describe('PythonShell', function () { it('should run the script and return output data using callbacks', function (done) { PythonShell.run('echo_args.py', { args: ['hello', 'world'] - }, function (err, results) { - if (err) return done(err); + }).then((results) => { results.should.be.an.Array().and.have.lengthOf(2); results.should.eql(['hello', 'world']); done(); }); }); - it('should run the script and return output data using promise', async function () { + it('should run the script and return output data async', async function () { let results = await PythonShell.run('echo_args.py', { args: ['hello', 'world'] }); @@ -159,13 +162,13 @@ describe('PythonShell', function () { results.should.eql(['hello', 'world']); }); it('should try to run the script and fail appropriately', function (done) { - PythonShell.run('unknown_script.py', null, function (err, results) { + PythonShell.run('unknown_script.py', null).catch((err) => { err.should.be.an.Error; err.exitCode.should.be.exactly(2); done(); }); }); - it('should try to run the script and fail appropriately', async function () { + it('should try to run the script and fail appropriately - async', async function () { try { let results = await PythonShell.run('unknown_script.py'); throw new Error(`should not get here because the script should fail` + results); @@ -175,14 +178,16 @@ describe('PythonShell', function () { } }); it('should include both output and error', function (done) { - PythonShell.run('echo_hi_then_error.py', null, function (err, results) { - err.should.be.an.Error; - results.should.eql(['hi']) - done(); + PythonShell.run('echo_hi_then_error.py', null).then((results) => { + done("Error: This promise should never successfully resolve"); + }).catch((err)=>{ + err.logs.should.eql(['hi']) + err.should.be.an.Error + done() }); }); it('should run the script and fail with an extended stack trace', function (done) { - PythonShell.run('error.py', null, function (err, results) { + PythonShell.run('error.py', null).catch((err) => { err.should.be.an.Error; err.exitCode.should.be.exactly(1); err.stack.should.containEql('----- Python Traceback -----'); @@ -190,7 +195,7 @@ describe('PythonShell', function () { }); }); it('should run the script and fail with an extended stack trace even when mode is binary', function (done) { - PythonShell.run('error.py', { mode: "binary" }, function (err, results) { + PythonShell.run('error.py', { mode: "binary" }).catch((err) => { err.should.be.an.Error; err.exitCode.should.be.exactly(1); err.stack.should.containEql('----- Python Traceback -----'); @@ -210,7 +215,7 @@ describe('PythonShell', function () { } } function runSingleErrorScript(callback) { - PythonShell.run('error.py', null, function (err, results) { + PythonShell.run('error.py', null).catch((err) => { err.should.be.an.Error; err.exitCode.should.be.exactly(1); err.stack.should.containEql('----- Python Traceback -----'); @@ -234,8 +239,7 @@ describe('PythonShell', function () { function runSingleScript(callback) { PythonShell.run('echo_args.py', { args: ['hello', 'world'] - }, function (err, results) { - if (err) return done(err); + }).then((results)=> { results.should.be.an.Array().and.have.lengthOf(2); results.should.eql(['hello', 'world']); callback(); @@ -249,14 +253,11 @@ describe('PythonShell', function () { PythonShell.run('-m', { args: ['timeit', '-n 1', `'x=5'`] - }, function (err, results) { - + }).then((results)=> { PythonShell.defaultOptions = { // reset to match initial value scriptPath: pythonFolder }; - - if (err) return done(err); results.should.be.an.Array(); results[0].should.be.an.String(); results[0].slice(0, 6).should.eql('1 loop'); @@ -522,8 +523,8 @@ describe('PythonShell', function () { let pyshell = new PythonShell('error.py'); pyshell.on('pythonError', function (err) { err.stack.should.containEql('----- Python Traceback -----'); - err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 4'); - err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 6'); + err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 4'); + err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 6'); done(); }); }); @@ -531,8 +532,8 @@ describe('PythonShell', function () { let pyshell = new PythonShell('error.py', { mode: 'json' }); pyshell.on('pythonError', function (err) { err.stack.should.containEql('----- Python Traceback -----'); - err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 4'); - err.stack.should.containEql('File "test' + sep + 'python' + sep + 'error.py", line 6'); + err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 4'); + err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 6'); done(); }); }); @@ -563,4 +564,4 @@ describe('PythonShell', function () { }, 500); }); }); -}); +}); \ No newline at end of file From b47190781be99c13415c7012a389e552e2a554b3 Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 20:47:56 -0800 Subject: [PATCH 090/111] add convenient script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ede5a33..eb0a662 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "scripts": { "test": "tsc -p ./ && mocha -r ts-node/register", "appveyorTest": "tsc -p ./ && nyc mocha --reporter mocha-appveyor-reporter test/*.js", - "compile": "tsc -watch -p ./" + "compile": "tsc -watch -p ./", + "compileOnce": "tsc -p ./" }, "devDependencies": { "@types/mocha": "^8.2.1", From 91bca43bf9f99789352d4eac67acd0b4f71b259e Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 20:49:29 -0800 Subject: [PATCH 091/111] type run --- index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.ts b/index.ts index 27fd62c..2d643a2 100644 --- a/index.ts +++ b/index.ts @@ -310,12 +310,12 @@ export class PythonShell extends EventEmitter { } /** - * Runs a Python script and returns collected messages as a promise + * Runs a Python script and returns collected messages as a promise. + * If the promise is rejected, the err will probably be of type PythonShellErrorWithLogs * @param scriptPath The path to the script to execute * @param options The execution options - * @return a promise with the output from the python script */ - static run(scriptPath: string, options?: Options) { + static run(scriptPath: string, options?: Options): Promise { return new Promise((resolve, reject) => { let pyshell = new PythonShell(scriptPath, options); let output = []; From ff858cfa9ed55bb672be55314ec890d48f8c90a1 Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 21:09:48 -0800 Subject: [PATCH 092/111] remove bad rebase code --- test/test-python-shell.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 309fe58..17bd8fe 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -123,8 +123,6 @@ describe('PythonShell', function () { results.should.eql(['hello', 'world']); done(); }); - - pythonshell.should.be.an.instanceOf(PythonShell); }); it('should be able to execute a string of python code using promises', async function () { let results = await PythonShell.runString('print("hello");print("world")'); From 9cdf10a16848e202010006c682405ca791edc20b Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 21:11:02 -0800 Subject: [PATCH 093/111] fix end example --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e4d06cf..6990203 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ pyshell.on('message', function (message) { // end the input stream and allow the process to exit pyshell.end(function (err,code,signal) { + if (err) throw err; console.log('The exit code was: ' + code); console.log('The exit signal was: ' + signal); console.log('finished'); From fad9eb0c664071a05d601a6a7c33baf79fca79d2 Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 21:42:41 -0800 Subject: [PATCH 094/111] remove extra arg --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6990203..3f3409a 100644 --- a/README.md +++ b/README.md @@ -215,7 +215,7 @@ PythonShell.run('script.py', null).then(results => { }); ``` -#### `#runString(code, options, callback)` +#### `#runString(code, options)` Runs the Python script and returns a promise. When you handle the promise the argument will be an array of messages emitted from the Python script. From 91f1097bd80e2d3c48c8844bf66c2d0b20ab7daa Mon Sep 17 00:00:00 2001 From: almenon Date: Fri, 10 Feb 2023 21:43:00 -0800 Subject: [PATCH 095/111] 5.0.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 14981de..5cdfd9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "python-shell", - "version": "4.0.0", + "version": "5.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "python-shell", - "version": "4.0.0", + "version": "5.0.0", "license": "MIT", "devDependencies": { "@types/mocha": "^8.2.1", diff --git a/package.json b/package.json index eb0a662..013e349 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "4.0.0", + "version": "5.0.0", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From 9c0c33826fb89ef57baa9deab51ff8fd45f11b3f Mon Sep 17 00:00:00 2001 From: Daw-Chih Liou Date: Fri, 11 Aug 2023 15:10:23 +0200 Subject: [PATCH 096/111] Update example in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f3409a..deb7d27 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ let options = { PythonShell.run('my_script.py', options).then(messages=>{ // results is an array consisting of messages collected during execution - console.log('results: %j', results); + console.log('results: %j', messages); }); ``` From 209c793cfec36f0f1cd4ca701a0eb7ac13d61f35 Mon Sep 17 00:00:00 2001 From: almenon Date: Sun, 28 Apr 2024 22:54:24 -0700 Subject: [PATCH 097/111] update node&python version --- appveyor.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d59efae..f9ddaa9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,20 +5,17 @@ branches: - gh-pages image: -- Visual Studio 2017 -- Ubuntu2004 +- Visual Studio 2022 +- Ubuntu2204 environment: matrix: - - nodejs_version: "14" - PYTHON: "C:\\Python37-x64" - - - nodejs_version: "16" - PYTHON: "C:\\Python37-x64" - - nodejs_version: "18" - PYTHON: "C:\\Python37-x64" + PYTHON: "C:\\Python312-x64" + + - nodejs_version: "20" + PYTHON: "C:\\Python312-x64" install: - cmd: powershell Install-Product node $env:nodejs_version From 7d9de7626a86879980d99dff0d57fbfdbbf824a4 Mon Sep 17 00:00:00 2001 From: Almenon Date: Thu, 4 Jul 2024 19:22:31 -0700 Subject: [PATCH 098/111] Remove bad -u No point in -u here because we are getting the print results at the end of the program --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index deb7d27..a6baae4 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,6 @@ import {PythonShell} from 'python-shell'; let options = { mode: 'text', pythonPath: 'path/to/python', - pythonOptions: ['-u'], // get print results in real-time scriptPath: 'path/to/my/scripts', args: ['value1', 'value2', 'value3'] }; From e4b7f76f0b07d61753b8ddfb3f51a80667666bfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:30:58 +0000 Subject: [PATCH 099/111] Bump hawk and request-json Removes [hawk](https://github.com/mozilla/hawk). It's no longer used after updating ancestor dependency [request-json](https://github.com/hackervents/request-json). These dependencies need to be updated together. Removes `hawk` Updates `request-json` from 0.6.3 to 0.6.5 - [Release notes](https://github.com/hackervents/request-json/releases) - [Commits](https://github.com/hackervents/request-json/commits) --- updated-dependencies: - dependency-name: hawk dependency-type: indirect - dependency-name: request-json dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 665 +++++++++++++++++++--------------------------- 1 file changed, 278 insertions(+), 387 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5cdfd9f..4d041c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,15 +52,19 @@ "dev": true }, "node_modules/ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ansi-colors": { @@ -119,9 +123,9 @@ "dev": true }, "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, "dependencies": { "safer-buffer": "~2.1.0" @@ -130,7 +134,7 @@ "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true, "engines": { "node": ">=0.8" @@ -139,22 +143,22 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true, "engines": { "node": "*" } }, "node_modules/aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", + "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", "dev": true }, "node_modules/balanced-match": { @@ -166,9 +170,8 @@ "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, - "optional": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -182,18 +185,6 @@ "node": ">=8" } }, - "node_modules/boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "dev": true, - "dependencies": { - "hoek": "4.x.x" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -240,7 +231,7 @@ "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "dev": true }, "node_modules/chalk": { @@ -344,16 +335,6 @@ "node": ">=8" } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true, - "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -373,9 +354,9 @@ "dev": true }, "node_modules/combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "dependencies": { "delayed-stream": "~1.0.0" @@ -393,37 +374,13 @@ "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "dev": true }, - "node_modules/cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "dev": true, - "dependencies": { - "boom": "5.x.x" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/cryptiles/node_modules/boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "dev": true, - "dependencies": { - "hoek": "4.x.x" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, "dependencies": { "assert-plus": "^1.0.0" @@ -462,7 +419,7 @@ "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, "engines": { "node": ">=0.4.0" @@ -489,9 +446,8 @@ "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, - "optional": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -530,22 +486,22 @@ "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true, "engines": [ "node >=0.6.0" ] }, "node_modules/fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "node_modules/fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "node_modules/fill-range": { @@ -585,20 +541,20 @@ "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true, "engines": { "node": "*" } }, "node_modules/form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "dependencies": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" }, "engines": { @@ -636,7 +592,7 @@ "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, "dependencies": { "assert-plus": "^1.0.0" @@ -683,23 +639,24 @@ "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", "dev": true, "dependencies": { - "ajv": "^5.1.0", + "ajv": "^6.12.3", "har-schema": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/has-flag": { @@ -711,21 +668,6 @@ "node": ">=8" } }, - "node_modules/hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "dev": true, - "dependencies": { - "boom": "4.x.x", - "cryptiles": "3.x.x", - "hoek": "4.x.x", - "sntp": "2.x.x" - }, - "engines": { - "node": ">=4.5.0" - } - }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -735,19 +677,10 @@ "he": "bin/he" } }, - "node_modules/hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dev": true, "dependencies": { "assert-plus": "^1.0.0", @@ -838,7 +771,7 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "node_modules/isexe": { @@ -850,7 +783,7 @@ "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, "node_modules/js-yaml": { @@ -868,41 +801,40 @@ "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true }, "node_modules/json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, "node_modules/json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, "node_modules/jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, - "engines": [ - "node >=0.6.0" - ], "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" } }, "node_modules/locate-path": { @@ -936,21 +868,21 @@ "dev": true }, "node_modules/mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "dependencies": { - "mime-db": "~1.36.0" + "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" @@ -1045,9 +977,9 @@ } }, "node_modules/oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true, "engines": { "node": "*" @@ -1107,7 +1039,7 @@ "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, "node_modules/picomatch": { @@ -1119,16 +1051,22 @@ "node": ">=8.6" } }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, "node_modules/punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", "dev": true }, "node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true, "engines": { "node": ">=0.6" @@ -1156,46 +1094,45 @@ } }, "node_modules/request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", "dev": true, "dependencies": { "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", + "aws4": "^1.8.0", "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "hawk": "~6.0.2", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "stringstream": "~0.0.5", - "tough-cookie": "~2.3.3", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" + "uuid": "^3.3.2" }, "engines": { "node": ">= 4" } }, "node_modules/request-json": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.3.tgz", - "integrity": "sha512-5TVnMD3LaeK0GRCyFlsNgJf5Fjg8J8j7VEfsoJESSWZlWRgPIf7IojsBLbTHcg2798JrrRkJ6L3k1+wj4sglgw==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.5.tgz", + "integrity": "sha512-bpJ0MZPeb3+/8ux/jM+CLRghTOQ8Oh2VuqtnrPu9ZnSIjr/77sOj/rSWfK9cPRpp3U0UWAIv7rsRvSlyRwbmsw==", "dev": true, "dependencies": { "depd": "1.1.2", - "request": "2.83.0" + "request": "2.88.0" }, "engines": { "node": "*" @@ -1285,18 +1222,6 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, - "node_modules/sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "dev": true, - "dependencies": { - "hoek": "4.x.x" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1317,25 +1242,28 @@ } }, "node_modules/sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", - "safer-buffer": "^2.0.2" + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" }, "engines": { "node": ">=0.10.0" - }, - "optionalDependencies": { - "bcrypt-pbkdf": "^1.0.0", - "ecc-jsbn": "~0.1.1", - "jsbn": "~0.1.0", - "tweetnacl": "~0.14.0" } }, "node_modules/string-width": { @@ -1351,12 +1279,6 @@ "node": ">=4" } }, - "node_modules/stringstream": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", - "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", - "dev": true - }, "node_modules/strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -1403,11 +1325,12 @@ } }, "node_modules/tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "dependencies": { + "psl": "^1.1.24", "punycode": "^1.4.1" }, "engines": { @@ -1448,7 +1371,7 @@ "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, "dependencies": { "safe-buffer": "^5.0.1" @@ -1460,9 +1383,8 @@ "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true }, "node_modules/typescript": { "version": "4.4.3", @@ -1478,10 +1400,29 @@ "node": ">=4.2.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uri-js/node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, "bin": { "uuid": "bin/uuid" @@ -1490,7 +1431,7 @@ "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, "engines": [ "node >=0.6.0" @@ -1738,15 +1679,15 @@ "dev": true }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ansi-colors": { @@ -1793,9 +1734,9 @@ "dev": true }, "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, "requires": { "safer-buffer": "~2.1.0" @@ -1804,25 +1745,25 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "dev": true }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "dev": true }, "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", + "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", "dev": true }, "balanced-match": { @@ -1834,9 +1775,8 @@ "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dev": true, - "optional": true, "requires": { "tweetnacl": "^0.14.3" } @@ -1847,15 +1787,6 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "dev": true, - "requires": { - "hoek": "4.x.x" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1896,7 +1827,7 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "dev": true }, "chalk": { @@ -1981,12 +1912,6 @@ } } }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2003,9 +1928,9 @@ "dev": true }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" @@ -2020,33 +1945,13 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "dev": true }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "dev": true, - "requires": { - "boom": "5.x.x" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "dev": true, - "requires": { - "hoek": "4.x.x" - } - } - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dev": true, "requires": { "assert-plus": "^1.0.0" @@ -2078,7 +1983,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true }, "depd": { @@ -2096,9 +2001,8 @@ "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dev": true, - "optional": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -2131,19 +2035,19 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fill-range": { @@ -2174,17 +2078,17 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "dev": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } }, @@ -2210,7 +2114,7 @@ "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dev": true, "requires": { "assert-plus": "^1.0.0" @@ -2248,16 +2152,16 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "dev": true }, "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "dev": true, "requires": { - "ajv": "^5.1.0", + "ajv": "^6.12.3", "har-schema": "^2.0.0" } }, @@ -2267,34 +2171,16 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "dev": true, - "requires": { - "boom": "4.x.x", - "cryptiles": "3.x.x", - "hoek": "4.x.x", - "sntp": "2.x.x" - } - }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", - "dev": true - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dev": true, "requires": { "assert-plus": "^1.0.0", @@ -2363,7 +2249,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, "isexe": { @@ -2375,7 +2261,7 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, "js-yaml": { @@ -2390,37 +2276,36 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true }, "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true }, "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" } }, @@ -2449,18 +2334,18 @@ "dev": true }, "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true }, "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "requires": { - "mime-db": "~1.36.0" + "mime-db": "1.52.0" } }, "minimatch": { @@ -2533,9 +2418,9 @@ "dev": true }, "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, "once": { @@ -2580,7 +2465,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, "picomatch": { @@ -2589,16 +2474,22 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, + "psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "dev": true + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true }, "randombytes": { @@ -2620,43 +2511,41 @@ } }, "request": { - "version": "2.83.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", - "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "dev": true, "requires": { "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", + "aws4": "^1.8.0", "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "hawk": "~6.0.2", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "stringstream": "~0.0.5", - "tough-cookie": "~2.3.3", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" + "uuid": "^3.3.2" } }, "request-json": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.3.tgz", - "integrity": "sha512-5TVnMD3LaeK0GRCyFlsNgJf5Fjg8J8j7VEfsoJESSWZlWRgPIf7IojsBLbTHcg2798JrrRkJ6L3k1+wj4sglgw==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.5.tgz", + "integrity": "sha512-bpJ0MZPeb3+/8ux/jM+CLRghTOQ8Oh2VuqtnrPu9ZnSIjr/77sOj/rSWfK9cPRpp3U0UWAIv7rsRvSlyRwbmsw==", "dev": true, "requires": { "depd": "1.1.2", - "request": "2.83.0" + "request": "2.88.0" } }, "require-directory": { @@ -2740,15 +2629,6 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "dev": true, - "requires": { - "hoek": "4.x.x" - } - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2766,9 +2646,9 @@ } }, "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -2792,12 +2672,6 @@ "strip-ansi": "^4.0.0" } }, - "stringstream": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", - "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", - "dev": true - }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -2832,11 +2706,12 @@ } }, "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "dev": true, "requires": { + "psl": "^1.1.24", "punycode": "^1.4.1" } }, @@ -2864,7 +2739,7 @@ "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dev": true, "requires": { "safe-buffer": "^5.0.1" @@ -2873,9 +2748,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true }, "typescript": { "version": "4.4.3", @@ -2883,16 +2757,33 @@ "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", "dev": true }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + } + } + }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "dev": true, "requires": { "assert-plus": "^1.0.0", From f7968c4c698e92ac766e97c829b4faa6aa1fc912 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 14:45:48 -0800 Subject: [PATCH 100/111] remove unnecessary comment --- index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/index.ts b/index.ts index 2d643a2..d226888 100644 --- a/index.ts +++ b/index.ts @@ -82,7 +82,6 @@ export class NewlineTransformer extends Transform { if (this._lastLineData) data = this._lastLineData + data const lines = data.split(newline) this._lastLineData = lines.pop() - //@ts-ignore this works, node ignores the encoding if it's a number lines.forEach(this.push.bind(this)) callback() } From c972cace28f34c401d521feae6bd5c7dcd3396df Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 14:48:05 -0800 Subject: [PATCH 101/111] upgrade deps --- package-lock.json | 455 ++++++++++++++++++++++++++++++++-------------- package.json | 8 +- 2 files changed, 322 insertions(+), 141 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d041c5..92a2b48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,18 +10,79 @@ "license": "MIT", "devDependencies": { "@types/mocha": "^8.2.1", - "@types/node": "^14.17.21", + "@types/node": "^24.10.1", "@types/should": "^13.0.0", "mocha": "^8.2.1", "mocha-appveyor-reporter": "^0.4.0", - "should": "^13.2.1", - "ts-node": "^9.0.0", - "typescript": "^4.4.3" + "should": "^13.2.3", + "ts-node": "^10.9.2", + "typescript": "^5.9.3" }, "engines": { "node": ">=0.10" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, "node_modules/@types/mocha": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", @@ -29,11 +90,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "14.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, - "license": "MIT" + "dependencies": { + "undici-types": "~7.16.0" + } }, "node_modules/@types/should": { "version": "13.0.0", @@ -51,6 +114,30 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -77,9 +164,9 @@ } }, "node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true, "engines": { "node": ">=4" @@ -186,9 +273,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "dependencies": { "balanced-match": "^1.0.0", @@ -196,12 +283,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -213,12 +300,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "node_modules/camelcase": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", @@ -292,9 +373,9 @@ } }, "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -377,6 +458,12 @@ "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "dev": true }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -505,9 +592,9 @@ "dev": true }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -901,9 +988,9 @@ } }, "node_modules/mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", + "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", @@ -938,15 +1025,19 @@ }, "engines": { "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha-appveyor-reporter": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.0.tgz", - "integrity": "sha1-gpOC/8Bla2Z+e+ZQoJSgba69Uk8=", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.2.tgz", + "integrity": "sha512-toYTeM5GI4DPghD0Fh17wCDEXvrUZLB5zUkBUORUxxAf/XxJPZmyMVw0Xaue3gFjdTE4eR4IOZO1wloR2Cfniw==", "dev": true, "dependencies": { - "request-json": "^0.6.1" + "request-json": "^0.6.4" } }, "node_modules/ms": { @@ -1222,25 +1313,6 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -1338,25 +1410,46 @@ } }, "node_modules/ts-node": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", - "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", - "dev": true, - "dependencies": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, - "engines": { - "node": ">=10.0.0" + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } } }, "node_modules/ts-node/node_modules/diff": { @@ -1387,19 +1480,24 @@ "dev": true }, "node_modules/typescript": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -1428,6 +1526,12 @@ "uuid": "bin/uuid" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -1487,9 +1591,9 @@ } }, "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -1588,9 +1692,9 @@ } }, "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -1651,6 +1755,61 @@ } }, "dependencies": { + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, "@types/mocha": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", @@ -1658,10 +1817,13 @@ "dev": true }, "@types/node": { - "version": "14.17.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.21.tgz", - "integrity": "sha512-zv8ukKci1mrILYiQOwGSV4FpkZhyxQtuFWGya2GujWg+zVAeRQ4qbaMmWp9vb9889CFA8JECH7lkwCL6Ygg8kA==", - "dev": true + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "requires": { + "undici-types": "~7.16.0" + } }, "@types/should": { "version": "13.0.0", @@ -1678,6 +1840,21 @@ "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", "dev": true }, + "acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true + }, + "acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "requires": { + "acorn": "^8.11.0" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1697,9 +1874,9 @@ "dev": true }, "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", "dev": true }, "ansi-styles": { @@ -1788,9 +1965,9 @@ "dev": true }, "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -1798,12 +1975,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -1812,12 +1989,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "camelcase": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", @@ -1879,9 +2050,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "is-fullwidth-code-point": { @@ -1948,6 +2119,12 @@ "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", "dev": true }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2051,9 +2228,9 @@ "dev": true }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -2358,9 +2535,9 @@ } }, "mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", + "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", @@ -2391,12 +2568,12 @@ } }, "mocha-appveyor-reporter": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.0.tgz", - "integrity": "sha1-gpOC/8Bla2Z+e+ZQoJSgba69Uk8=", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.2.tgz", + "integrity": "sha512-toYTeM5GI4DPghD0Fh17wCDEXvrUZLB5zUkBUORUxxAf/XxJPZmyMVw0Xaue3gFjdTE4eR4IOZO1wloR2Cfniw==", "dev": true, "requires": { - "request-json": "^0.6.1" + "request-json": "^0.6.4" } }, "ms": { @@ -2629,22 +2806,6 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -2716,15 +2877,23 @@ } }, "ts-node": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", - "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "dependencies": { @@ -2752,9 +2921,15 @@ "dev": true }, "typescript": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", - "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true + }, + "undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "dev": true }, "uri-js": { @@ -2780,6 +2955,12 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -2827,9 +3008,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "is-fullwidth-code-point": { @@ -2888,9 +3069,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "is-fullwidth-code-point": { diff --git a/package.json b/package.json index 013e349..115b99c 100644 --- a/package.json +++ b/package.json @@ -13,13 +13,13 @@ }, "devDependencies": { "@types/mocha": "^8.2.1", - "@types/node": "^14.17.21", + "@types/node": "^24.10.1", "@types/should": "^13.0.0", "mocha": "^8.2.1", "mocha-appveyor-reporter": "^0.4.0", - "should": "^13.2.1", - "ts-node": "^9.0.0", - "typescript": "^4.4.3" + "should": "^13.2.3", + "ts-node": "^10.9.2", + "typescript": "^5.9.3" }, "files": [ "*.d.ts", From 2c29bd3b4335ec0a6fd84331c39946a41c8d1787 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 14:49:15 -0800 Subject: [PATCH 102/111] upgrade deps --- package-lock.json | 1661 +++++++++++++++++++++++---------------------- package.json | 6 +- 2 files changed, 869 insertions(+), 798 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92a2b48..e3b9904 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,11 @@ "version": "5.0.0", "license": "MIT", "devDependencies": { - "@types/mocha": "^8.2.1", + "@types/mocha": "^10.0.1", "@types/node": "^24.10.1", "@types/should": "^13.0.0", - "mocha": "^8.2.1", - "mocha-appveyor-reporter": "^0.4.0", + "mocha": "^11.7.5", + "mocha-appveyor-reporter": "^0.4.2", "should": "^13.2.3", "ts-node": "^10.9.2", "typescript": "^5.9.3" @@ -34,6 +34,23 @@ "node": ">=12" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -59,6 +76,16 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@tsconfig/node10": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", @@ -84,9 +111,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", - "integrity": "sha512-NysN+bNqj6E0Hv4CTGWSlPzMW6vTKjDpOteycDkV4IWBsO+PU48JonrPzV9ODjiI2XrjmA05KInLgF5ivZ/YGQ==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true }, "node_modules/@types/node": { @@ -108,12 +135,6 @@ "should": "*" } }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", @@ -154,22 +175,16 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { @@ -182,19 +197,9 @@ }, "engines": { "node": ">=8" - } - }, - "node_modules/anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" }, - "engines": { - "node": ">= 8" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/arg": { @@ -249,9 +254,9 @@ "dev": true }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/bcrypt-pbkdf": { @@ -263,35 +268,13 @@ "tweetnacl": "^0.14.3" } }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" + "balanced-match": "^1.0.0" } }, "node_modules/browser-stdout": { @@ -316,9 +299,9 @@ "dev": true }, "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { "ansi-styles": "^4.1.0", @@ -326,6 +309,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chalk/node_modules/supports-color": { @@ -341,35 +327,32 @@ } }, "node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, - "optionalDependencies": { - "fsevents": "~2.3.1" + "funding": { + "url": "https://paulmillr.com/funding/" } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/cliui/node_modules/ansi-regex": { @@ -381,41 +364,55 @@ "node": ">=8" } }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/cliui/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -446,12 +443,6 @@ "node": ">= 0.8" } }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -464,6 +455,20 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -477,23 +482,22 @@ } }, "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/decamelize": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", @@ -522,14 +526,20 @@ } }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, "engines": { "node": ">=0.3.1" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -541,15 +551,15 @@ } }, "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" @@ -591,18 +601,6 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -625,6 +623,22 @@ "flat": "cli.js" } }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -648,25 +662,6 @@ "node": ">= 0.12" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -686,41 +681,23 @@ } }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": "*" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" + "bin": { + "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/har-schema": { @@ -779,71 +756,22 @@ "npm": ">=1.3.7" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { - "node": ">=0.12.0" + "node": ">=8" } }, "node_modules/is-plain-obj": { @@ -861,10 +789,22 @@ "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/isstream": { @@ -873,10 +813,25 @@ "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "dependencies": { "argparse": "^2.0.1" @@ -937,17 +892,27 @@ } }, "node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -976,59 +941,63 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", - "dev": true, - "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.1.6", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", - "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", + "dev": true, + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", - "mocha": "bin/mocha" + "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 10.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/mocha-appveyor-reporter": { @@ -1046,27 +1015,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -1076,15 +1024,6 @@ "node": "*" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1109,6 +1048,12 @@ "node": ">=10" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1118,13 +1063,29 @@ "node": ">=8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/performance-now": { @@ -1133,14 +1094,11 @@ "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, - "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "dev": true, - "engines": { - "node": ">=8.6" - } + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true }, "node_modules/psl": { "version": "1.9.0", @@ -1173,15 +1131,16 @@ } }, "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/request": { @@ -1232,7 +1191,7 @@ "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1251,14 +1210,35 @@ "dev": true }, "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/should": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", @@ -1313,6 +1293,18 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -1339,28 +1331,99 @@ } }, "node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, "node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", "dev": true, "dependencies": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=4" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" } }, "node_modules/strip-json-comments": { @@ -1384,18 +1447,6 @@ "node": ">=10" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -1561,22 +1612,31 @@ "node": ">= 8" } }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "node_modules/workerpool": { + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", + "dev": true + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { - "string-width": "^1.0.2 || 2" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", - "dev": true - }, - "node_modules/wrap-ansi": { + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -1588,9 +1648,12 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", @@ -1599,81 +1662,84 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, "node_modules/y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "engines": { "node": ">=10" } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-unparser": { @@ -1700,36 +1766,33 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/yargs/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -1764,6 +1827,20 @@ "@jridgewell/trace-mapping": "0.3.9" } }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + } + }, "@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -1786,6 +1863,13 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true + }, "@tsconfig/node10": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", @@ -1811,9 +1895,9 @@ "dev": true }, "@types/mocha": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.1.tgz", - "integrity": "sha512-NysN+bNqj6E0Hv4CTGWSlPzMW6vTKjDpOteycDkV4IWBsO+PU48JonrPzV9ODjiI2XrjmA05KInLgF5ivZ/YGQ==", + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", "dev": true }, "@types/node": { @@ -1834,12 +1918,6 @@ "should": "*" } }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, "acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", @@ -1867,16 +1945,10 @@ "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true }, "ansi-styles": { @@ -1888,16 +1960,6 @@ "color-convert": "^2.0.1" } }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -1944,9 +2006,9 @@ "dev": true }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "bcrypt-pbkdf": { @@ -1958,29 +2020,13 @@ "tweetnacl": "^0.14.3" } }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, "brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "requires": { - "fill-range": "^7.1.1" + "balanced-match": "^1.0.0" } }, "browser-stdout": { @@ -2002,9 +2048,9 @@ "dev": true }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -2023,29 +2069,22 @@ } }, "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "readdirp": "^4.0.1" } }, "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "requires": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" }, "dependencies": { @@ -2055,30 +2094,41 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" } } } @@ -2107,12 +2157,6 @@ "delayed-stream": "~1.0.0" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -2125,6 +2169,17 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, + "cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2135,20 +2190,12 @@ } }, "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } + "ms": "^2.1.3" } }, "decamelize": { @@ -2170,9 +2217,15 @@ "dev": true }, "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", + "dev": true + }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, "ecc-jsbn": { @@ -2186,15 +2239,15 @@ } }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true }, "escape-string-regexp": { @@ -2227,15 +2280,6 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2252,6 +2296,16 @@ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true }, + "foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2269,19 +2323,6 @@ "mime-types": "^2.1.12" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -2298,34 +2339,19 @@ } }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", "dev": true, "requires": { - "is-glob": "^4.0.1" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" } }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -2365,56 +2391,16 @@ "sshpk": "^1.7.0" } }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, "is-plain-obj": { @@ -2429,10 +2415,16 @@ "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "dev": true }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "isstream": { @@ -2441,10 +2433,20 @@ "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", "dev": true }, + "jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "requires": { + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" + } + }, "js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "requires": { "argparse": "^2.0.1" @@ -2496,14 +2498,21 @@ } }, "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^4.0.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, + "lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -2526,45 +2535,47 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" } }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true + }, "mocha": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", - "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", - "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.1.6", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", - "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", + "dev": true, + "requires": { + "browser-stdout": "^1.3.1", + "chokidar": "^4.0.1", + "debug": "^4.3.5", + "diff": "^7.0.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^10.4.5", + "he": "^1.2.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^9.0.5", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", + "yargs-unparser": "^2.0.0" } }, "mocha-appveyor-reporter": { @@ -2582,33 +2593,12 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", - "dev": true - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -2627,28 +2617,44 @@ "p-limit": "^3.0.2" } }, + "package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, + "path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "requires": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", "dev": true }, - "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "psl": { @@ -2679,13 +2685,10 @@ } }, "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true }, "request": { "version": "2.88.0", @@ -2728,7 +2731,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "safe-buffer": { @@ -2744,14 +2747,29 @@ "dev": true }, "serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "requires": { "randombytes": "^2.1.0" } }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, "should": { "version": "13.2.3", "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", @@ -2806,6 +2824,12 @@ "integrity": "sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==", "dev": true }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, "sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -2824,22 +2848,74 @@ } }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + } } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^5.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + } } }, "strip-json-comments": { @@ -2857,15 +2933,6 @@ "has-flag": "^4.0.0" } }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -2981,23 +3048,33 @@ "isexe": "^2.0.0" } }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, "workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", "dev": true }, "wrap-ansi": { - "version": "7.0.0", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true + } + } + }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, @@ -3013,59 +3090,53 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } } } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, "y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "requires": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "dependencies": { "ansi-regex": { @@ -3074,38 +3145,38 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } } } }, "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true }, "yargs-unparser": { diff --git a/package.json b/package.json index 115b99c..29e213d 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,11 @@ "compileOnce": "tsc -p ./" }, "devDependencies": { - "@types/mocha": "^8.2.1", + "@types/mocha": "^10.0.1", "@types/node": "^24.10.1", "@types/should": "^13.0.0", - "mocha": "^8.2.1", - "mocha-appveyor-reporter": "^0.4.0", + "mocha": "^11.7.5", + "mocha-appveyor-reporter": "^0.4.2", "should": "^13.2.3", "ts-node": "^10.9.2", "typescript": "^5.9.3" From 9f11a0ea83944eb9f0e0f39e0b49ac0e3c1225bb Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 17:05:01 -0800 Subject: [PATCH 103/111] remove mocha-appveyor-reporter --- package-lock.json | 897 ---------------------------------------------- package.json | 1 - 2 files changed, 898 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3b9904..b4ea097 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@types/node": "^24.10.1", "@types/should": "^13.0.0", "mocha": "^11.7.5", - "mocha-appveyor-reporter": "^0.4.2", "should": "^13.2.3", "ts-node": "^10.9.2", "typescript": "^5.9.3" @@ -159,22 +158,6 @@ "node": ">=0.4.0" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/ansi-regex": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", @@ -214,60 +197,12 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", - "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", - "dev": true - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", @@ -292,12 +227,6 @@ "node": ">=10" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true - }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -431,24 +360,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -469,18 +380,6 @@ "node": ">= 8" } }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -507,24 +406,6 @@ "node": ">=10" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/diff": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", @@ -540,16 +421,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -574,33 +445,6 @@ "node": ">=10" } }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -639,29 +483,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -671,15 +492,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/glob": { "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", @@ -700,29 +512,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "dev": true, - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -741,21 +530,6 @@ "he": "bin/he" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -783,12 +557,6 @@ "node": ">=8" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -807,12 +575,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -840,45 +602,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -919,27 +642,6 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -1000,30 +702,12 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/mocha-appveyor-reporter": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.2.tgz", - "integrity": "sha512-toYTeM5GI4DPghD0Fh17wCDEXvrUZLB5zUkBUORUxxAf/XxJPZmyMVw0Xaue3gFjdTE4eR4IOZO1wloR2Cfniw==", - "dev": true, - "dependencies": { - "request-json": "^0.6.4" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1088,39 +772,12 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, - "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1143,51 +800,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/request-json": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.5.tgz", - "integrity": "sha512-bpJ0MZPeb3+/8ux/jM+CLRghTOQ8Oh2VuqtnrPu9ZnSIjr/77sOj/rSWfK9cPRpp3U0UWAIv7rsRvSlyRwbmsw==", - "dev": true, - "dependencies": { - "depd": "1.1.2", - "request": "2.88.0" - }, - "engines": { - "node": "*" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -1203,12 +815,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "node_modules/serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -1305,31 +911,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "dev": true, - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -1447,19 +1028,6 @@ "node": ">=10" } }, - "node_modules/tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "dependencies": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -1512,24 +1080,6 @@ "node": ">=0.3.1" } }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -1549,54 +1099,12 @@ "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "dev": true }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uri-js/node_modules/punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -1933,18 +1441,6 @@ "acorn": "^8.11.0" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-regex": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", @@ -1972,54 +1468,12 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "dev": true - }, - "aws4": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.0.tgz", - "integrity": "sha512-3AungXC4I8kKsS9PuS4JH2nc+0bVY/mjgrephHTIi8fpEeGsTHBUJeosp0Wc1myYMElmD0B3Oc4XL/HVJ4PV2g==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "brace-expansion": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", @@ -2041,12 +1495,6 @@ "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2148,21 +1596,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -2180,15 +1613,6 @@ "which": "^2.0.1" } }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -2204,18 +1628,6 @@ "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, "diff": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", @@ -2228,16 +1640,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", @@ -2256,30 +1658,6 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2306,38 +1684,12 @@ "signal-exit": "^4.0.1" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", @@ -2352,22 +1704,6 @@ "path-scurry": "^1.11.1" } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2380,17 +1716,6 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2409,12 +1734,6 @@ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -2427,12 +1746,6 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, "jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -2452,42 +1765,6 @@ "argparse": "^2.0.1" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, "locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -2519,21 +1796,6 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "requires": { - "mime-db": "1.52.0" - } - }, "minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -2578,27 +1840,12 @@ "yargs-unparser": "^2.0.0" } }, - "mocha-appveyor-reporter": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/mocha-appveyor-reporter/-/mocha-appveyor-reporter-0.4.2.tgz", - "integrity": "sha512-toYTeM5GI4DPghD0Fh17wCDEXvrUZLB5zUkBUORUxxAf/XxJPZmyMVw0Xaue3gFjdTE4eR4IOZO1wloR2Cfniw==", - "dev": true, - "requires": { - "request-json": "^0.6.4" - } - }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -2645,36 +1892,12 @@ "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, "picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, - "psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2690,44 +1913,6 @@ "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "request-json": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/request-json/-/request-json-0.6.5.tgz", - "integrity": "sha512-bpJ0MZPeb3+/8ux/jM+CLRghTOQ8Oh2VuqtnrPu9ZnSIjr/77sOj/rSWfK9cPRpp3U0UWAIv7rsRvSlyRwbmsw==", - "dev": true, - "requires": { - "depd": "1.1.2", - "request": "2.88.0" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -2740,12 +1925,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "serialize-javascript": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", @@ -2830,23 +2009,6 @@ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true }, - "sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -2933,16 +2095,6 @@ "has-flag": "^4.0.0" } }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dev": true, - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - } - }, "ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -2972,21 +2124,6 @@ } } }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, "typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -2999,46 +2136,12 @@ "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", "dev": true }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", - "dev": true - } - } - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true - }, "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 29e213d..ed73815 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "@types/node": "^24.10.1", "@types/should": "^13.0.0", "mocha": "^11.7.5", - "mocha-appveyor-reporter": "^0.4.2", "should": "^13.2.3", "ts-node": "^10.9.2", "typescript": "^5.9.3" From 494b2a859a0a0ad6bb73acfadc0f833c5c8d1214 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 17:05:20 -0800 Subject: [PATCH 104/111] 5.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b4ea097..f7e3610 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "python-shell", - "version": "5.0.0", + "version": "5.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "python-shell", - "version": "5.0.0", + "version": "5.0.1", "license": "MIT", "devDependencies": { "@types/mocha": "^10.0.1", diff --git a/package.json b/package.json index ed73815..1d78475 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "5.0.0", + "version": "5.0.1", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From 6835df9c0c542f2c7539f3c4a1affe67ba6a69ea Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 17:05:31 -0800 Subject: [PATCH 105/111] 5.0.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f7e3610..261f96a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "python-shell", - "version": "5.0.1", + "version": "5.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "python-shell", - "version": "5.0.1", + "version": "5.0.2", "license": "MIT", "devDependencies": { "@types/mocha": "^10.0.1", diff --git a/package.json b/package.json index 1d78475..c8963fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "python-shell", - "version": "5.0.1", + "version": "5.0.2", "description": "Run Python scripts from Node.js with simple (but efficient) inter-process communication through stdio", "keywords": [ "python" From 4dbfbc0d8a908bc37a3f7ce40dd25a36a440bbfd Mon Sep 17 00:00:00 2001 From: Almenon Date: Sun, 23 Nov 2025 17:17:31 -0800 Subject: [PATCH 106/111] fix err --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c8963fd..e51b57b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ ], "scripts": { "test": "tsc -p ./ && mocha -r ts-node/register", - "appveyorTest": "tsc -p ./ && nyc mocha --reporter mocha-appveyor-reporter test/*.js", + "appveyorTest": "tsc -p ./ && nyc mocha test/*.js", "compile": "tsc -watch -p ./", "compileOnce": "tsc -p ./" }, From 8bc6dd9b27ec5a507f8b7a28bf7ea8edd1c0b9f9 Mon Sep 17 00:00:00 2001 From: nurazon59 Date: Mon, 24 Nov 2025 11:44:32 +0900 Subject: [PATCH 107/111] feat: add format --- .github/ISSUE_TEMPLATE/bug_report.md | 8 +- .github/ISSUE_TEMPLATE/feature_request.md | 1 - .github/ISSUE_TEMPLATE/question.md | 5 +- .prettierrc | 5 + CHANGELOG.md | 23 +- README.md | 132 +-- appveyor.yml | 13 +- index.ts | 871 ++++++++-------- package-lock.json | 29 +- package.json | 4 +- test/test-python-shell.ts | 1123 +++++++++++---------- tsconfig.json | 27 +- 12 files changed, 1214 insertions(+), 1027 deletions(-) create mode 100644 .prettierrc diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 2b105b5..0364c94 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,7 +4,6 @@ about: Create a report to help us improve title: '' labels: 'bug' assignees: '' - --- **Describe the bug** @@ -23,9 +22,10 @@ A description of what you expected to happen. A description of what actually happened. **Other Information (please complete the following information):** - - OS: [e.g. Windows10] - - Python Version [e.g. 3.6] - - Node Version [e.g. 12] + +- OS: [e.g. Windows10] +- Python Version [e.g. 3.6] +- Node Version [e.g. 12] **Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 36014cd..104f391 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,7 +4,6 @@ about: Suggest an idea for this project title: '' labels: 'enhancement' assignees: '' - --- **Is your feature request related to a problem? Please describe.** diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 96d933f..6e83ae1 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -4,14 +4,11 @@ about: A question about python-shell title: '' labels: 'question' assignees: '' - --- - - **The Question**: - **Any relevant python/javascript code:** diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..1d296fb --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": true, + "singleQuote": true, + "tabWidth": 2 +} diff --git a/CHANGELOG.md b/CHANGELOG.md index d19321e..ba12f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,53 +1,74 @@ ## [5.0.0] - 2023-02-10 + ### BREAKING CHANGES + - run and runString now return a promise instead of a using a callback. - You will need to 1) check the return value, 2) remove the callback argument, and 3) change to a promise - see readme for usage examples ### Other notes + - I confirmed that python-shell works with python 3.11 and node v18. ## [4.0.0] - 2023-02-10 + ### Changed + - run and runString now return a promise instead of a using a callback. - This is somewhat backwards compatible with previous behavior ## [3.0.1] - 2021-10-09 + ### Fixed + - Previously when you called the kill method the terminated attribute was always set to true, regardless of whether the process was actually killed. Now the terminated boolean is set to true if kill succeeds, false otherwise. [#255](https://github.com/extrabacon/python-shell/issues/255) ## [3.0.0] - 2021-03-07 + ### Changed + - **BREAKING** Default python path changed back to `python` on Windows. [#237](https://github.com/extrabacon/python-shell/issues/237) - **BREAKING** `error` event renamed to `pythonError` event. [#118](https://github.com/extrabacon/python-shell/issues/118) - **BREAKING** `receive` methods removed in favor of `splitter` arguments in the constructor. This lets the default splitting logic reside in a reuseable stream transformer. Now if you have extra pipes you can reuse `newlineTransformer` to split incoming data into newline-seperated lines. ### Added + - `error` event that is fired upon failure to launch process, among other things. [#118](https://github.com/extrabacon/python-shell/issues/118) ## [1.0.8] + ### Fixed + - @joaoe fixed a bug with pythonshell not working with unset std streams - https://github.com/extrabacon/python-shell/milestone/9 ## [1.0.7] + ### Changed + - default python path updated to py on windows ## [1.0.4] + ### Added + - added getVersionSync ## [0.0.3] + ### Fixed + - fixed buffering in `PythonShell.receive`, fixing [#1](https://github.com/extrabacon/python-shell/issues/1) ## [0.0.2] + ### Changed + - improved documentation ## [0.0.1] + ### Added + - initial version - independent module moved from [extrabacon/pyspreadsheet](https://github.com/extrabacon/pyspreadsheet) - diff --git a/README.md b/README.md index a6baae4..96e1b69 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ # [python-shell](https://www.npmjs.com/package/python-shell) [![Build status](https://ci.appveyor.com/api/projects/status/m8e3h53vvxg5wb2q/branch/master?svg=true)](https://ci.appveyor.com/project/Almenon/python-shell/branch/master) [![codecov](https://codecov.io/gh/extrabacon/python-shell/branch/master/graph/badge.svg)](https://codecov.io/gh/extrabacon/python-shell) + A simple way to run Python scripts from Node.js with basic but efficient inter-process communication and better error handling. ## Features -+ Reliably spawn Python scripts in a child process -+ Built-in text, JSON and binary modes -+ Custom parsers and formatters -+ Simple and efficient data transfers through stdin and stdout streams -+ Extended stack traces when an error is thrown +- Reliably spawn Python scripts in a child process +- Built-in text, JSON and binary modes +- Custom parsers and formatters +- Simple and efficient data transfers through stdin and stdout streams +- Extended stack traces when an error is thrown ## Requirements + First make sure you are able to run `python3` (Mac/Linux) or `python` (Windows) from the terminal. If you are not then you might need to add it to the PATH. If you want to use a version of python not in the PATH you should specify `options.pythonPath`. ## Installation @@ -25,9 +27,9 @@ npm install python-shell ### Running python code: ```typescript -import {PythonShell} from 'python-shell'; +import { PythonShell } from 'python-shell'; -PythonShell.runString('x=1+1;print(x)', null).then(messages=>{ +PythonShell.runString('x=1+1;print(x)', null).then((messages) => { console.log('finished'); }); ``` @@ -36,17 +38,18 @@ If the script exits with a non-zero code, an error will be thrown. Note the use of imports! If you're not using typescript ಠ_ಠ you can [still get imports to work with this guide](https://github.com/extrabacon/python-shell/issues/148#issuecomment-419120209). -Or you can use require like so: +Or you can use require like so: + ```javascript -let {PythonShell} = require('python-shell') +let { PythonShell } = require('python-shell'); ``` ### Running a Python script: ```typescript -import {PythonShell} from 'python-shell'; +import { PythonShell } from 'python-shell'; -PythonShell.run('my_script.py', null).then(messages=>{ +PythonShell.run('my_script.py', null).then((messages) => { console.log('finished'); }); ``` @@ -56,16 +59,16 @@ If the script exits with a non-zero code, an error will be thrown. ### Running a Python script with arguments and options: ```typescript -import {PythonShell} from 'python-shell'; +import { PythonShell } from 'python-shell'; let options = { mode: 'text', pythonPath: 'path/to/python', scriptPath: 'path/to/my/scripts', - args: ['value1', 'value2', 'value3'] + args: ['value1', 'value2', 'value3'], }; -PythonShell.run('my_script.py', options).then(messages=>{ +PythonShell.run('my_script.py', options).then((messages) => { // results is an array consisting of messages collected during execution console.log('results: %j', messages); }); @@ -74,7 +77,7 @@ PythonShell.run('my_script.py', options).then(messages=>{ ### Exchanging data between Node and Python: ```typescript -import {PythonShell} from 'python-shell'; +import { PythonShell } from 'python-shell'; let pyshell = new PythonShell('my_script.py'); // sends a message to the Python script via stdin @@ -86,7 +89,7 @@ pyshell.on('message', function (message) { }); // end the input stream and allow the process to exit -pyshell.end(function (err,code,signal) { +pyshell.end(function (err, code, signal) { if (err) throw err; console.log('The exit code was: ' + code); console.log('The exit signal was: ' + signal); @@ -98,9 +101,9 @@ Use `.send(message)` to send a message to the Python script. Attach the `message Use `options.mode` to quickly setup how data is sent and received between your Node and Python applications. - * use `text` mode for exchanging lines of text ending with a [newline character](http://hayne.net/MacDev/Notes/unixFAQ.html#endOfLine). - * use `json` mode for exchanging JSON fragments - * use `binary` mode for anything else (data is sent and received as-is) +- use `text` mode for exchanging lines of text ending with a [newline character](http://hayne.net/MacDev/Notes/unixFAQ.html#endOfLine). +- use `json` mode for exchanging JSON fragments +- use `binary` mode for anything else (data is sent and received as-is) Stderr always uses text mode. @@ -154,34 +157,35 @@ Error: ZeroDivisionError: integer division or modulo by zero Creates an instance of `PythonShell` and starts the Python process -* `script`: the path of the script to execute -* `options`: the execution options, consisting of: - * `mode`: Configures how data is exchanged when data flows through stdin and stdout. The possible values are: - * `text`: each line of data is emitted as a message (default) - * `json`: each line of data is parsed as JSON and emitted as a message - * `binary`: data is streamed as-is through `stdout` and `stdin` - * `formatter`: each message to send is transformed using this method, then appended with a newline - * `parser`: each line of data is parsed with this function and its result is emitted as a message - * `stderrParser`: each line of logs is parsed with this function and its result is emitted as a message - * `encoding`: the text encoding to apply on the child process streams (default: "utf8") - * `pythonPath`: The path where to locate the "python" executable. Default: "python3" ("python" for Windows) - * `pythonOptions`: Array of option switches to pass to "python" - * `scriptPath`: The default path where to look for scripts. Default is the current working directory. - * `args`: Array of arguments to pass to the script -* `stdoutSplitter`: splits stdout into chunks, defaulting to splitting into newline-seperated lines -* `stderrSplitter`: splits stderr into chunks, defaulting to splitting into newline-seperated lines +- `script`: the path of the script to execute +- `options`: the execution options, consisting of: + - `mode`: Configures how data is exchanged when data flows through stdin and stdout. The possible values are: + - `text`: each line of data is emitted as a message (default) + - `json`: each line of data is parsed as JSON and emitted as a message + - `binary`: data is streamed as-is through `stdout` and `stdin` + - `formatter`: each message to send is transformed using this method, then appended with a newline + - `parser`: each line of data is parsed with this function and its result is emitted as a message + - `stderrParser`: each line of logs is parsed with this function and its result is emitted as a message + - `encoding`: the text encoding to apply on the child process streams (default: "utf8") + - `pythonPath`: The path where to locate the "python" executable. Default: "python3" ("python" for Windows) + - `pythonOptions`: Array of option switches to pass to "python" + - `scriptPath`: The default path where to look for scripts. Default is the current working directory. + - `args`: Array of arguments to pass to the script +- `stdoutSplitter`: splits stdout into chunks, defaulting to splitting into newline-seperated lines +- `stderrSplitter`: splits stderr into chunks, defaulting to splitting into newline-seperated lines Other options are forwarded to `child_process.spawn`. PythonShell instances have the following properties: -* `script`: the path of the script to execute -* `command`: the full command arguments passed to the Python executable -* `stdin`: the Python stdin stream, used to send data to the child process -* `stdout`: the Python stdout stream, used for receiving data from the child process -* `stderr`: the Python stderr stream, used for communicating logs & errors -* `childProcess`: the process instance created via `child_process.spawn` -* `terminated`: boolean indicating whether the process has exited -* `exitCode`: the process exit code, available after the process has ended + +- `script`: the path of the script to execute +- `command`: the full command arguments passed to the Python executable +- `stdin`: the Python stdin stream, used to send data to the child process +- `stdout`: the Python stdout stream, used for receiving data from the child process +- `stderr`: the Python stderr stream, used for communicating logs & errors +- `childProcess`: the process instance created via `child_process.spawn` +- `terminated`: boolean indicating whether the process has exited +- `exitCode`: the process exit code, available after the process has ended Example: @@ -209,7 +213,7 @@ Example: ```typescript // run a simple script -PythonShell.run('script.py', null).then(results => { +PythonShell.run('script.py', null).then((results) => { // script finished }); ``` @@ -222,7 +226,7 @@ Example: ```typescript // run some simple code -PythonShell.runString('x=1;print(x)', null).then(messages=>{ +PythonShell.runString('x=1;print(x)', null).then((messages) => { // script finished }); ``` @@ -239,12 +243,12 @@ Promise is rejected if there is a syntax error. #### `#getVersion(pythonPath?:string)` -Returns the python version as a promise. Optional pythonPath param to get the version +Returns the python version as a promise. Optional pythonPath param to get the version of a specific python interpreter. #### `#getVersionSync(pythonPath?:string)` -Returns the python version. Optional pythonPath param to get the version +Returns the python version. Optional pythonPath param to get the version of a specific python interpreter. #### `.send(message)` @@ -255,12 +259,12 @@ Example: ```typescript // send a message in text mode -let shell = new PythonShell('script.py', { mode: 'text'}); +let shell = new PythonShell('script.py', { mode: 'text' }); shell.send('hello world!'); // send a message in JSON mode -let shell = new PythonShell('script.py', { mode: 'json'}); -shell.send({ command: "do_stuff", args: [1, 2, 3] }); +let shell = new PythonShell('script.py', { mode: 'json' }); +shell.send({ command: 'do_stuff', args: [1, 2, 3] }); ``` #### `.end(callback)` @@ -279,13 +283,13 @@ Example: ```typescript // receive a message in text mode -let shell = new PythonShell('script.py', { mode: 'text'}); +let shell = new PythonShell('script.py', { mode: 'text' }); shell.on('message', function (message) { // handle message (a line of text from stdout) }); // receive a message in JSON mode -let shell = new PythonShell('script.py', { mode: 'json'}); +let shell = new PythonShell('script.py', { mode: 'json' }); shell.on('message', function (message) { // handle message (a line of text from stdout, parsed as JSON) }); @@ -299,7 +303,7 @@ Example: ```typescript // receive a message in text mode -let shell = new PythonShell('script.py', { mode: 'text'}); +let shell = new PythonShell('script.py', { mode: 'text' }); shell.on('stderr', function (stderr) { // handle stderr (a line of text from stderr) }); @@ -316,9 +320,10 @@ Fires when the process terminates with a non-zero exit code. #### event: `error` Fires when: -* The process could not be spawned, or -* The process could not be killed, or -* Sending a message to the child process failed. + +- The process could not be spawned, or +- The process could not be killed, or +- Sending a message to the child process failed. If the process could not be spawned please double-check that python can be launched from the terminal. @@ -332,18 +337,17 @@ print('hello world', file=open(3, "w")) ``` ```typescript -import { PythonShell, NewlineTransformer, Options } from 'python-shell' +import { PythonShell, NewlineTransformer, Options } from 'python-shell'; const options: Options = { - 'stdio': - ['pipe', 'pipe', 'pipe', 'pipe'] // stdin, stdout, stderr, custom -} -const pyshell = new PythonShell('foo.py', options) + stdio: ['pipe', 'pipe', 'pipe', 'pipe'], // stdin, stdout, stderr, custom +}; +const pyshell = new PythonShell('foo.py', options); -const customPipe = pyshell.childProcess.stdio[3] +const customPipe = pyshell.childProcess.stdio[3]; customPipe.pipe(new NewlineTransformer()).on('data', (customResult: Buffer) => { - console.log(customResult.toString()) -}) + console.log(customResult.toString()); +}); ``` ## Used By: diff --git a/appveyor.yml b/appveyor.yml index f9ddaa9..7f5695e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,18 +5,17 @@ branches: - gh-pages image: -- Visual Studio 2022 -- Ubuntu2204 + - Visual Studio 2022 + - Ubuntu2204 environment: matrix: - - - nodejs_version: "18" + - nodejs_version: '18' PYTHON: "C:\\Python312-x64" - - nodejs_version: "20" + - nodejs_version: '20' PYTHON: "C:\\Python312-x64" - + install: - cmd: powershell Install-Product node $env:nodejs_version - sh: nvm install $nodejs_version @@ -40,7 +39,7 @@ notifications: to: - almenon214@gmail.com on_build_success: false - + skip_commits: files: - '**/*.md' diff --git a/index.ts b/index.ts index d226888..9569354 100644 --- a/index.ts +++ b/index.ts @@ -1,95 +1,101 @@ import { EventEmitter } from 'events'; -import { ChildProcess, spawn, SpawnOptions, exec, execSync } from 'child_process'; +import { + ChildProcess, + spawn, + SpawnOptions, + exec, + execSync, +} from 'child_process'; import { EOL as newline, tmpdir } from 'os'; -import { join, sep } from 'path' -import { Readable, Transform, TransformCallback, Writable } from 'stream' +import { join, sep } from 'path'; +import { Readable, Transform, TransformCallback, Writable } from 'stream'; import { writeFile, writeFileSync } from 'fs'; import { promisify } from 'util'; function toArray(source?: T | T[]): T[] { - if (typeof source === 'undefined' || source === null) { - return []; - } else if (!Array.isArray(source)) { - return [source]; - } - return source; + if (typeof source === 'undefined' || source === null) { + return []; + } else if (!Array.isArray(source)) { + return [source]; + } + return source; } /** * adds arguments as properties to obj */ function extend(obj: {}, ...args) { - Array.prototype.slice.call(arguments, 1).forEach(function (source) { - if (source) { - for (let key in source) { - obj[key] = source[key]; - } - } - }); - return obj; + Array.prototype.slice.call(arguments, 1).forEach(function (source) { + if (source) { + for (let key in source) { + obj[key] = source[key]; + } + } + }); + return obj; } /** * gets a random int from 0-10000000000 */ function getRandomInt() { - return Math.floor(Math.random() * 10000000000); + return Math.floor(Math.random() * 10000000000); } -const execPromise = promisify(exec) +const execPromise = promisify(exec); export interface Options extends SpawnOptions { - /** - * if binary is enabled message and stderr events will not be emitted - */ - mode?: 'text' | 'json' | 'binary' - formatter?: string | ((param: string) => any) - parser?: string | ((param: string) => any) - stderrParser?: string | ((param: string) => any) - encoding?: BufferEncoding - pythonPath?: string - /** - * see https://docs.python.org/3.7/using/cmdline.html - */ - pythonOptions?: string[] - /** - * overrides scriptPath passed into PythonShell constructor - */ - scriptPath?: string - /** - * arguments to your program - */ - args?: string[] + /** + * if binary is enabled message and stderr events will not be emitted + */ + mode?: 'text' | 'json' | 'binary'; + formatter?: string | ((param: string) => any); + parser?: string | ((param: string) => any); + stderrParser?: string | ((param: string) => any); + encoding?: BufferEncoding; + pythonPath?: string; + /** + * see https://docs.python.org/3.7/using/cmdline.html + */ + pythonOptions?: string[]; + /** + * overrides scriptPath passed into PythonShell constructor + */ + scriptPath?: string; + /** + * arguments to your program + */ + args?: string[]; } export class PythonShellError extends Error { - traceback: string | Buffer; - exitCode?: number; + traceback: string | Buffer; + exitCode?: number; } export class PythonShellErrorWithLogs extends PythonShellError { - logs: any[] + logs: any[]; } /** * Takes in a string stream and emits batches seperated by newlines */ export class NewlineTransformer extends Transform { - // NewlineTransformer: Megatron's little known once-removed cousin - private _lastLineData: string; - _transform(chunk: any, encoding: string, callback: TransformCallback){ - let data: string = chunk.toString() - if (this._lastLineData) data = this._lastLineData + data - const lines = data.split(newline) - this._lastLineData = lines.pop() - lines.forEach(this.push.bind(this)) - callback() - } - _flush(done: TransformCallback){ - if (this._lastLineData) this.push(this._lastLineData) - this._lastLineData = null; - done() - } + // NewlineTransformer: Megatron's little known once-removed cousin + private _lastLineData: string; + _transform(chunk: any, encoding: string, callback: TransformCallback) { + let data: string = chunk.toString(); + if (this._lastLineData) data = this._lastLineData + data; + const lines = data.split(newline); + this._lastLineData = lines.pop(); + lines.forEach(this.push.bind(this)); + callback(); + } + _flush(done: TransformCallback) { + if (this._lastLineData) this.push(this._lastLineData); + this._lastLineData = null; + done(); + } } /** @@ -101,376 +107,429 @@ export class NewlineTransformer extends Transform { * @constructor */ export class PythonShell extends EventEmitter { - scriptPath: string - command: string[] - mode: string - formatter: (param: string | Object) => any - parser: (param: string) => any - stderrParser: (param: string) => any - terminated: boolean - childProcess: ChildProcess - stdin: Writable; - stdout: Readable; - stderr: Readable; - exitSignal: string; - exitCode: number; - private stderrHasEnded: boolean; - private stdoutHasEnded: boolean; - private _remaining: string - private _endCallback: (err: PythonShellError, exitCode: number, exitSignal: string) => any - - // starting 2020 python2 is deprecated so we choose 3 as default - static defaultPythonPath = process.platform != "win32" ? "python3" : "python"; - - static defaultOptions: Options = {}; //allow global overrides for options + scriptPath: string; + command: string[]; + mode: string; + formatter: (param: string | Object) => any; + parser: (param: string) => any; + stderrParser: (param: string) => any; + terminated: boolean; + childProcess: ChildProcess; + stdin: Writable; + stdout: Readable; + stderr: Readable; + exitSignal: string; + exitCode: number; + private stderrHasEnded: boolean; + private stdoutHasEnded: boolean; + private _remaining: string; + private _endCallback: ( + err: PythonShellError, + exitCode: number, + exitSignal: string, + ) => any; + + // starting 2020 python2 is deprecated so we choose 3 as default + static defaultPythonPath = process.platform != 'win32' ? 'python3' : 'python'; + + static defaultOptions: Options = {}; //allow global overrides for options + + /** + * spawns a python process + * @param scriptPath path to script. Relative to current directory or options.scriptFolder if specified + * @param options + * @param stdoutSplitter Optional. Splits stdout into chunks, defaulting to splitting into newline-seperated lines + * @param stderrSplitter Optional. splits stderr into chunks, defaulting to splitting into newline-seperated lines + */ + constructor( + scriptPath: string, + options?: Options, + stdoutSplitter: Transform = null, + stderrSplitter: Transform = null, + ) { + super(); /** - * spawns a python process - * @param scriptPath path to script. Relative to current directory or options.scriptFolder if specified - * @param options - * @param stdoutSplitter Optional. Splits stdout into chunks, defaulting to splitting into newline-seperated lines - * @param stderrSplitter Optional. splits stderr into chunks, defaulting to splitting into newline-seperated lines + * returns either pythonshell func (if val string) or custom func (if val Function) */ - constructor(scriptPath: string, options?: Options, stdoutSplitter: Transform = null, stderrSplitter: Transform = null) { - super(); - - /** - * returns either pythonshell func (if val string) or custom func (if val Function) - */ - function resolve(type, val: string | Function) { - if (typeof val === 'string') { - // use a built-in function using its name - return PythonShell[type][val]; - } else if (typeof val === 'function') { - // use a custom function - return val; - } - } - - if (scriptPath.trim().length == 0) throw Error("scriptPath cannot be empty! You must give a script for python to run") - - let self = this; - let errorData = ''; - EventEmitter.call(this); - - options = extend({}, PythonShell.defaultOptions, options); - let pythonPath: string; - if (!options.pythonPath) { - pythonPath = PythonShell.defaultPythonPath; - } else pythonPath = options.pythonPath; - let pythonOptions = toArray(options.pythonOptions); - let scriptArgs = toArray(options.args); - - this.scriptPath = join(options.scriptPath || '', scriptPath); - this.command = pythonOptions.concat(this.scriptPath, scriptArgs); - this.mode = options.mode || 'text'; - this.formatter = resolve('format', options.formatter || this.mode); - this.parser = resolve('parse', options.parser || this.mode); - // We don't expect users to ever format stderr as JSON so we default to text mode - this.stderrParser = resolve('parse', options.stderrParser || 'text'); - this.terminated = false; - this.childProcess = spawn(pythonPath, this.command, options); - - ['stdout', 'stdin', 'stderr'].forEach(function (name) { - self[name] = self.childProcess[name]; - self.parser && self[name] && self[name].setEncoding(options.encoding || 'utf8'); - }); - - // Node buffers stdout&stderr in batches regardless of newline placement - // This is troublesome if you want to recieve distinct individual messages - // for example JSON parsing breaks if it recieves partial JSON - // so we use newlineTransformer to emit each batch seperated by newline - if (this.parser && this.stdout) { - if(!stdoutSplitter) stdoutSplitter = new NewlineTransformer() - // note that setting the encoding turns the chunk into a string - stdoutSplitter.setEncoding(options.encoding || 'utf8') - this.stdout.pipe(stdoutSplitter).on('data', (chunk: string) => { - this.emit('message', self.parser(chunk)); - }); - } - - // listen to stderr and emit errors for incoming data - if (this.stderrParser && this.stderr) { - if(!stderrSplitter) stderrSplitter = new NewlineTransformer() - // note that setting the encoding turns the chunk into a string - stderrSplitter.setEncoding(options.encoding || 'utf8') - this.stderr.pipe(stderrSplitter).on('data', (chunk: string) => { - this.emit('stderr', self.stderrParser(chunk)); - }); - } - - if (this.stderr) { - this.stderr.on('data', function (data) { - errorData += '' + data; - }); - this.stderr.on('end', function () { - self.stderrHasEnded = true; - terminateIfNeeded(); - }); - } else { - self.stderrHasEnded = true; - } - - if (this.stdout) { - this.stdout.on('end', function () { - self.stdoutHasEnded = true; - terminateIfNeeded(); - }); - } else { - self.stdoutHasEnded = true; - } - - this.childProcess.on('error', function (err: NodeJS.ErrnoException) { - self.emit('error', err); - }) - this.childProcess.on('exit', function (code, signal) { - self.exitCode = code; - self.exitSignal = signal; - terminateIfNeeded(); - }); - - function terminateIfNeeded() { - if (!self.stderrHasEnded || !self.stdoutHasEnded || (self.exitCode == null && self.exitSignal == null)) return; - - let err: PythonShellError; - if (self.exitCode && self.exitCode !== 0) { - if (errorData) { - err = self.parseError(errorData); - } else { - err = new PythonShellError('process exited with code ' + self.exitCode); - } - err = extend(err, { - executable: pythonPath, - options: pythonOptions.length ? pythonOptions : null, - script: self.scriptPath, - args: scriptArgs.length ? scriptArgs : null, - exitCode: self.exitCode - }); - // do not emit error if only a callback is used - if (self.listeners('pythonError').length || !self._endCallback) { - self.emit('pythonError', err); - } - } - - self.terminated = true; - self.emit('close'); - self._endCallback && self._endCallback(err, self.exitCode, self.exitSignal); - }; + function resolve(type, val: string | Function) { + if (typeof val === 'string') { + // use a built-in function using its name + return PythonShell[type][val]; + } else if (typeof val === 'function') { + // use a custom function + return val; + } } - // built-in formatters - static format = { - text: function toText(data): string { - if (!data) return ''; - else if (typeof data !== 'string') return data.toString(); - return data; - }, - json: function toJson(data) { - return JSON.stringify(data); - } - }; - - //built-in parsers - static parse = { - text: function asText(data): string { - return data; - }, - json: function asJson(data: string) { - return JSON.parse(data); - } - }; - - /** - * checks syntax without executing code - * @returns rejects promise w/ string error output if syntax failure - */ - static async checkSyntax(code: string) { - const randomInt = getRandomInt(); - const filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py` + if (scriptPath.trim().length == 0) + throw Error( + 'scriptPath cannot be empty! You must give a script for python to run', + ); + + let self = this; + let errorData = ''; + EventEmitter.call(this); + + options = extend({}, PythonShell.defaultOptions, options); + let pythonPath: string; + if (!options.pythonPath) { + pythonPath = PythonShell.defaultPythonPath; + } else pythonPath = options.pythonPath; + let pythonOptions = toArray(options.pythonOptions); + let scriptArgs = toArray(options.args); + + this.scriptPath = join(options.scriptPath || '', scriptPath); + this.command = pythonOptions.concat(this.scriptPath, scriptArgs); + this.mode = options.mode || 'text'; + this.formatter = resolve('format', options.formatter || this.mode); + this.parser = resolve('parse', options.parser || this.mode); + // We don't expect users to ever format stderr as JSON so we default to text mode + this.stderrParser = resolve('parse', options.stderrParser || 'text'); + this.terminated = false; + this.childProcess = spawn(pythonPath, this.command, options); + + ['stdout', 'stdin', 'stderr'].forEach(function (name) { + self[name] = self.childProcess[name]; + self.parser && + self[name] && + self[name].setEncoding(options.encoding || 'utf8'); + }); - const writeFilePromise = promisify(writeFile) - return writeFilePromise(filePath, code).then(() => { - return this.checkSyntaxFile(filePath) - }) + // Node buffers stdout&stderr in batches regardless of newline placement + // This is troublesome if you want to recieve distinct individual messages + // for example JSON parsing breaks if it recieves partial JSON + // so we use newlineTransformer to emit each batch seperated by newline + if (this.parser && this.stdout) { + if (!stdoutSplitter) stdoutSplitter = new NewlineTransformer(); + // note that setting the encoding turns the chunk into a string + stdoutSplitter.setEncoding(options.encoding || 'utf8'); + this.stdout.pipe(stdoutSplitter).on('data', (chunk: string) => { + this.emit('message', self.parser(chunk)); + }); } - static getPythonPath() { - return this.defaultOptions.pythonPath ? this.defaultOptions.pythonPath : this.defaultPythonPath; + // listen to stderr and emit errors for incoming data + if (this.stderrParser && this.stderr) { + if (!stderrSplitter) stderrSplitter = new NewlineTransformer(); + // note that setting the encoding turns the chunk into a string + stderrSplitter.setEncoding(options.encoding || 'utf8'); + this.stderr.pipe(stderrSplitter).on('data', (chunk: string) => { + this.emit('stderr', self.stderrParser(chunk)); + }); } - /** - * checks syntax without executing code - * @returns {Promise} rejects w/ stderr if syntax failure - */ - static async checkSyntaxFile(filePath: string) { - const pythonPath = this.getPythonPath() - let compileCommand = `${pythonPath} -m py_compile ${filePath}` - return execPromise(compileCommand) + if (this.stderr) { + this.stderr.on('data', function (data) { + errorData += '' + data; + }); + this.stderr.on('end', function () { + self.stderrHasEnded = true; + terminateIfNeeded(); + }); + } else { + self.stderrHasEnded = true; } - /** - * Runs a Python script and returns collected messages as a promise. - * If the promise is rejected, the err will probably be of type PythonShellErrorWithLogs - * @param scriptPath The path to the script to execute - * @param options The execution options - */ - static run(scriptPath: string, options?: Options): Promise { - return new Promise((resolve, reject) => { - let pyshell = new PythonShell(scriptPath, options); - let output = []; - - pyshell.on('message', function (message) { - output.push(message); - }).end(function (err) { - if(err){ - (err as PythonShellErrorWithLogs).logs = output - reject(err); - } - else resolve(output); - }); - }); - }; - - - - /** - * Runs the inputted string of python code and returns collected messages as a promise. DO NOT ALLOW UNTRUSTED USER INPUT HERE! - * @param code The python code to execute - * @param options The execution options - * @return a promise with the output from the python script - */ - static runString(code: string, options?: Options) { - - // put code in temp file - const randomInt = getRandomInt(); - const filePath = tmpdir + sep + `pythonShellFile${randomInt}.py` - writeFileSync(filePath, code); - - return PythonShell.run(filePath, options); - }; - - static getVersion(pythonPath?: string) { - if (!pythonPath) pythonPath = this.getPythonPath() - return execPromise(pythonPath + " --version"); + if (this.stdout) { + this.stdout.on('end', function () { + self.stdoutHasEnded = true; + terminateIfNeeded(); + }); + } else { + self.stdoutHasEnded = true; } - static getVersionSync(pythonPath?: string) { - if (!pythonPath) pythonPath = this.getPythonPath() - return execSync(pythonPath + " --version").toString() - } + this.childProcess.on('error', function (err: NodeJS.ErrnoException) { + self.emit('error', err); + }); + this.childProcess.on('exit', function (code, signal) { + self.exitCode = code; + self.exitSignal = signal; + terminateIfNeeded(); + }); - /** - * Parses an error thrown from the Python process through stderr - * @param {string|Buffer} data The stderr contents to parse - * @return {Error} The parsed error with extended stack trace when traceback is available - */ - private parseError(data: string | Buffer) { - let text = '' + data; - let error: PythonShellError; - - if (/^Traceback/.test(text)) { - // traceback data is available - let lines = text.trim().split(newline); - let exception = lines.pop(); - error = new PythonShellError(exception); - error.traceback = data; - // extend stack trace - error.stack += newline + ' ----- Python Traceback -----' + newline + ' '; - error.stack += lines.slice(1).join(newline + ' '); + function terminateIfNeeded() { + if ( + !self.stderrHasEnded || + !self.stdoutHasEnded || + (self.exitCode == null && self.exitSignal == null) + ) + return; + + let err: PythonShellError; + if (self.exitCode && self.exitCode !== 0) { + if (errorData) { + err = self.parseError(errorData); } else { - // otherwise, create a simpler error with stderr contents - error = new PythonShellError(text); + err = new PythonShellError( + 'process exited with code ' + self.exitCode, + ); } - - return error; - }; - - /** - * Sends a message to the Python shell through stdin - * Override this method to format data to be sent to the Python process - * @returns {PythonShell} The same instance for chaining calls - */ - send(message: string | Object) { - if (!this.stdin) throw new Error("stdin not open for writing"); - let data = this.formatter ? this.formatter(message) : message; - if (this.mode !== 'binary') data += newline; - this.stdin.write(data); - return this; - }; - - /** - * Closes the stdin stream. Unless python is listening for stdin in a loop - * this should cause the process to finish its work and close. - * @returns {PythonShell} The same instance for chaining calls - */ - end(callback: (err: PythonShellError, exitCode: number, exitSignal: string) => any) { - if (this.childProcess.stdin) { - this.childProcess.stdin.end(); + err = extend(err, { + executable: pythonPath, + options: pythonOptions.length ? pythonOptions : null, + script: self.scriptPath, + args: scriptArgs.length ? scriptArgs : null, + exitCode: self.exitCode, + }); + // do not emit error if only a callback is used + if (self.listeners('pythonError').length || !self._endCallback) { + self.emit('pythonError', err); } - this._endCallback = callback; - return this; - }; + } - /** - * Sends a kill signal to the process - * @returns {PythonShell} The same instance for chaining calls - */ - kill(signal?: NodeJS.Signals) { - this.terminated = this.childProcess.kill(signal); - return this; - }; + self.terminated = true; + self.emit('close'); + self._endCallback && + self._endCallback(err, self.exitCode, self.exitSignal); + } + } + + // built-in formatters + static format = { + text: function toText(data): string { + if (!data) return ''; + else if (typeof data !== 'string') return data.toString(); + return data; + }, + json: function toJson(data) { + return JSON.stringify(data); + }, + }; + + //built-in parsers + static parse = { + text: function asText(data): string { + return data; + }, + json: function asJson(data: string) { + return JSON.parse(data); + }, + }; + + /** + * checks syntax without executing code + * @returns rejects promise w/ string error output if syntax failure + */ + static async checkSyntax(code: string) { + const randomInt = getRandomInt(); + const filePath = tmpdir() + sep + `pythonShellSyntaxCheck${randomInt}.py`; + + const writeFilePromise = promisify(writeFile); + return writeFilePromise(filePath, code).then(() => { + return this.checkSyntaxFile(filePath); + }); + } + + static getPythonPath() { + return this.defaultOptions.pythonPath + ? this.defaultOptions.pythonPath + : this.defaultPythonPath; + } + + /** + * checks syntax without executing code + * @returns {Promise} rejects w/ stderr if syntax failure + */ + static async checkSyntaxFile(filePath: string) { + const pythonPath = this.getPythonPath(); + let compileCommand = `${pythonPath} -m py_compile ${filePath}`; + return execPromise(compileCommand); + } + + /** + * Runs a Python script and returns collected messages as a promise. + * If the promise is rejected, the err will probably be of type PythonShellErrorWithLogs + * @param scriptPath The path to the script to execute + * @param options The execution options + */ + static run(scriptPath: string, options?: Options): Promise { + return new Promise((resolve, reject) => { + let pyshell = new PythonShell(scriptPath, options); + let output = []; + + pyshell + .on('message', function (message) { + output.push(message); + }) + .end(function (err) { + if (err) { + (err as PythonShellErrorWithLogs).logs = output; + reject(err); + } else resolve(output); + }); + }); + } + + /** + * Runs the inputted string of python code and returns collected messages as a promise. DO NOT ALLOW UNTRUSTED USER INPUT HERE! + * @param code The python code to execute + * @param options The execution options + * @return a promise with the output from the python script + */ + static runString(code: string, options?: Options) { + // put code in temp file + const randomInt = getRandomInt(); + const filePath = tmpdir + sep + `pythonShellFile${randomInt}.py`; + writeFileSync(filePath, code); + + return PythonShell.run(filePath, options); + } + + static getVersion(pythonPath?: string) { + if (!pythonPath) pythonPath = this.getPythonPath(); + return execPromise(pythonPath + ' --version'); + } + + static getVersionSync(pythonPath?: string) { + if (!pythonPath) pythonPath = this.getPythonPath(); + return execSync(pythonPath + ' --version').toString(); + } + + /** + * Parses an error thrown from the Python process through stderr + * @param {string|Buffer} data The stderr contents to parse + * @return {Error} The parsed error with extended stack trace when traceback is available + */ + private parseError(data: string | Buffer) { + let text = '' + data; + let error: PythonShellError; + + if (/^Traceback/.test(text)) { + // traceback data is available + let lines = text.trim().split(newline); + let exception = lines.pop(); + error = new PythonShellError(exception); + error.traceback = data; + // extend stack trace + error.stack += + newline + ' ----- Python Traceback -----' + newline + ' '; + error.stack += lines.slice(1).join(newline + ' '); + } else { + // otherwise, create a simpler error with stderr contents + error = new PythonShellError(text); + } - /** - * Alias for kill. - * @deprecated - */ - terminate(signal?: NodeJS.Signals) { - // todo: remove this next breaking release - return this.kill(signal) + return error; + } + + /** + * Sends a message to the Python shell through stdin + * Override this method to format data to be sent to the Python process + * @returns {PythonShell} The same instance for chaining calls + */ + send(message: string | Object) { + if (!this.stdin) throw new Error('stdin not open for writing'); + let data = this.formatter ? this.formatter(message) : message; + if (this.mode !== 'binary') data += newline; + this.stdin.write(data); + return this; + } + + /** + * Closes the stdin stream. Unless python is listening for stdin in a loop + * this should cause the process to finish its work and close. + * @returns {PythonShell} The same instance for chaining calls + */ + end( + callback: ( + err: PythonShellError, + exitCode: number, + exitSignal: string, + ) => any, + ) { + if (this.childProcess.stdin) { + this.childProcess.stdin.end(); } -}; + this._endCallback = callback; + return this; + } + + /** + * Sends a kill signal to the process + * @returns {PythonShell} The same instance for chaining calls + */ + kill(signal?: NodeJS.Signals) { + this.terminated = this.childProcess.kill(signal); + return this; + } + + /** + * Alias for kill. + * @deprecated + */ + terminate(signal?: NodeJS.Signals) { + // todo: remove this next breaking release + return this.kill(signal); + } +} // This interface is merged in with the above class definition export interface PythonShell { - addListener(event: string, listener: (...args: any[]) => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - on(event: string, listener: (...args: any[]) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - - addListener(event: "message", listener: (parsedChunk: any) => void): this; - emit(event: "message", parsedChunk: any): boolean; - on(event: "message", listener: (parsedChunk: any) => void): this; - once(event: "message", listener: (parsedChunk: any) => void): this; - prependListener(event: "message", listener: (parsedChunk: any) => void): this; - prependOnceListener(event: "message", listener: (parsedChunk: any) => void): this; - - addListener(event: "stderr", listener: (parsedChunk: any) => void): this; - emit(event: "stderr", parsedChunk: any): boolean; - on(event: "stderr", listener: (parsedChunk: any) => void): this; - once(event: "stderr", listener: (parsedChunk: any) => void): this; - prependListener(event: "stderr", listener: (parsedChunk: any) => void): this; - prependOnceListener(event: "stderr", listener: (parsedChunk: any) => void): this; - - addListener(event: "close", listener: () => void): this; - emit(event: "close",): boolean; - on(event: "close", listener: () => void): this; - once(event: "close", listener: () => void): this; - prependListener(event: "close", listener: () => void): this; - prependOnceListener(event: "close", listener: () => void): this; - - addListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; - emit(event: "error", error: NodeJS.ErrnoException): boolean; - on(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; - once(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; - prependListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; - prependOnceListener(event: "error", listener: (error: NodeJS.ErrnoException) => void): this; - - addListener(event: "pythonError", listener: (error: PythonShellError) => void): this; - emit(event: "pythonError", error: PythonShellError): boolean; - on(event: "pythonError", listener: (error: PythonShellError) => void): this; - once(event: "pythonError", listener: (error: PythonShellError) => void): this; - prependListener(event: "pythonError", listener: (error: PythonShellError) => void): this; - prependOnceListener(event: "pythonError", listener: (error: PythonShellError) => void): this; + addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + addListener(event: 'message', listener: (parsedChunk: any) => void): this; + emit(event: 'message', parsedChunk: any): boolean; + on(event: 'message', listener: (parsedChunk: any) => void): this; + once(event: 'message', listener: (parsedChunk: any) => void): this; + prependListener(event: 'message', listener: (parsedChunk: any) => void): this; + prependOnceListener( + event: 'message', + listener: (parsedChunk: any) => void, + ): this; + + addListener(event: 'stderr', listener: (parsedChunk: any) => void): this; + emit(event: 'stderr', parsedChunk: any): boolean; + on(event: 'stderr', listener: (parsedChunk: any) => void): this; + once(event: 'stderr', listener: (parsedChunk: any) => void): this; + prependListener(event: 'stderr', listener: (parsedChunk: any) => void): this; + prependOnceListener( + event: 'stderr', + listener: (parsedChunk: any) => void, + ): this; + + addListener(event: 'close', listener: () => void): this; + emit(event: 'close'): boolean; + on(event: 'close', listener: () => void): this; + once(event: 'close', listener: () => void): this; + prependListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + + addListener( + event: 'error', + listener: (error: NodeJS.ErrnoException) => void, + ): this; + emit(event: 'error', error: NodeJS.ErrnoException): boolean; + on(event: 'error', listener: (error: NodeJS.ErrnoException) => void): this; + once(event: 'error', listener: (error: NodeJS.ErrnoException) => void): this; + prependListener( + event: 'error', + listener: (error: NodeJS.ErrnoException) => void, + ): this; + prependOnceListener( + event: 'error', + listener: (error: NodeJS.ErrnoException) => void, + ): this; + + addListener( + event: 'pythonError', + listener: (error: PythonShellError) => void, + ): this; + emit(event: 'pythonError', error: PythonShellError): boolean; + on(event: 'pythonError', listener: (error: PythonShellError) => void): this; + once(event: 'pythonError', listener: (error: PythonShellError) => void): this; + prependListener( + event: 'pythonError', + listener: (error: PythonShellError) => void, + ): this; + prependOnceListener( + event: 'pythonError', + listener: (error: PythonShellError) => void, + ): this; } diff --git a/package-lock.json b/package-lock.json index 261f96a..13e4c11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@types/node": "^24.10.1", "@types/should": "^13.0.0", "mocha": "^11.7.5", + "prettier": "^3.6.2", "should": "^13.2.3", "ts-node": "^10.9.2", "typescript": "^5.9.3" @@ -120,6 +121,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -778,6 +780,22 @@ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, + "node_modules/prettier": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1085,6 +1103,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1413,6 +1432,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, + "peer": true, "requires": { "undici-types": "~7.16.0" } @@ -1898,6 +1918,12 @@ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, + "prettier": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2128,7 +2154,8 @@ "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true + "dev": true, + "peer": true }, "undici-types": { "version": "7.16.0", diff --git a/package.json b/package.json index e51b57b..48f2aa2 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,15 @@ "test": "tsc -p ./ && mocha -r ts-node/register", "appveyorTest": "tsc -p ./ && nyc mocha test/*.js", "compile": "tsc -watch -p ./", - "compileOnce": "tsc -p ./" + "compileOnce": "tsc -p ./", + "format": "prettier --write ." }, "devDependencies": { "@types/mocha": "^10.0.1", "@types/node": "^24.10.1", "@types/should": "^13.0.0", "mocha": "^11.7.5", + "prettier": "^3.6.2", "should": "^13.2.3", "ts-node": "^10.9.2", "typescript": "^5.9.3" diff --git a/test/test-python-shell.ts b/test/test-python-shell.ts index 17bd8fe..3d5de81 100644 --- a/test/test-python-shell.ts +++ b/test/test-python-shell.ts @@ -1,565 +1,644 @@ import * as should from 'should'; -import { PythonShell } from '..' -import { sep, join } from 'path' -import { EOL as newline } from 'os' +import { PythonShell } from '..'; +import { sep, join } from 'path'; +import { EOL as newline } from 'os'; import { chdir, cwd } from 'process'; describe('PythonShell', function () { + const pythonFolder = 'test/python'; - const pythonFolder = 'test/python' + PythonShell.defaultOptions = { + scriptPath: pythonFolder, + }; - PythonShell.defaultOptions = { - scriptPath: pythonFolder - }; + describe('#ctor(script, options)', function () { + it('should spawn a Python process', function (done) { + // spawning python might take a while for the first time + // after this python should be in memory and not need extra time for startup + this.timeout(3000); - describe('#ctor(script, options)', function () { - it('should spawn a Python process', function (done) { - // spawning python might take a while for the first time - // after this python should be in memory and not need extra time for startup - this.timeout(3000) - - let pyshell = new PythonShell('exit-code.py'); - pyshell.command.should.eql(['test' + sep + 'python' + sep + 'exit-code.py']); - pyshell.terminated.should.be.false; - pyshell.end(function (err) { - if (err) return done(err); - pyshell.terminated.should.be.true; - done(); - }); - }); - it('should spawn a Python process even if scriptPath option is not specified', function (done) { - let originalDirectory = cwd() - PythonShell.defaultOptions = {}; - chdir(join(__dirname, "python")); + let pyshell = new PythonShell('exit-code.py'); + pyshell.command.should.eql([ + 'test' + sep + 'python' + sep + 'exit-code.py', + ]); + pyshell.terminated.should.be.false; + pyshell.end(function (err) { + if (err) return done(err); + pyshell.terminated.should.be.true; + done(); + }); + }); + it('should spawn a Python process even if scriptPath option is not specified', function (done) { + let originalDirectory = cwd(); + PythonShell.defaultOptions = {}; + chdir(join(__dirname, 'python')); - let pyshell = new PythonShell('exit-code.py'); - pyshell.command.should.eql(['exit-code.py']); - pyshell.terminated.should.be.false; - pyshell.end(function (err) { - if (err) return done(err); - pyshell.terminated.should.be.true; - done(); - }); + let pyshell = new PythonShell('exit-code.py'); + pyshell.command.should.eql(['exit-code.py']); + pyshell.terminated.should.be.false; + pyshell.end(function (err) { + if (err) return done(err); + pyshell.terminated.should.be.true; + done(); + }); - //reset values to intial status - PythonShell.defaultOptions = { - scriptPath: pythonFolder - }; - chdir(originalDirectory) - }); - // executing python-shell with a absolute path is tested in runString suite - it('should spawn a Python process with options', function (done) { - let pyshell = new PythonShell('exit-code.py', { - pythonOptions: ['-u'] - }); - pyshell.command.should.eql(['-u', 'test' + sep + 'python' + sep + 'exit-code.py']); - pyshell.end(done); - }); - it('should fail to spawn python with bad path', function (done) { - let pyshell = new PythonShell('exit-code.py', { - pythonPath: 'foeisjofseij' - }); - pyshell.on('error', (err) => { - err.code.should.eql('ENOENT') - done() - }) - }); - it('should spawn a Python process with script arguments', function (done) { - let pyshell = new PythonShell('echo_args.py', { - args: ['hello', 'world'] - }); - pyshell.command.should.eql(['test' + sep + 'python' + sep + 'echo_args.py', 'hello', 'world']); - pyshell.end(done); - }); + //reset values to intial status + PythonShell.defaultOptions = { + scriptPath: pythonFolder, + }; + chdir(originalDirectory); + }); + // executing python-shell with a absolute path is tested in runString suite + it('should spawn a Python process with options', function (done) { + let pyshell = new PythonShell('exit-code.py', { + pythonOptions: ['-u'], + }); + pyshell.command.should.eql([ + '-u', + 'test' + sep + 'python' + sep + 'exit-code.py', + ]); + pyshell.end(done); + }); + it('should fail to spawn python with bad path', function (done) { + let pyshell = new PythonShell('exit-code.py', { + pythonPath: 'foeisjofseij', + }); + pyshell.on('error', (err) => { + err.code.should.eql('ENOENT'); + done(); + }); }); + it('should spawn a Python process with script arguments', function (done) { + let pyshell = new PythonShell('echo_args.py', { + args: ['hello', 'world'], + }); + pyshell.command.should.eql([ + 'test' + sep + 'python' + sep + 'echo_args.py', + 'hello', + 'world', + ]); + pyshell.end(done); + }); + }); - describe('#checkSyntax(code:string)', function () { + describe('#checkSyntax(code:string)', function () { + // note checkSyntax is a wrapper around checkSyntaxFile + // so this tests checkSyntaxFile as well - // note checkSyntax is a wrapper around checkSyntaxFile - // so this tests checkSyntaxFile as well + it('should check syntax', function (done) { + PythonShell.checkSyntax('x=1').then(() => { + done(); + }); + }); - it('should check syntax', function (done) { - PythonShell.checkSyntax("x=1").then(() => { - done(); - }) - }) + it('should invalidate bad syntax', function (done) { + PythonShell.checkSyntax('x=').catch(() => { + done(); + }); + }); + }); - it('should invalidate bad syntax', function (done) { - PythonShell.checkSyntax("x=").catch(() => { - done(); - }) - }) - }) + // #158 these tests are failing on appveyor windows node 8/10 python 2/3 + // but they work locally on my windows machine ..... + // these methods are not that important so just commenting out tests untill someone fixes them + // describe("#getVersion", function(){ + // it('should return a string', function(done){ + // PythonShell.getVersion().then((out)=>{ + // const version = out.stdout + // version.should.be.a.String(); + // version.length.should.be.greaterThan(0) + // done() + // }) + // }) + // }) - // #158 these tests are failing on appveyor windows node 8/10 python 2/3 - // but they work locally on my windows machine ..... - // these methods are not that important so just commenting out tests untill someone fixes them - // describe("#getVersion", function(){ - // it('should return a string', function(done){ - // PythonShell.getVersion().then((out)=>{ - // const version = out.stdout - // version.should.be.a.String(); - // version.length.should.be.greaterThan(0) - // done() - // }) - // }) - // }) + // describe("#getVersionSync", function(){ + // it('should return a string', function(){ + // const version = PythonShell.getVersionSync() + // version.should.be.a.String(); + // version.length.should.be.greaterThan(0) + // }) + // }) - // describe("#getVersionSync", function(){ - // it('should return a string', function(){ - // const version = PythonShell.getVersionSync() - // version.should.be.a.String(); - // version.length.should.be.greaterThan(0) - // }) - // }) + describe('#runString(script, options)', function () { + before(() => { + PythonShell.defaultOptions = {}; + }); + it('should be able to execute a string of python code', function (done) { + PythonShell.runString('print("hello");print("world")', null).then( + (results) => { + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + done(); + }, + ); + }); + it('should be able to execute a string of python code using promises', async function () { + let results = await PythonShell.runString( + 'print("hello");print("world")', + ); + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + }); + it('should be able to execute a string of python code async', async function () { + let results = await PythonShell.runString( + 'print("hello");print("world")', + ); + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + }); + after(() => { + PythonShell.defaultOptions = { + // reset to match initial value + scriptPath: pythonFolder, + }; + }); + }); - describe('#runString(script, options)', function () { - before(() => { - PythonShell.defaultOptions = {}; + describe('#run(script, options)', function () { + it('should run the script and return output data using callbacks', function (done) { + PythonShell.run('echo_args.py', { + args: ['hello', 'world'], + }).then((results) => { + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + done(); + }); + }); + it('should run the script and return output data async', async function () { + let results = await PythonShell.run('echo_args.py', { + args: ['hello', 'world'], + }); + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + }); + it('should try to run the script and fail appropriately', function (done) { + PythonShell.run('unknown_script.py', null).catch((err) => { + err.should.be.an.Error; + err.exitCode.should.be.exactly(2); + done(); + }); + }); + it('should try to run the script and fail appropriately - async', async function () { + try { + let results = await PythonShell.run('unknown_script.py'); + throw new Error( + `should not get here because the script should fail` + results, + ); + } catch (err) { + err.should.be.an.Error; + err.exitCode.should.be.exactly(2); + } + }); + it('should include both output and error', function (done) { + PythonShell.run('echo_hi_then_error.py', null) + .then((results) => { + done('Error: This promise should never successfully resolve'); }) - it('should be able to execute a string of python code', function (done) { - PythonShell.runString('print("hello");print("world")', null).then((results) => { - results.should.be.an.Array().and.have.lengthOf(2); - results.should.eql(['hello', 'world']); - done(); - }); + .catch((err) => { + err.logs.should.eql(['hi']); + err.should.be.an.Error; + done(); }); - it('should be able to execute a string of python code using promises', async function () { - let results = await PythonShell.runString('print("hello");print("world")'); - results.should.be.an.Array().and.have.lengthOf(2); - results.should.eql(['hello', 'world']); - }); - it('should be able to execute a string of python code async', async function () { - let results = await PythonShell.runString('print("hello");print("world")'); - results.should.be.an.Array().and.have.lengthOf(2); - results.should.eql(['hello', 'world']); - }); - after(() => { - PythonShell.defaultOptions = { - // reset to match initial value - scriptPath: pythonFolder - }; - }) + }); + it('should run the script and fail with an extended stack trace', function (done) { + PythonShell.run('error.py', null).catch((err) => { + err.should.be.an.Error; + err.exitCode.should.be.exactly(1); + err.stack.should.containEql('----- Python Traceback -----'); + done(); + }); + }); + it('should run the script and fail with an extended stack trace even when mode is binary', function (done) { + PythonShell.run('error.py', { mode: 'binary' }).catch((err) => { + err.should.be.an.Error; + err.exitCode.should.be.exactly(1); + err.stack.should.containEql('----- Python Traceback -----'); + done(); + }); + }); + it('should run multiple scripts and fail with an extended stack trace for each of them', function (done) { + let numberOfTimesToRun = 5; + for (let i = 0; i < numberOfTimesToRun; i++) { + runSingleErrorScript(end); + } + let count = 0; + function end() { + count++; + if (count === numberOfTimesToRun) { + done(); + } + } + function runSingleErrorScript(callback) { + PythonShell.run('error.py', null).catch((err) => { + err.should.be.an.Error; + err.exitCode.should.be.exactly(1); + err.stack.should.containEql('----- Python Traceback -----'); + callback(); + }); + } }); - describe('#run(script, options)', function () { - it('should run the script and return output data using callbacks', function (done) { - PythonShell.run('echo_args.py', { - args: ['hello', 'world'] - }).then((results) => { - results.should.be.an.Array().and.have.lengthOf(2); - results.should.eql(['hello', 'world']); - done(); - }); - }); - it('should run the script and return output data async', async function () { - let results = await PythonShell.run('echo_args.py', { - args: ['hello', 'world'] - }); - results.should.be.an.Array().and.have.lengthOf(2); - results.should.eql(['hello', 'world']); - }); - it('should try to run the script and fail appropriately', function (done) { - PythonShell.run('unknown_script.py', null).catch((err) => { - err.should.be.an.Error; - err.exitCode.should.be.exactly(2); - done(); - }); - }); - it('should try to run the script and fail appropriately - async', async function () { - try { - let results = await PythonShell.run('unknown_script.py'); - throw new Error(`should not get here because the script should fail` + results); - } catch (err) { - err.should.be.an.Error; - err.exitCode.should.be.exactly(2); - } - }); - it('should include both output and error', function (done) { - PythonShell.run('echo_hi_then_error.py', null).then((results) => { - done("Error: This promise should never successfully resolve"); - }).catch((err)=>{ - err.logs.should.eql(['hi']) - err.should.be.an.Error - done() - }); - }); - it('should run the script and fail with an extended stack trace', function (done) { - PythonShell.run('error.py', null).catch((err) => { - err.should.be.an.Error; - err.exitCode.should.be.exactly(1); - err.stack.should.containEql('----- Python Traceback -----'); - done(); - }); - }); - it('should run the script and fail with an extended stack trace even when mode is binary', function (done) { - PythonShell.run('error.py', { mode: "binary" }).catch((err) => { - err.should.be.an.Error; - err.exitCode.should.be.exactly(1); - err.stack.should.containEql('----- Python Traceback -----'); - done(); - }); - }); - it('should run multiple scripts and fail with an extended stack trace for each of them', function (done) { - let numberOfTimesToRun = 5; - for (let i = 0; i < numberOfTimesToRun; i++) { - runSingleErrorScript(end); - } - let count = 0; - function end() { - count++; - if (count === numberOfTimesToRun) { - done(); - } - } - function runSingleErrorScript(callback) { - PythonShell.run('error.py', null).catch((err) => { - err.should.be.an.Error; - err.exitCode.should.be.exactly(1); - err.stack.should.containEql('----- Python Traceback -----'); - callback(); - }); - } - }); - - it('should run multiple scripts and return output data for each of them', function (done) { - let numberOfTimesToRun = 5; - for (let i = 0; i < numberOfTimesToRun; i++) { - runSingleScript(end); - } - let count = 0; - function end() { - count++; - if (count === numberOfTimesToRun) { - done(); - } - } - function runSingleScript(callback) { - PythonShell.run('echo_args.py', { - args: ['hello', 'world'] - }).then((results)=> { - results.should.be.an.Array().and.have.lengthOf(2); - results.should.eql(['hello', 'world']); - callback(); - }); - } - - }); + it('should run multiple scripts and return output data for each of them', function (done) { + let numberOfTimesToRun = 5; + for (let i = 0; i < numberOfTimesToRun; i++) { + runSingleScript(end); + } + let count = 0; + function end() { + count++; + if (count === numberOfTimesToRun) { + done(); + } + } + function runSingleScript(callback) { + PythonShell.run('echo_args.py', { + args: ['hello', 'world'], + }).then((results) => { + results.should.be.an.Array().and.have.lengthOf(2); + results.should.eql(['hello', 'world']); + callback(); + }); + } + }); - it('should be able to run modules', function (done) { - PythonShell.defaultOptions = {}; + it('should be able to run modules', function (done) { + PythonShell.defaultOptions = {}; - PythonShell.run('-m', { - args: ['timeit', '-n 1', `'x=5'`] - }).then((results)=> { - PythonShell.defaultOptions = { - // reset to match initial value - scriptPath: pythonFolder - }; - results.should.be.an.Array(); - results[0].should.be.an.String(); - results[0].slice(0, 6).should.eql('1 loop'); - done(); - }); - }) + PythonShell.run('-m', { + args: ['timeit', '-n 1', `'x=5'`], + }).then((results) => { + PythonShell.defaultOptions = { + // reset to match initial value + scriptPath: pythonFolder, + }; + results.should.be.an.Array(); + results[0].should.be.an.String(); + results[0].slice(0, 6).should.eql('1 loop'); + done(); + }); + }); - after(() => { - // should be able to run modules test should theoretically reset this - // but we have this to in case something goes horribly wrong with the test - PythonShell.defaultOptions = { - // reset to match initial value - scriptPath: pythonFolder - }; - }) + after(() => { + // should be able to run modules test should theoretically reset this + // but we have this to in case something goes horribly wrong with the test + PythonShell.defaultOptions = { + // reset to match initial value + scriptPath: pythonFolder, + }; + }); - it('should run PythonShell normally without access to std streams', async function () { - var pyshell = await PythonShell.run('exit-code.py', { - // 3 different ways of assigning values to the std streams in child_process.spawn() - // * ignore - pipe to /dev/null - // * inherit - inherit fd from parent process; - // * process.stderr - pass output directly to that stream. - stdio: ['ignore', 'inherit', process.stderr], - // @ts-expect-error python-shell technically allows a non-array arg, - // although the user shouldn't be doing this. We are just testing for - // increased code coverage - args: "0" - }); + it('should run PythonShell normally without access to std streams', async function () { + var pyshell = await PythonShell.run('exit-code.py', { + // 3 different ways of assigning values to the std streams in child_process.spawn() + // * ignore - pipe to /dev/null + // * inherit - inherit fd from parent process; + // * process.stderr - pass output directly to that stream. + stdio: ['ignore', 'inherit', process.stderr], + // @ts-expect-error python-shell technically allows a non-array arg, + // although the user shouldn't be doing this. We are just testing for + // increased code coverage + args: '0', + }); - should(pyshell).be.eql([]); - - }); + should(pyshell).be.eql([]); }); + }); - describe('.send(message)', function () { - it('should send string messages when mode is "text"', function (done) { - let pyshell = new PythonShell('echo_text.py', { - mode: 'text' - }); - let output = ''; - pyshell.stdout.on('data', function (data) { - output += '' + data; - }); - pyshell.send('hello').send('world').end(function (err) { - if (err) return done(err); - output.should.be.exactly('hello' + newline + 'world' + newline); - done(); - }); + describe('.send(message)', function () { + it('should send string messages when mode is "text"', function (done) { + let pyshell = new PythonShell('echo_text.py', { + mode: 'text', + }); + let output = ''; + pyshell.stdout.on('data', function (data) { + output += '' + data; + }); + pyshell + .send('hello') + .send('world') + .end(function (err) { + if (err) return done(err); + output.should.be.exactly('hello' + newline + 'world' + newline); + done(); }); - it('should send JSON messages when mode is "json"', function (done) { - let pyshell = new PythonShell('echo_json.py', { - mode: 'json' - }); - let output = ''; - pyshell.stdout.on('data', function (data) { - output += '' + data; - }); - pyshell.send({ a: 'b' }).send(null).send([1, 2, 3]).end(function (err) { - if (err) return done(err); - output.should.be.exactly('{"a": "b"}' + newline + 'null' + newline + '[1, 2, 3]' + newline); - done(); - }); - }); - it('should use a custom formatter', function (done) { - let pyshell = new PythonShell('echo_text.py', { - formatter: function (message) { - return message.toUpperCase(); - } - }); - let output = ''; - pyshell.stdout.on('data', function (data) { - output += '' + data; - }); - pyshell.send('hello').send('world').end(function (err) { - if (err) return done(err); - output.should.be.exactly('HELLO' + newline + 'WORLD' + newline + ''); - done(); - }); + }); + it('should send JSON messages when mode is "json"', function (done) { + let pyshell = new PythonShell('echo_json.py', { + mode: 'json', + }); + let output = ''; + pyshell.stdout.on('data', function (data) { + output += '' + data; + }); + pyshell + .send({ a: 'b' }) + .send(null) + .send([1, 2, 3]) + .end(function (err) { + if (err) return done(err); + output.should.be.exactly( + '{"a": "b"}' + newline + 'null' + newline + '[1, 2, 3]' + newline, + ); + done(); }); - it('should write as-is when mode is "binary"', function (done) { - let pyshell = new PythonShell('echo_binary.py', { - mode: 'binary' - }); - let output = ''; - pyshell.stdout.on('data', function (data) { - output += '' + data; - }); - pyshell.send(Buffer.from('i am not a string')).end(function (err) { - if (err) return done(err); - output.should.be.exactly('i am not a string'); - done(); - }); + }); + it('should use a custom formatter', function (done) { + let pyshell = new PythonShell('echo_text.py', { + formatter: function (message) { + return message.toUpperCase(); + }, + }); + let output = ''; + pyshell.stdout.on('data', function (data) { + output += '' + data; + }); + pyshell + .send('hello') + .send('world') + .end(function (err) { + if (err) return done(err); + output.should.be.exactly('HELLO' + newline + 'WORLD' + newline + ''); + done(); }); }); + it('should write as-is when mode is "binary"', function (done) { + let pyshell = new PythonShell('echo_binary.py', { + mode: 'binary', + }); + let output = ''; + pyshell.stdout.on('data', function (data) { + output += '' + data; + }); + pyshell.send(Buffer.from('i am not a string')).end(function (err) { + if (err) return done(err); + output.should.be.exactly('i am not a string'); + done(); + }); + }); + }); - describe('stdout', function () { - it('should emit messages as strings when mode is "text"', function (done) { - let pyshell = new PythonShell('echo_text.py', { - mode: 'text' - }); - let count = 0; - pyshell.on('message', function (message) { - count === 0 && message.should.be.exactly('hello'); - count === 1 && message.should.be.exactly('world'); - count++; - }).on('close', function () { - count.should.be.exactly(2); - }).send('hello').send('world').end(done); - }); - it('should emit messages as JSON when mode is "json"', function (done) { - let pyshell = new PythonShell('echo_json.py', { - mode: 'json' - }); - let count = 0; - pyshell.send({ a: 'b' }).send(null).send([1, 2, 3, 4, 5]); - pyshell.on('message', function (message) { - count === 0 && message.should.eql({ a: 'b' }); - count === 1 && should(message).eql(null); - count === 2 && message.should.eql([1, 2, 3, 4, 5]); - count++; - }).on('close', function () { - count.should.be.exactly(3); - }).end(done); - }); - it('should properly buffer partial messages', function (done) { - // echo_text_with_newline_control echoes text with $'s replaced with newlines - let pyshell = new PythonShell('echo_text_with_newline_control.py', { - mode: 'text' - }); - pyshell.on('message', (message) => { - console.log(message) - let messageObject = JSON.parse(message) - messageObject.should.be.an.Object; - messageObject.should.eql({ a: true }); - }).send('{"a"').send(':').send('true}${').send('"a":true}$').end(() => { - done() - }); - }); - it('should not be invoked when mode is "binary"', function (done) { - let pyshell = new PythonShell('echo_args.py', { - args: ['hello', 'world'], - mode: 'binary' - }); - pyshell.on('message', () => { - done('should not emit messages in binary mode'); - return undefined - }); - pyshell.end(done); - }); - it('should use a custom parser function', function (done) { - let pyshell = new PythonShell('echo_text.py', { - mode: 'text', - parser: function (message) { - return message.toUpperCase(); - } - }); - let count = 0; - pyshell.on('message', function (message) { - count === 0 && message.should.be.exactly('HELLO'); - count === 1 && message.should.be.exactly('WORLD!'); - count++; - }).on('close', function () { - count.should.be.exactly(2); - }).send('hello').send('world!').end(done); + describe('stdout', function () { + it('should emit messages as strings when mode is "text"', function (done) { + let pyshell = new PythonShell('echo_text.py', { + mode: 'text', + }); + let count = 0; + pyshell + .on('message', function (message) { + count === 0 && message.should.be.exactly('hello'); + count === 1 && message.should.be.exactly('world'); + count++; + }) + .on('close', function () { + count.should.be.exactly(2); + }) + .send('hello') + .send('world') + .end(done); + }); + it('should emit messages as JSON when mode is "json"', function (done) { + let pyshell = new PythonShell('echo_json.py', { + mode: 'json', + }); + let count = 0; + pyshell.send({ a: 'b' }).send(null).send([1, 2, 3, 4, 5]); + pyshell + .on('message', function (message) { + count === 0 && message.should.eql({ a: 'b' }); + count === 1 && should(message).eql(null); + count === 2 && message.should.eql([1, 2, 3, 4, 5]); + count++; + }) + .on('close', function () { + count.should.be.exactly(3); + }) + .end(done); + }); + it('should properly buffer partial messages', function (done) { + // echo_text_with_newline_control echoes text with $'s replaced with newlines + let pyshell = new PythonShell('echo_text_with_newline_control.py', { + mode: 'text', + }); + pyshell + .on('message', (message) => { + console.log(message); + let messageObject = JSON.parse(message); + messageObject.should.be.an.Object; + messageObject.should.eql({ a: true }); + }) + .send('{"a"') + .send(':') + .send('true}${') + .send('"a":true}$') + .end(() => { + done(); }); }); + it('should not be invoked when mode is "binary"', function (done) { + let pyshell = new PythonShell('echo_args.py', { + args: ['hello', 'world'], + mode: 'binary', + }); + pyshell.on('message', () => { + done('should not emit messages in binary mode'); + return undefined; + }); + pyshell.end(done); + }); + it('should use a custom parser function', function (done) { + let pyshell = new PythonShell('echo_text.py', { + mode: 'text', + parser: function (message) { + return message.toUpperCase(); + }, + }); + let count = 0; + pyshell + .on('message', function (message) { + count === 0 && message.should.be.exactly('HELLO'); + count === 1 && message.should.be.exactly('WORLD!'); + count++; + }) + .on('close', function () { + count.should.be.exactly(2); + }) + .send('hello') + .send('world!') + .end(done); + }); + }); - describe('stderr', function () { - it('should emit stderr logs as strings when mode is "text"', function (done) { - let pyshell = new PythonShell('stderrLogging.py', { - mode: 'text' - }); - let count = 0; - pyshell.on('stderr', function (stderr) { - count === 0 && stderr.should.be.exactly('INFO:root:Jackdaws love my big sphinx of quartz.'); - count === 1 && stderr.should.be.exactly('DEBUG:log1:Quick zephyrs blow, vexing daft Jim.'); - count++; - }).on('close', function () { - count.should.be.exactly(5); - }).send('hello').send('world').end(done); - }); - it('should not be invoked when mode is "binary"', function (done) { - let pyshell = new PythonShell('stderrLogging.py', { - stderrParser: 'binary' - }); - pyshell.on('stderr', () => { - done('should not emit stderr in binary mode'); - }); - pyshell.end(() => { - done() - }); - }); - it('should use a custom parser function', function (done) { - let pyshell = new PythonShell('stderrLogging.py', { - mode: 'text', - stderrParser: function (stderr) { - return stderr.toUpperCase(); - } - }); - let count = 0; - pyshell.on('stderr', function (stderr) { - count === 0 && stderr.should.be.exactly('INFO:ROOT:JACKDAWS LOVE MY BIG SPHINX OF QUARTZ.'); - count === 1 && stderr.should.be.exactly('DEBUG:LOG1:QUICK ZEPHYRS BLOW, VEXING DAFT JIM.'); - count++; - }).on('close', function () { - count.should.be.exactly(5); - }).send('hello').send('world!').end(done); - }); + describe('stderr', function () { + it('should emit stderr logs as strings when mode is "text"', function (done) { + let pyshell = new PythonShell('stderrLogging.py', { + mode: 'text', + }); + let count = 0; + pyshell + .on('stderr', function (stderr) { + count === 0 && + stderr.should.be.exactly( + 'INFO:root:Jackdaws love my big sphinx of quartz.', + ); + count === 1 && + stderr.should.be.exactly( + 'DEBUG:log1:Quick zephyrs blow, vexing daft Jim.', + ); + count++; + }) + .on('close', function () { + count.should.be.exactly(5); + }) + .send('hello') + .send('world') + .end(done); + }); + it('should not be invoked when mode is "binary"', function (done) { + let pyshell = new PythonShell('stderrLogging.py', { + stderrParser: 'binary', + }); + pyshell.on('stderr', () => { + done('should not emit stderr in binary mode'); + }); + pyshell.end(() => { + done(); + }); + }); + it('should use a custom parser function', function (done) { + let pyshell = new PythonShell('stderrLogging.py', { + mode: 'text', + stderrParser: function (stderr) { + return stderr.toUpperCase(); + }, + }); + let count = 0; + pyshell + .on('stderr', function (stderr) { + count === 0 && + stderr.should.be.exactly( + 'INFO:ROOT:JACKDAWS LOVE MY BIG SPHINX OF QUARTZ.', + ); + count === 1 && + stderr.should.be.exactly( + 'DEBUG:LOG1:QUICK ZEPHYRS BLOW, VEXING DAFT JIM.', + ); + count++; + }) + .on('close', function () { + count.should.be.exactly(5); + }) + .send('hello') + .send('world!') + .end(done); }); + }); - describe('.end(callback)', function () { - it('should end normally when exit code is zero', function (done) { - let pyshell = new PythonShell('exit-code.py'); - pyshell.end(function (err, code, signal) { - if (err) return done(err); - code.should.be.exactly(0); - done(); - }); - }); - it('should emit error if exit code is not zero', function (done) { - let pyshell = new PythonShell('exit-code.py', { - args: ['3'] - }); - pyshell.on('pythonError', function (err) { - err.should.have.properties({ - message: 'process exited with code 3', - exitCode: 3 - }); - done(); - }); - }); - it('should emit error when the program exits because of an unhandled exception', function (done) { - let pyshell = new PythonShell('error.py'); - pyshell.on('pythonError', function (err) { - err.message.should.be.equalOneOf('ZeroDivisionError: integer division or modulo by zero', 'ZeroDivisionError: division by zero'); - err.should.have.property('traceback'); - err.traceback.should.containEql('Traceback (most recent call last)'); - done(); - }); - }); - it('should NOT emit error when logging is written to stderr', function (done) { - let pyshell = new PythonShell('stderrLogging.py'); - pyshell.on('pythonError', function (err) { - done(new Error("an error should not have been raised")); - }); - pyshell.on('close', function () { - done(); - }) - }); + describe('.end(callback)', function () { + it('should end normally when exit code is zero', function (done) { + let pyshell = new PythonShell('exit-code.py'); + pyshell.end(function (err, code, signal) { + if (err) return done(err); + code.should.be.exactly(0); + done(); + }); + }); + it('should emit error if exit code is not zero', function (done) { + let pyshell = new PythonShell('exit-code.py', { + args: ['3'], + }); + pyshell.on('pythonError', function (err) { + err.should.have.properties({ + message: 'process exited with code 3', + exitCode: 3, + }); + done(); + }); + }); + it('should emit error when the program exits because of an unhandled exception', function (done) { + let pyshell = new PythonShell('error.py'); + pyshell.on('pythonError', function (err) { + err.message.should.be.equalOneOf( + 'ZeroDivisionError: integer division or modulo by zero', + 'ZeroDivisionError: division by zero', + ); + err.should.have.property('traceback'); + err.traceback.should.containEql('Traceback (most recent call last)'); + done(); + }); }); + it('should NOT emit error when logging is written to stderr', function (done) { + let pyshell = new PythonShell('stderrLogging.py'); + pyshell.on('pythonError', function (err) { + done(new Error('an error should not have been raised')); + }); + pyshell.on('close', function () { + done(); + }); + }); + }); - describe('.parseError(data)', function () { - it('should extend error with context properties', function (done) { - let pyshell = new PythonShell('exit-code.py', { - args: ['1'] - }); - pyshell.on('pythonError', function (err) { - err.should.have.properties(['exitCode', 'script', 'options', 'args']); - done(); - }); - }); - it('should extend err.stack with traceback', function (done) { - let pyshell = new PythonShell('error.py'); - pyshell.on('pythonError', function (err) { - err.stack.should.containEql('----- Python Traceback -----'); - err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 4'); - err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 6'); - done(); - }); - }); - it('should work in json mode', function (done) { - let pyshell = new PythonShell('error.py', { mode: 'json' }); - pyshell.on('pythonError', function (err) { - err.stack.should.containEql('----- Python Traceback -----'); - err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 4'); - err.stack.should.containEql('test' + sep + 'python' + sep + 'error.py", line 6'); - done(); - }); - }); + describe('.parseError(data)', function () { + it('should extend error with context properties', function (done) { + let pyshell = new PythonShell('exit-code.py', { + args: ['1'], + }); + pyshell.on('pythonError', function (err) { + err.should.have.properties(['exitCode', 'script', 'options', 'args']); + done(); + }); + }); + it('should extend err.stack with traceback', function (done) { + let pyshell = new PythonShell('error.py'); + pyshell.on('pythonError', function (err) { + err.stack.should.containEql('----- Python Traceback -----'); + err.stack.should.containEql( + 'test' + sep + 'python' + sep + 'error.py", line 4', + ); + err.stack.should.containEql( + 'test' + sep + 'python' + sep + 'error.py", line 6', + ); + done(); + }); + }); + it('should work in json mode', function (done) { + let pyshell = new PythonShell('error.py', { mode: 'json' }); + pyshell.on('pythonError', function (err) { + err.stack.should.containEql('----- Python Traceback -----'); + err.stack.should.containEql( + 'test' + sep + 'python' + sep + 'error.py", line 4', + ); + err.stack.should.containEql( + 'test' + sep + 'python' + sep + 'error.py", line 6', + ); + done(); + }); }); + }); - describe('.kill()', function () { - it('set terminated to correct value', function (done) { - let pyshell = new PythonShell('infinite_loop.py'); - pyshell.kill(); - pyshell.terminated.should.be.true - done(); - }); - it('run the end callback if specified', function (done) { - let pyshell = new PythonShell('infinite_loop.py'); - pyshell.end(() => { - done(); - }) - pyshell.kill(); - }); - it('kill with correct signal', function (done) { - let pyshell = new PythonShell('infinite_loop.py'); - pyshell.terminated.should.be.false; - pyshell.kill('SIGKILL'); - pyshell.terminated.should.be.true; - setTimeout(() => { - pyshell.exitSignal.should.be.exactly('SIGKILL'); - done(); - }, 500); - }); + describe('.kill()', function () { + it('set terminated to correct value', function (done) { + let pyshell = new PythonShell('infinite_loop.py'); + pyshell.kill(); + pyshell.terminated.should.be.true; + done(); + }); + it('run the end callback if specified', function (done) { + let pyshell = new PythonShell('infinite_loop.py'); + pyshell.end(() => { + done(); + }); + pyshell.kill(); + }); + it('kill with correct signal', function (done) { + let pyshell = new PythonShell('infinite_loop.py'); + pyshell.terminated.should.be.false; + pyshell.kill('SIGKILL'); + pyshell.terminated.should.be.true; + setTimeout(() => { + pyshell.exitSignal.should.be.exactly('SIGKILL'); + done(); + }, 500); }); -}); \ No newline at end of file + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 7eb40ca..a8f1cba 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,12 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6" - ], - "sourceMap": true, - "rootDir": ".", - "declaration": true, - "forceConsistentCasingInFileNames": true - }, - "exclude": [ - "node_modules", - "personal" - ] -} \ No newline at end of file + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": ["es6"], + "sourceMap": true, + "rootDir": ".", + "declaration": true, + "forceConsistentCasingInFileNames": true + }, + "exclude": ["node_modules", "personal"] +} From 0330213dcb7d888041bdd29299936e96c3bb708d Mon Sep 17 00:00:00 2001 From: Almenon Date: Sat, 6 Dec 2025 09:51:46 -0800 Subject: [PATCH 108/111] remove unnecessary config already the default --- .prettierrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.prettierrc b/.prettierrc index 1d296fb..a048bb8 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,4 @@ { "semi": true, - "singleQuote": true, - "tabWidth": 2 -} + "singleQuote": true +} \ No newline at end of file From ee834461fe3830bc449cf6bf25edc187ca4592ad Mon Sep 17 00:00:00 2001 From: Almenon Date: Sat, 6 Dec 2025 09:53:48 -0800 Subject: [PATCH 109/111] ignore autogenerated file --- .prettierignore | 1 + .prettierrc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..483a9c4 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +package-lock.json \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index a048bb8..937375d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,4 @@ { "semi": true, "singleQuote": true -} \ No newline at end of file +} From 37261752c00c821dfee127a73df7231ba71701ad Mon Sep 17 00:00:00 2001 From: nurazon59 Date: Wed, 10 Dec 2025 00:54:23 +0900 Subject: [PATCH 110/111] ci(appveyor): add Node.js 22 to test matrix --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 7f5695e..f2bb381 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,9 @@ environment: - nodejs_version: '20' PYTHON: "C:\\Python312-x64" + - nodejs_version: '22' + PYTHON: "C:\\Python312-x64" + install: - cmd: powershell Install-Product node $env:nodejs_version - sh: nvm install $nodejs_version From e6ec6da00901baeefb9bb558992f505e96fbc7e1 Mon Sep 17 00:00:00 2001 From: Almenon Date: Sat, 13 Dec 2025 11:27:11 -0800 Subject: [PATCH 111/111] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f2bb381..20fe5f5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,7 @@ environment: - nodejs_version: '20' PYTHON: "C:\\Python312-x64" - - nodejs_version: '22' + - nodejs_version: '24' PYTHON: "C:\\Python312-x64" install: