@willbooster/shared-lib-node 1.0.0 → 1.0.1

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.
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";var s=require("./spawn.js");exports.spawnAsync=s.spawnAsync;
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
File without changes
@@ -1,2 +1,2 @@
1
1
  "use strict";var s=require("node:child_process");exports.spawnAsync=async function(r,t,o){return new Promise(((n,e)=>{try{const d=s.spawn(r,t??[],o??{});let a="",c="";d.stdout?.on("data",(s=>{a+=s})),d.stderr?.on("data",(s=>{c+=s})),d.on("error",(s=>{e(s)})),d.on("close",((s,r)=>{void 0===d.pid?e(new Error("Process has no pid.")):n({pid:d.pid,stdout:a,stderr:c,status:s,signal:r})}))}catch(s){e(s)}}))};
2
- //# sourceMappingURL=index.cjs.map
2
+ //# sourceMappingURL=spawn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.js","sources":["../../src/spawn.ts"],"sourcesContent":["import {\n spawn,\n SpawnOptions,\n SpawnOptionsWithoutStdio,\n SpawnOptionsWithStdioTuple,\n SpawnSyncReturns,\n StdioNull,\n StdioPipe,\n} from 'node:child_process';\n\nexport type SpawnAsyncReturns = Omit<SpawnSyncReturns<string>, 'output' | 'error'>;\n\nexport async function spawnAsync(\n command: string,\n args?: ReadonlyArray<string>,\n options?:\n | SpawnOptionsWithoutStdio\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>\n | SpawnOptions\n): Promise<SpawnAsyncReturns> {\n return new Promise((resolve, reject) => {\n try {\n const proc = spawn(command, args ?? [], options ?? {});\n let stdout = '';\n let stderr = '';\n\n proc.stdout?.on('data', (data) => {\n stdout += data;\n });\n proc.stderr?.on('data', (data) => {\n stderr += data;\n });\n\n proc.on('error', (error) => {\n reject(error);\n });\n proc.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n if (proc.pid === undefined) {\n reject(new Error('Process has no pid.'));\n } else {\n resolve({\n pid: proc.pid,\n stdout,\n stderr,\n status: code,\n signal,\n });\n }\n });\n } catch (error) {\n reject(error);\n }\n });\n}\n"],"names":["async","command","args","options","Promise","resolve","reject","proc","spawn","stdout","stderr","on","data","error","code","signal","undefined","pid","Error","status"],"mappings":"oEAYOA,eACLC,EACAC,EACAC,GAYA,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,IACE,MAAMC,EAAOC,EAAAA,MAAMP,EAASC,GAAQ,GAAIC,GAAW,CAAA,GACnD,IAAIM,EAAS,GACTC,EAAS,GAEbH,EAAKE,QAAQE,GAAG,QAASC,IACvBH,GAAUG,CAAI,IAEhBL,EAAKG,QAAQC,GAAG,QAASC,IACvBF,GAAUE,CAAI,IAGhBL,EAAKI,GAAG,SAAUE,IAChBP,EAAOO,EAAM,IAEfN,EAAKI,GAAG,SAAS,CAACG,EAAqBC,UACpBC,IAAbT,EAAKU,IACPX,EAAO,IAAIY,MAAM,wBAEjBb,EAAQ,CACNY,IAAKV,EAAKU,IACVR,SACAC,SACAS,OAAQL,EACRC,UAEJ,GAIJ,CAFE,MAAOF,GACPP,EAAOO,EACT,IAEJ"}
@@ -0,0 +1 @@
1
+ export { spawnAsync } from "./spawn.js";
@@ -0,0 +1,2 @@
1
+ export{spawnAsync}from"./spawn.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { SpawnOptions, SpawnOptionsWithoutStdio, SpawnOptionsWithStdioTuple, SpawnSyncReturns, StdioNull, StdioPipe } from "node:child_process";
3
- type SpawnAsyncReturns = Omit<SpawnSyncReturns<string>, "output" | "error">;
2
+ import { SpawnOptions, SpawnOptionsWithoutStdio, SpawnOptionsWithStdioTuple, SpawnSyncReturns, StdioNull, StdioPipe } from 'node:child_process';
3
+ type SpawnAsyncReturns = Omit<SpawnSyncReturns<string>, 'output' | 'error'>;
4
4
  declare function spawnAsync(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe> | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull> | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe> | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe> | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull> | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull> | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe> | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull> | SpawnOptions): Promise<SpawnAsyncReturns>;
5
- export { spawnAsync };
5
+ export { SpawnAsyncReturns, spawnAsync };
@@ -1,2 +1,2 @@
1
1
  import{spawn as o}from"node:child_process";async function r(r,t,s){return new Promise(((n,d)=>{try{const e=o(r,t??[],s??{});let i="",a="";e.stdout?.on("data",(o=>{i+=o})),e.stderr?.on("data",(o=>{a+=o})),e.on("error",(o=>{d(o)})),e.on("close",((o,r)=>{void 0===e.pid?d(new Error("Process has no pid.")):n({pid:e.pid,stdout:i,stderr:a,status:o,signal:r})}))}catch(o){d(o)}}))}export{r as spawnAsync};
