soda-nodejs 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.d.ts +8 -8
- package/dist/cjs/index.js +17 -13
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/utils/saveFile.js.map +2 -2
- package/dist/cjs/utils/saveResponse.js.map +2 -2
- package/dist/esm/index.d.ts +8 -8
- package/dist/esm/index.js +8 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/saveFile.js.map +1 -1
- package/dist/esm/utils/saveResponse.js.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +8 -8
- package/src/utils/saveFile.ts +1 -1
- package/src/utils/saveResponse.ts +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export * from "./utils/compress";
|
|
2
|
+
export * from "./utils/copy";
|
|
3
|
+
export * from "./utils/execAsync";
|
|
4
|
+
export * from "./utils/saveFile";
|
|
5
|
+
export * from "./utils/saveResponse";
|
|
6
|
+
export * from "./utils/spawnAsync";
|
|
7
|
+
export * from "./utils/unzip";
|
|
8
|
+
export * from "./utils/zip";
|
package/dist/cjs/index.js
CHANGED
|
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
5
|
var __copyProps = (to, from, except, desc) => {
|
|
10
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -14,21 +10,29 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
10
|
}
|
|
15
11
|
return to;
|
|
16
12
|
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
15
|
|
|
19
16
|
// src/index.ts
|
|
20
17
|
var src_exports = {};
|
|
21
|
-
__export(src_exports, {
|
|
22
|
-
getDefaultOptions: () => import_spawnAsync.getDefaultOptions,
|
|
23
|
-
setDefaultOptions: () => import_spawnAsync.setDefaultOptions,
|
|
24
|
-
spawnAsync: () => import_spawnAsync.spawnAsync
|
|
25
|
-
});
|
|
26
18
|
module.exports = __toCommonJS(src_exports);
|
|
27
|
-
|
|
19
|
+
__reExport(src_exports, require("./utils/compress"), module.exports);
|
|
20
|
+
__reExport(src_exports, require("./utils/copy"), module.exports);
|
|
21
|
+
__reExport(src_exports, require("./utils/execAsync"), module.exports);
|
|
22
|
+
__reExport(src_exports, require("./utils/saveFile"), module.exports);
|
|
23
|
+
__reExport(src_exports, require("./utils/saveResponse"), module.exports);
|
|
24
|
+
__reExport(src_exports, require("./utils/spawnAsync"), module.exports);
|
|
25
|
+
__reExport(src_exports, require("./utils/unzip"), module.exports);
|
|
26
|
+
__reExport(src_exports, require("./utils/zip"), module.exports);
|
|
28
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
28
|
0 && (module.exports = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
...require("./utils/compress"),
|
|
30
|
+
...require("./utils/copy"),
|
|
31
|
+
...require("./utils/execAsync"),
|
|
32
|
+
...require("./utils/saveFile"),
|
|
33
|
+
...require("./utils/saveResponse"),
|
|
34
|
+
...require("./utils/spawnAsync"),
|
|
35
|
+
...require("./utils/unzip"),
|
|
36
|
+
...require("./utils/zip")
|
|
33
37
|
});
|
|
34
38
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from \"@/utils/compress\"\nexport * from \"@/utils/copy\"\nexport * from \"@/utils/execAsync\"\nexport * from \"@/utils/saveFile\"\nexport * from \"@/utils/saveResponse\"\nexport * from \"@/utils/spawnAsync\"\nexport * from \"@/utils/unzip\"\nexport * from \"@/utils/zip\"\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,6BAAd;AACA,wBAAc,yBADd;AAEA,wBAAc,8BAFd;AAGA,wBAAc,6BAHd;AAIA,wBAAc,iCAJd;AAKA,wBAAc,+BALd;AAMA,wBAAc,0BANd;AAOA,wBAAc,wBAPd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/saveFile.ts"],
|
|
4
|
-
"sourcesContent": ["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\nexport type SaveFileOptions = {\n /** 要保存的文件 */\n input: File\n /** 保存文件的目标位置 */\n output: string\n}\n\n/**\n * 保存文件\n */\nexport async function saveFile({ input, output }: SaveFileOptions) {\n await new Promise((resolve, reject) => {\n const writeAble = createWriteStream(output)\n Readable.fromWeb(input.stream() as any)\n .pipe(writeAble)\n .on(\"finish\", resolve)\n .on(\"error\", reject)\n })\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkC;AAClC,oBAAyB;AAYzB,eAAsB,SAAS,EAAE,OAAO,OAAO,GAAoB;AAC/D,QAAM,IAAI,
|
|
4
|
+
"sourcesContent": ["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\nexport type SaveFileOptions = {\n /** 要保存的文件 */\n input: File\n /** 保存文件的目标位置 */\n output: string\n}\n\n/**\n * 保存文件\n */\nexport async function saveFile({ input, output }: SaveFileOptions) {\n await new Promise<void>((resolve, reject) => {\n const writeAble = createWriteStream(output)\n Readable.fromWeb(input.stream() as any)\n .pipe(writeAble)\n .on(\"finish\", resolve)\n .on(\"error\", reject)\n })\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkC;AAClC,oBAAyB;AAYzB,eAAsB,SAAS,EAAE,OAAO,OAAO,GAAoB;AAC/D,QAAM,IAAI,QAAc,CAAC,SAAS,WAAW;AACzC,UAAM,gBAAY,6BAAkB,MAAM;AAC1C,2BAAS,QAAQ,MAAM,OAAO,CAAQ,EACjC,KAAK,SAAS,EACd,GAAG,UAAU,OAAO,EACpB,GAAG,SAAS,MAAM;AAAA,EAC3B,CAAC;AACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utils/saveResponse.ts"],
|
|
4
|
-
"sourcesContent": ["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\n/**\n * 从 Response 对象中下载文件\n * @param response Response 对象\n * @param file 文件路径\n */\nexport async function saveResponse(response: Response, file: string) {\n const writeable = createWriteStream(file)\n await new Promise((resolve, reject) =>\n Readable.fromWeb(response.body! as any)\n .pipe(writeable)\n .on(\"close\", resolve)\n .on(\"error\", reject),\n )\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkC;AAClC,oBAAyB;AAOzB,eAAsB,aAAa,UAAoB,MAAc;AACjE,QAAM,gBAAY,6BAAkB,IAAI;AACxC,QAAM,IAAI;AAAA,
|
|
4
|
+
"sourcesContent": ["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\n/**\n * 从 Response 对象中下载文件\n * @param response Response 对象\n * @param file 文件路径\n */\nexport async function saveResponse(response: Response, file: string) {\n const writeable = createWriteStream(file)\n await new Promise<void>((resolve, reject) =>\n Readable.fromWeb(response.body! as any)\n .pipe(writeable)\n .on(\"close\", resolve)\n .on(\"error\", reject),\n )\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAkC;AAClC,oBAAyB;AAOzB,eAAsB,aAAa,UAAoB,MAAc;AACjE,QAAM,gBAAY,6BAAkB,IAAI;AACxC,QAAM,IAAI;AAAA,IAAc,CAAC,SAAS,WAC9B,uBAAS,QAAQ,SAAS,IAAY,EACjC,KAAK,SAAS,EACd,GAAG,SAAS,OAAO,EACnB,GAAG,SAAS,MAAM;AAAA,EAC3B;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export * from "./utils/compress";
|
|
2
|
+
export * from "./utils/copy";
|
|
3
|
+
export * from "./utils/execAsync";
|
|
4
|
+
export * from "./utils/saveFile";
|
|
5
|
+
export * from "./utils/saveResponse";
|
|
6
|
+
export * from "./utils/spawnAsync";
|
|
7
|
+
export * from "./utils/unzip";
|
|
8
|
+
export * from "./utils/zip";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./utils/compress";
|
|
2
|
+
export * from "./utils/copy";
|
|
3
|
+
export * from "./utils/execAsync";
|
|
4
|
+
export * from "./utils/saveFile";
|
|
5
|
+
export * from "./utils/saveResponse";
|
|
6
|
+
export * from "./utils/spawnAsync";
|
|
7
|
+
export * from "./utils/unzip";
|
|
8
|
+
export * from "./utils/zip";
|
|
2
9
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from \"@/utils/compress\"\nexport * from \"@/utils/copy\"\nexport * from \"@/utils/execAsync\"\nexport * from \"@/utils/saveFile\"\nexport * from \"@/utils/saveResponse\"\nexport * from \"@/utils/spawnAsync\"\nexport * from \"@/utils/unzip\"\nexport * from \"@/utils/zip\"\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createWriteStream","Readable","saveFile","input","output","Promise","resolve","reject","writeAble","fromWeb","stream","pipe","on"],"sources":["../../../src/utils/saveFile.ts"],"sourcesContent":["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\nexport type SaveFileOptions = {\n /** 要保存的文件 */\n input: File\n /** 保存文件的目标位置 */\n output: string\n}\n\n/**\n * 保存文件\n */\nexport async function saveFile({ input, output }: SaveFileOptions) {\n await new Promise((resolve, reject) => {\n const writeAble = createWriteStream(output)\n Readable.fromWeb(input.stream() as any)\n .pipe(writeAble)\n .on(\"finish\", resolve)\n .on(\"error\", reject)\n })\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,IAAI;AACtC,SAASC,QAAQ,QAAQ,QAAQ;AASjC;AACA;AACA;AACA,OAAO,eAAeC,QAAQA,CAAC;EAAEC,KAAK;EAAEC;AAAwB,CAAC,EAAE;EAC/D,MAAM,IAAIC,OAAO,
|
|
1
|
+
{"version":3,"names":["createWriteStream","Readable","saveFile","input","output","Promise","resolve","reject","writeAble","fromWeb","stream","pipe","on"],"sources":["../../../src/utils/saveFile.ts"],"sourcesContent":["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\nexport type SaveFileOptions = {\n /** 要保存的文件 */\n input: File\n /** 保存文件的目标位置 */\n output: string\n}\n\n/**\n * 保存文件\n */\nexport async function saveFile({ input, output }: SaveFileOptions) {\n await new Promise<void>((resolve, reject) => {\n const writeAble = createWriteStream(output)\n Readable.fromWeb(input.stream() as any)\n .pipe(writeAble)\n .on(\"finish\", resolve)\n .on(\"error\", reject)\n })\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,IAAI;AACtC,SAASC,QAAQ,QAAQ,QAAQ;AASjC;AACA;AACA;AACA,OAAO,eAAeC,QAAQA,CAAC;EAAEC,KAAK;EAAEC;AAAwB,CAAC,EAAE;EAC/D,MAAM,IAAIC,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;IACzC,MAAMC,SAAS,GAAGR,iBAAiB,CAACI,MAAM,CAAC;IAC3CH,QAAQ,CAACQ,OAAO,CAACN,KAAK,CAACO,MAAM,CAAC,CAAQ,CAAC,CAClCC,IAAI,CAACH,SAAS,CAAC,CACfI,EAAE,CAAC,QAAQ,EAAEN,OAAO,CAAC,CACrBM,EAAE,CAAC,OAAO,EAAEL,MAAM,CAAC;EAC5B,CAAC,CAAC;AACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createWriteStream","Readable","saveResponse","response","file","writeable","Promise","resolve","reject","fromWeb","body","pipe","on"],"sources":["../../../src/utils/saveResponse.ts"],"sourcesContent":["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\n/**\n * 从 Response 对象中下载文件\n * @param response Response 对象\n * @param file 文件路径\n */\nexport async function saveResponse(response: Response, file: string) {\n const writeable = createWriteStream(file)\n await new Promise((resolve, reject) =>\n Readable.fromWeb(response.body! as any)\n .pipe(writeable)\n .on(\"close\", resolve)\n .on(\"error\", reject),\n )\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,IAAI;AACtC,SAASC,QAAQ,QAAQ,QAAQ;;AAEjC;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,YAAYA,CAACC,QAAkB,EAAEC,IAAY,EAAE;EACjE,MAAMC,SAAS,GAAGL,iBAAiB,CAACI,IAAI,CAAC;EACzC,MAAM,IAAIE,OAAO,
|
|
1
|
+
{"version":3,"names":["createWriteStream","Readable","saveResponse","response","file","writeable","Promise","resolve","reject","fromWeb","body","pipe","on"],"sources":["../../../src/utils/saveResponse.ts"],"sourcesContent":["import { createWriteStream } from \"fs\"\nimport { Readable } from \"stream\"\n\n/**\n * 从 Response 对象中下载文件\n * @param response Response 对象\n * @param file 文件路径\n */\nexport async function saveResponse(response: Response, file: string) {\n const writeable = createWriteStream(file)\n await new Promise<void>((resolve, reject) =>\n Readable.fromWeb(response.body! as any)\n .pipe(writeable)\n .on(\"close\", resolve)\n .on(\"error\", reject),\n )\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,IAAI;AACtC,SAASC,QAAQ,QAAQ,QAAQ;;AAEjC;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,YAAYA,CAACC,QAAkB,EAAEC,IAAY,EAAE;EACjE,MAAMC,SAAS,GAAGL,iBAAiB,CAACI,IAAI,CAAC;EACzC,MAAM,IAAIE,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KACpCP,QAAQ,CAACQ,OAAO,CAACN,QAAQ,CAACO,IAAY,CAAC,CAClCC,IAAI,CAACN,SAAS,CAAC,CACfO,EAAE,CAAC,OAAO,EAAEL,OAAO,CAAC,CACpBK,EAAE,CAAC,OAAO,EAAEJ,MAAM,CAC3B,CAAC;AACL"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soda-nodejs",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
8
9
|
"keywords": [],
|
|
9
10
|
"authors": [],
|
|
10
11
|
"license": "MIT",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
},
|
|
24
25
|
"homepage": "https://github.com/1adybug/deepsea/tree/main/packages/soda-nodejs",
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^20.17.
|
|
27
|
+
"@types/node": "^20.17.24",
|
|
27
28
|
"@types/which": "^3.0.4"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export * from "@/utils/compress"
|
|
2
|
+
export * from "@/utils/copy"
|
|
3
|
+
export * from "@/utils/execAsync"
|
|
4
|
+
export * from "@/utils/saveFile"
|
|
5
|
+
export * from "@/utils/saveResponse"
|
|
6
|
+
export * from "@/utils/spawnAsync"
|
|
7
|
+
export * from "@/utils/unzip"
|
|
8
|
+
export * from "@/utils/zip"
|
package/src/utils/saveFile.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type SaveFileOptions = {
|
|
|
12
12
|
* 保存文件
|
|
13
13
|
*/
|
|
14
14
|
export async function saveFile({ input, output }: SaveFileOptions) {
|
|
15
|
-
await new Promise((resolve, reject) => {
|
|
15
|
+
await new Promise<void>((resolve, reject) => {
|
|
16
16
|
const writeAble = createWriteStream(output)
|
|
17
17
|
Readable.fromWeb(input.stream() as any)
|
|
18
18
|
.pipe(writeAble)
|
|
@@ -8,7 +8,7 @@ import { Readable } from "stream"
|
|
|
8
8
|
*/
|
|
9
9
|
export async function saveResponse(response: Response, file: string) {
|
|
10
10
|
const writeable = createWriteStream(file)
|
|
11
|
-
await new Promise((resolve, reject) =>
|
|
11
|
+
await new Promise<void>((resolve, reject) =>
|
|
12
12
|
Readable.fromWeb(response.body! as any)
|
|
13
13
|
.pipe(writeable)
|
|
14
14
|
.on("close", resolve)
|