2
- //# sourceMappingURL=spawn.mjs.map
2
+ //# sourceMappingURL=spawn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.js","sources":["../../src/spawn.ts"],"sourcesContent":["import {\n spawn,\n SpawnOptions,\n SpawnOptionsWithoutStdio,\n SpawnOptionsWithStdioTuple,\n SpawnSyncReturns,\n StdioNull,\n StdioPipe,\n} from 'node:child_process';\n\nexport type SpawnAsyncReturns = Omit<SpawnSyncReturns<string>, 'output' | 'error'>;\n\nexport async function spawnAsync(\n command: string,\n args?: ReadonlyArray<string>,\n options?:\n | SpawnOptionsWithoutStdio\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>\n | SpawnOptions\n): Promise<SpawnAsyncReturns> {\n return new Promise((resolve, reject) => {\n try {\n const proc = spawn(command, args ?? [], options ?? {});\n let stdout = '';\n let stderr = '';\n\n proc.stdout?.on('data', (data) => {\n stdout += data;\n });\n proc.stderr?.on('data', (data) => {\n stderr += data;\n });\n\n proc.on('error', (error) => {\n reject(error);\n });\n proc.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n if (proc.pid === undefined) {\n reject(new Error('Process has no pid.'));\n } else {\n resolve({\n pid: proc.pid,\n stdout,\n stderr,\n status: code,\n signal,\n });\n }\n });\n } catch (error) {\n reject(error);\n }\n });\n}\n"],"names":["async","spawnAsync","command","args","options","Promise","resolve","reject","proc","spawn","stdout","stderr","on","data","error","code","signal","undefined","pid","Error","status"],"mappings":"2CAYOA,eAAeC,EACpBC,EACAC,EACAC,GAYA,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,IACE,MAAMC,EAAOC,EAAMP,EAASC,GAAQ,GAAIC,GAAW,CAAA,GACnD,IAAIM,EAAS,GACTC,EAAS,GAEbH,EAAKE,QAAQE,GAAG,QAASC,IACvBH,GAAUG,CAAI,IAEhBL,EAAKG,QAAQC,GAAG,QAASC,IACvBF,GAAUE,CAAI,IAGhBL,EAAKI,GAAG,SAAUE,IAChBP,EAAOO,EAAM,IAEfN,EAAKI,GAAG,SAAS,CAACG,EAAqBC,UACpBC,IAAbT,EAAKU,IACPX,EAAO,IAAIY,MAAM,wBAEjBb,EAAQ,CACNY,IAAKV,EAAKU,IACVR,SACAC,SACAS,OAAQL,EACRC,UAEJ,GAIJ,CAFE,MAAOF,GACPP,EAAOO,EACT,IAEJ"}
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@willbooster/shared-lib-node",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "Apache-2.0",
5
5
  "author": "WillBooster Inc.",
6
6
  "sideEffects": false,
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/esm/index.d.mts",
11
- "require": "./dist/cjs/index.cjs",
12
- "import": "./dist/esm/index.mjs"
10
+ "types": "./dist/esm/index.d.ts",
11
+ "require": "./dist/cjs/index.js",
12
+ "import": "./dist/esm/index.js"
13
13
  }
14
14
  },
15
- "main": "dist/cjs/index.cjs",
16
- "module": "dist/esm/index.mjs",
17
- "types": "dist/cjs/index.d.cts",
15
+ "main": "dist/cjs/index.js",
16
+ "module": "dist/esm/index.js",
17
+ "types": "dist/cjs/index.d.ts",
18
18
  "files": [
19
19
  "bin/",
20
20
  "dist/"
@@ -34,11 +34,11 @@
34
34
  "@types/eslint": "8.4.10",
35
35
  "@types/micromatch": "4.0.2",
36
36
  "@types/prettier": "2.7.2",
37
- "@typescript-eslint/eslint-plugin": "5.49.0",
38
- "@typescript-eslint/parser": "5.49.0",
37
+ "@typescript-eslint/eslint-plugin": "5.50.0",
38
+ "@typescript-eslint/parser": "5.50.0",
39
39
  "@willbooster/eslint-config-ts": "10.0.8",
40
40
  "@willbooster/prettier-config": "9.1.1",
41
- "build-ts": "5.1.0",
41
+ "build-ts": "5.3.2",
42
42
  "eslint": "8.33.0",
43
43
  "eslint-config-prettier": "8.6.0",
44
44
  "eslint-import-resolver-typescript": "3.5.3",
@@ -50,7 +50,7 @@
50
50
  "micromatch": "4.0.5",
51
51
  "prettier": "2.8.3",
52
52
  "sort-package-json": "2.3.0",
53
- "typescript": "4.9.4",
53
+ "typescript": "4.9.5",
54
54
  "vitest": "0.28.3"
55
55
  },
56
56
  "publishConfig": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/spawn.ts"],"sourcesContent":["import {\n spawn,\n SpawnOptions,\n SpawnOptionsWithoutStdio,\n SpawnOptionsWithStdioTuple,\n SpawnSyncReturns,\n StdioNull,\n StdioPipe,\n} from 'node:child_process';\n\nexport type SpawnAsyncReturns = Omit<SpawnSyncReturns<string>, 'output' | 'error'>;\n\nexport async function spawnAsync(\n command: string,\n args?: ReadonlyArray<string>,\n options?:\n | SpawnOptionsWithoutStdio\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>\n | SpawnOptions\n): Promise<SpawnAsyncReturns> {\n return new Promise((resolve, reject) => {\n try {\n const proc = spawn(command, args ?? [], options ?? {});\n let stdout = '';\n let stderr = '';\n\n proc.stdout?.on('data', (data) => {\n stdout += data;\n });\n proc.stderr?.on('data', (data) => {\n stderr += data;\n });\n\n proc.on('error', (error) => {\n reject(error);\n });\n proc.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n if (proc.pid === undefined) {\n reject(new Error('Process has no pid.'));\n } else {\n resolve({\n pid: proc.pid,\n stdout,\n stderr,\n status: code,\n signal,\n });\n }\n });\n } catch (error) {\n reject(error);\n }\n });\n}\n"],"names":["async","command","args","options","Promise","resolve","reject","proc","spawn","stdout","stderr","on","data","error","code","signal","undefined","pid","Error","status"],"mappings":"oEAYOA,eACLC,EACAC,EACAC,GAYA,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,IACE,MAAMC,EAAOC,EAAAA,MAAMP,EAASC,GAAQ,GAAIC,GAAW,CAAA,GACnD,IAAIM,EAAS,GACTC,EAAS,GAEbH,EAAKE,QAAQE,GAAG,QAASC,IACvBH,GAAUG,CAAI,IAEhBL,EAAKG,QAAQC,GAAG,QAASC,IACvBF,GAAUE,CAAI,IAGhBL,EAAKI,GAAG,SAAUE,IAChBP,EAAOO,EAAM,IAEfN,EAAKI,GAAG,SAAS,CAACG,EAAqBC,UACpBC,IAAbT,EAAKU,IACPX,EAAO,IAAIY,MAAM,wBAEjBb,EAAQ,CACNY,IAAKV,EAAKU,IACVR,SACAC,SACAS,OAAQL,EACRC,UAEJ,GAIJ,CAFE,MAAOF,GACPP,EAAOO,EACT,IAEJ"}
@@ -1,2 +0,0 @@
1
- export{spawnAsync}from"./spawn.mjs";
2
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawn.mjs","sources":["../../src/spawn.ts"],"sourcesContent":["import {\n spawn,\n SpawnOptions,\n SpawnOptionsWithoutStdio,\n SpawnOptionsWithStdioTuple,\n SpawnSyncReturns,\n StdioNull,\n StdioPipe,\n} from 'node:child_process';\n\nexport type SpawnAsyncReturns = Omit<SpawnSyncReturns<string>, 'output' | 'error'>;\n\nexport async function spawnAsync(\n command: string,\n args?: ReadonlyArray<string>,\n options?:\n | SpawnOptionsWithoutStdio\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>\n | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>\n | SpawnOptions\n): Promise<SpawnAsyncReturns> {\n return new Promise((resolve, reject) => {\n try {\n const proc = spawn(command, args ?? [], options ?? {});\n let stdout = '';\n let stderr = '';\n\n proc.stdout?.on('data', (data) => {\n stdout += data;\n });\n proc.stderr?.on('data', (data) => {\n stderr += data;\n });\n\n proc.on('error', (error) => {\n reject(error);\n });\n proc.on('close', (code: number | null, signal: NodeJS.Signals | null) => {\n if (proc.pid === undefined) {\n reject(new Error('Process has no pid.'));\n } else {\n resolve({\n pid: proc.pid,\n stdout,\n stderr,\n status: code,\n signal,\n });\n }\n });\n } catch (error) {\n reject(error);\n }\n });\n}\n"],"names":["async","spawnAsync","command","args","options","Promise","resolve","reject","proc","spawn","stdout","stderr","on","data","error","code","signal","undefined","pid","Error","status"],"mappings":"2CAYOA,eAAeC,EACpBC,EACAC,EACAC,GAYA,OAAO,IAAIC,SAAQ,CAACC,EAASC,KAC3B,IACE,MAAMC,EAAOC,EAAMP,EAASC,GAAQ,GAAIC,GAAW,CAAA,GACnD,IAAIM,EAAS,GACTC,EAAS,GAEbH,EAAKE,QAAQE,GAAG,QAASC,IACvBH,GAAUG,CAAI,IAEhBL,EAAKG,QAAQC,GAAG,QAASC,IACvBF,GAAUE,CAAI,IAGhBL,EAAKI,GAAG,SAAUE,IAChBP,EAAOO,EAAM,IAEfN,EAAKI,GAAG,SAAS,CAACG,EAAqBC,UACpBC,IAAbT,EAAKU,IACPX,EAAO,IAAIY,MAAM,wBAEjBb,EAAQ,CACNY,IAAKV,EAAKU,IACVR,SACAC,SACAS,OAAQL,EACRC,UAEJ,GAIJ,CAFE,MAAOF,GACPP,EAAOO,EACT,IAEJ"}