soda-nodejs 0.8.2 → 0.8.3

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/README.md CHANGED
@@ -1,23 +1,23 @@
1
- # soda-node
2
-
3
- [![NPM version](https://img.shields.io/npm/v/soda-node.svg?style=flat)](https://npmjs.com/package/soda-node)
4
- [![NPM downloads](http://img.shields.io/npm/dm/soda-node.svg?style=flat)](https://npmjs.com/package/soda-node)
5
-
6
- ## Install
7
-
8
- ```bash
9
- $ pnpm install
10
- ```
11
-
12
- ```bash
13
- $ npm run dev
14
- $ npm run build
15
- ```
16
-
17
- ## Options
18
-
19
- TODO
20
-
21
- ## LICENSE
22
-
23
- MIT
1
+ # soda-node
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/soda-node.svg?style=flat)](https://npmjs.com/package/soda-node)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/soda-node.svg?style=flat)](https://npmjs.com/package/soda-node)
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ $ pnpm install
10
+ ```
11
+
12
+ ```bash
13
+ $ npm run dev
14
+ $ npm run build
15
+ ```
16
+
17
+ ## Options
18
+
19
+ TODO
20
+
21
+ ## LICENSE
22
+
23
+ MIT
@@ -1,20 +1,20 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
- import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
3
- import * as __WEBPACK_EXTERNAL_MODULE_tar__ from "tar";
1
+ import { existsSync, mkdirSync } from "fs";
2
+ import { basename, dirname, resolve } from "path";
3
+ import { create } from "tar";
4
4
  async function compress({ input, output }) {
5
- input = (0, __WEBPACK_EXTERNAL_MODULE_path__.resolve)(input);
6
- if (!(0, __WEBPACK_EXTERNAL_MODULE_fs__.existsSync)(input)) throw new Error("Source folder does not exist");
7
- const outputDir = (0, __WEBPACK_EXTERNAL_MODULE_path__.dirname)(output);
8
- if (!(0, __WEBPACK_EXTERNAL_MODULE_fs__.existsSync)(outputDir)) (0, __WEBPACK_EXTERNAL_MODULE_fs__.mkdirSync)(outputDir, {
5
+ input = resolve(input);
6
+ if (!existsSync(input)) throw new Error("Source folder does not exist");
7
+ const outputDir = dirname(output);
8
+ if (!existsSync(outputDir)) mkdirSync(outputDir, {
9
9
  recursive: true
10
10
  });
11
- await (0, __WEBPACK_EXTERNAL_MODULE_tar__.create)({
11
+ await create({
12
12
  gzip: true,
13
13
  file: output,
14
- cwd: (0, __WEBPACK_EXTERNAL_MODULE_path__.dirname)(input)
14
+ cwd: dirname(input)
15
15
  }, [
16
- (0, __WEBPACK_EXTERNAL_MODULE_path__.basename)(input)
16
+ basename(input)
17
17
  ]);
18
- return (0, __WEBPACK_EXTERNAL_MODULE_path__.resolve)(output);
18
+ return resolve(output);
19
19
  }
20
20
  export { compress };
@@ -43,10 +43,7 @@ async function copy({ input, output, mode }) {
43
43
  });
44
44
  const status = await (0, promises_namespaceObject.stat)(input);
45
45
  const { base } = (0, external_path_namespaceObject.parse)(input);
46
- if (status.isFile()) {
47
- await (0, promises_namespaceObject.copyFile)(input, (0, external_path_namespaceObject.join)(output, base), mode);
48
- return;
49
- }
46
+ if (status.isFile()) return void await (0, promises_namespaceObject.copyFile)(input, (0, external_path_namespaceObject.join)(output, base), mode);
50
47
  if (status.isDirectory()) {
51
48
  await (0, promises_namespaceObject.mkdir)((0, external_path_namespaceObject.join)(output, base), {
52
49
  recursive: true
@@ -1,6 +1,6 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
- import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__ from "fs/promises";
3
- import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
1
+ import { existsSync } from "fs";
2
+ import { copyFile, mkdir, readdir, stat } from "fs/promises";
3
+ import { join, parse } from "path";
4
4
  async function copy({ input, output, mode }) {
5
5
  if (Array.isArray(input)) {
6
6
  for (const item of input)await copy({
@@ -10,25 +10,22 @@ async function copy({ input, output, mode }) {
10
10
  });
11
11
  return;
12
12
  }
13
- if (!(0, __WEBPACK_EXTERNAL_MODULE_fs__.existsSync)(output)) await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.mkdir)(output, {
13
+ if (!existsSync(output)) await mkdir(output, {
14
14
  recursive: true
15
15
  });
16
- const status = await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.stat)(input);
17
- const { base } = (0, __WEBPACK_EXTERNAL_MODULE_path__.parse)(input);
18
- if (status.isFile()) {
19
- await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.copyFile)(input, (0, __WEBPACK_EXTERNAL_MODULE_path__.join)(output, base), mode);
20
- return;
21
- }
16
+ const status = await stat(input);
17
+ const { base } = parse(input);
18
+ if (status.isFile()) return void await copyFile(input, join(output, base), mode);
22
19
  if (status.isDirectory()) {
23
- await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.mkdir)((0, __WEBPACK_EXTERNAL_MODULE_path__.join)(output, base), {
20
+ await mkdir(join(output, base), {
24
21
  recursive: true
25
22
  });
26
- const entries = await (0, __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__.readdir)(input, {
23
+ const entries = await readdir(input, {
27
24
  withFileTypes: true
28
25
  });
29
26
  for (const entry of entries)await copy({
30
- input: (0, __WEBPACK_EXTERNAL_MODULE_path__.join)(input, entry.name),
31
- output: (0, __WEBPACK_EXTERNAL_MODULE_path__.join)(output, base),
27
+ input: join(input, entry.name),
28
+ output: join(output, base),
32
29
  mode
33
30
  });
34
31
  }
@@ -1,5 +1,5 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
2
- import * as __WEBPACK_EXTERNAL_MODULE_iconv_lite_e3756a92__ from "iconv-lite";
1
+ import { exec } from "child_process";
2
+ import iconv_lite from "iconv-lite";
3
3
  async function execAsync(command, options) {
4
4
  const decode = options?.decode;
5
5
  if ("object" == typeof options && null !== options && options.decode) {
@@ -7,9 +7,9 @@ async function execAsync(command, options) {
7
7
  options = rest;
8
8
  }
9
9
  return await new Promise((resolve, reject)=>{
10
- (0, __WEBPACK_EXTERNAL_MODULE_child_process__.exec)(command, options, (error, stdout, stderr)=>{
10
+ exec(command, options, (error, stdout, stderr)=>{
11
11
  if (error) return reject(error);
12
- if (decode && stdout instanceof Buffer) return resolve(__WEBPACK_EXTERNAL_MODULE_iconv_lite_e3756a92__["default"].decode(stdout, decode.encoding, decode.options));
12
+ if (decode && stdout instanceof Buffer) return resolve(iconv_lite.decode(stdout, decode.encoding, decode.options));
13
13
  resolve(stdout);
14
14
  });
15
15
  });
@@ -1,9 +1,9 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
- import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
1
+ import { createWriteStream } from "fs";
2
+ import { Readable } from "stream";
3
3
  async function saveFile({ input, output }) {
4
4
  await new Promise((resolve, reject)=>{
5
- const writeAble = (0, __WEBPACK_EXTERNAL_MODULE_fs__.createWriteStream)(output);
6
- __WEBPACK_EXTERNAL_MODULE_stream__.Readable.fromWeb(input.stream()).pipe(writeAble).on("finish", resolve).on("error", reject);
5
+ const writeAble = createWriteStream(output);
6
+ Readable.fromWeb(input.stream()).pipe(writeAble).on("finish", resolve).on("error", reject);
7
7
  });
8
8
  }
9
9
  export { saveFile };
@@ -1,7 +1,7 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
2
- import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
1
+ import { createWriteStream } from "fs";
2
+ import { Readable } from "stream";
3
3
  async function saveResponse(response, file) {
4
- const writeable = (0, __WEBPACK_EXTERNAL_MODULE_fs__.createWriteStream)(file);
5
- await new Promise((resolve, reject)=>__WEBPACK_EXTERNAL_MODULE_stream__.Readable.fromWeb(response.body).pipe(writeable).on("close", resolve).on("error", reject));
4
+ const writeable = createWriteStream(file);
5
+ await new Promise((resolve, reject)=>Readable.fromWeb(response.body).pipe(writeable).on("close", resolve).on("error", reject));
6
6
  }
7
7
  export { saveResponse };
@@ -25,8 +25,8 @@ var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  getDefaultOptions: ()=>getDefaultOptions,
28
- spawnAsync: ()=>spawnAsync,
29
- setDefaultOptions: ()=>setDefaultOptions
28
+ setDefaultOptions: ()=>setDefaultOptions,
29
+ spawnAsync: ()=>spawnAsync
30
30
  });
31
31
  const external_child_process_namespaceObject = require("child_process");
32
32
  let defaultOptions = {};
@@ -1,4 +1,4 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
1
+ import { spawn } from "child_process";
2
2
  let defaultOptions = {};
3
3
  function getDefaultOptions() {
4
4
  return defaultOptions;
@@ -22,7 +22,7 @@ function spawnAsync(command, args, options) {
22
22
  ...defaultOptions,
23
23
  ...args
24
24
  };
25
- child = (0, __WEBPACK_EXTERNAL_MODULE_child_process__.spawn)(command, args, options);
25
+ child = spawn(command, args, options);
26
26
  child.on("exit", (code)=>{
27
27
  if (0 === code) return resolve(child);
28
28
  if (Array.isArray(args)) {
@@ -1,8 +1,8 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_which__ from "which";
2
- import * as __WEBPACK_EXTERNAL_MODULE__execAsync_js_bec93fa3__ from "./execAsync.js";
1
+ import which from "which";
2
+ import { execAsync } from "./execAsync.js";
3
3
  async function unzip({ input, output, cwd }) {
4
- await (0, __WEBPACK_EXTERNAL_MODULE_which__["default"])("7z");
5
- return await (0, __WEBPACK_EXTERNAL_MODULE__execAsync_js_bec93fa3__.execAsync)(`7z x ${input} -o${output}`, {
4
+ await which("7z");
5
+ return await execAsync(`7z x ${input} -o${output}`, {
6
6
  cwd
7
7
  });
8
8
  }
package/dist/utils/zip.js CHANGED
@@ -1,11 +1,11 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_os__ from "os";
2
- import * as __WEBPACK_EXTERNAL_MODULE_which__ from "which";
3
- import * as __WEBPACK_EXTERNAL_MODULE__execAsync_js_bec93fa3__ from "./execAsync.js";
1
+ import { cpus } from "os";
2
+ import which from "which";
3
+ import { execAsync } from "./execAsync.js";
4
4
  async function zip({ input, output, thread = "auto", level, password, cwd }) {
5
- await (0, __WEBPACK_EXTERNAL_MODULE_which__["default"])("7z");
5
+ await which("7z");
6
6
  input = Array.isArray(input) ? input.join(" ") : input;
7
- if ("max" === thread) thread = (0, __WEBPACK_EXTERNAL_MODULE_os__.cpus)().length;
8
- return await (0, __WEBPACK_EXTERNAL_MODULE__execAsync_js_bec93fa3__.execAsync)(`7z a ${output} ${input} -mmt=${"auto" === thread ? "on" : thread}${"number" == typeof level ? ` -mx=${level}` : ""}${password ? ` -p${password}` : ""}`, {
7
+ if ("max" === thread) thread = cpus().length;
8
+ return await execAsync(`7z a ${output} ${input} -mmt=${"auto" === thread ? "on" : thread}${"number" == typeof level ? ` -mx=${level}` : ""}${password ? ` -p${password}` : ""}`, {
9
9
  cwd
10
10
  });
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soda-nodejs",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -40,9 +40,9 @@
40
40
  "which": "^5.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@types/node": "^22.16.3",
43
+ "@types/node": "^22.17.0",
44
44
  "@types/which": "^3.0.4",
45
- "typescript": "^5.8.3"
45
+ "typescript": "^5.9.2"
46
46
  },
47
47
  "peerDependencies": {},
48
48
  "scripts": {
@@ -1,37 +1,37 @@
1
- import { existsSync, mkdirSync } from "fs"
2
- import { basename, dirname, resolve } from "path"
3
- import { create } from "tar"
4
-
5
- export interface CompressionParams {
6
- /**
7
- * 需要压缩的文件夹
8
- */
9
- input: string
10
- /**
11
- * 压缩后的文件路径
12
- */
13
- output: string
14
- }
15
-
16
- export async function compress({ input, output }: CompressionParams) {
17
- input = resolve(input)
18
-
19
- // 确保源路径存在
20
- if (!existsSync(input)) throw new Error("Source folder does not exist")
21
-
22
- // 确保输出目录存在
23
- const outputDir = dirname(output)
24
- if (!existsSync(outputDir)) mkdirSync(outputDir, { recursive: true })
25
-
26
- // 执行压缩
27
- await create(
28
- {
29
- gzip: true, // 使用 gzip 压缩
30
- file: output, // 输出文件路径
31
- cwd: dirname(input), // 设置工作目录
32
- },
33
- [basename(input)], // 要压缩的文件夹名
34
- )
35
-
36
- return resolve(output)
37
- }
1
+ import { existsSync, mkdirSync } from "fs"
2
+ import { basename, dirname, resolve } from "path"
3
+ import { create } from "tar"
4
+
5
+ export interface CompressionParams {
6
+ /**
7
+ * 需要压缩的文件夹
8
+ */
9
+ input: string
10
+ /**
11
+ * 压缩后的文件路径
12
+ */
13
+ output: string
14
+ }
15
+
16
+ export async function compress({ input, output }: CompressionParams) {
17
+ input = resolve(input)
18
+
19
+ // 确保源路径存在
20
+ if (!existsSync(input)) throw new Error("Source folder does not exist")
21
+
22
+ // 确保输出目录存在
23
+ const outputDir = dirname(output)
24
+ if (!existsSync(outputDir)) mkdirSync(outputDir, { recursive: true })
25
+
26
+ // 执行压缩
27
+ await create(
28
+ {
29
+ gzip: true, // 使用 gzip 压缩
30
+ file: output, // 输出文件路径
31
+ cwd: dirname(input), // 设置工作目录
32
+ },
33
+ [basename(input)], // 要压缩的文件夹名
34
+ )
35
+
36
+ return resolve(output)
37
+ }
package/src/utils/copy.ts CHANGED
@@ -1,37 +1,37 @@
1
- import { existsSync } from "fs"
2
- import { copyFile, mkdir, readdir, stat } from "fs/promises"
3
- import { join, parse } from "path"
4
-
5
- export type CopyOptions = {
6
- /** 源文件夹 */
7
- input: string | string[]
8
- /** 存放的文件夹 */
9
- output: string
10
- /** 文件权限 */
11
- mode?: number
12
- }
13
-
14
- export async function copy({ input, output, mode }: CopyOptions) {
15
- if (Array.isArray(input)) {
16
- for (const item of input) await copy({ input: item, output, mode })
17
- return
18
- }
19
- if (!existsSync(output)) await mkdir(output, { recursive: true })
20
- const status = await stat(input)
21
- const { base } = parse(input)
22
- if (status.isFile()) {
23
- await copyFile(input, join(output, base), mode)
24
- return
25
- }
26
- if (status.isDirectory()) {
27
- await mkdir(join(output, base), { recursive: true })
28
- const entries = await readdir(input, { withFileTypes: true })
29
- for (const entry of entries) {
30
- await copy({
31
- input: join(input, entry.name),
32
- output: join(output, base),
33
- mode,
34
- })
35
- }
36
- }
37
- }
1
+ import { existsSync } from "fs"
2
+ import { copyFile, mkdir, readdir, stat } from "fs/promises"
3
+ import { join, parse } from "path"
4
+
5
+ export type CopyOptions = {
6
+ /** 源文件夹 */
7
+ input: string | string[]
8
+ /** 存放的文件夹 */
9
+ output: string
10
+ /** 文件权限 */
11
+ mode?: number
12
+ }
13
+
14
+ export async function copy({ input, output, mode }: CopyOptions) {
15
+ if (Array.isArray(input)) {
16
+ for (const item of input) await copy({ input: item, output, mode })
17
+ return
18
+ }
19
+ if (!existsSync(output)) await mkdir(output, { recursive: true })
20
+ const status = await stat(input)
21
+ const { base } = parse(input)
22
+ if (status.isFile()) {
23
+ await copyFile(input, join(output, base), mode)
24
+ return
25
+ }
26
+ if (status.isDirectory()) {
27
+ await mkdir(join(output, base), { recursive: true })
28
+ const entries = await readdir(input, { withFileTypes: true })
29
+ for (const entry of entries) {
30
+ await copy({
31
+ input: join(input, entry.name),
32
+ output: join(output, base),
33
+ mode,
34
+ })
35
+ }
36
+ }
37
+ }
@@ -1,36 +1,36 @@
1
- import { ExecOptions, exec } from "child_process"
2
- import { ObjectEncodingOptions } from "fs"
3
- import iconv, { Options } from "iconv-lite"
4
-
5
- export type IconvDecodeOptions = {
6
- encoding: string
7
- options?: Options
8
- }
9
-
10
- export async function execAsync(command: string): Promise<string>
11
- export async function execAsync(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<Buffer>
12
- export async function execAsync(command: string, options: { encoding: "buffer" | null } & ExecOptions & { decode: IconvDecodeOptions }): Promise<string>
13
- export async function execAsync(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<string>
14
- export async function execAsync(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<string | Buffer>
15
- export async function execAsync(command: string, options: { encoding: BufferEncoding } & ExecOptions & { decode: IconvDecodeOptions }): Promise<string>
16
- export async function execAsync(command: string, options: ExecOptions): Promise<string>
17
- export async function execAsync(command: string, options: (ObjectEncodingOptions & ExecOptions) | undefined | null): Promise<string | Buffer>
18
- export async function execAsync(
19
- command: string,
20
- options: (ObjectEncodingOptions & ExecOptions & { decode: IconvDecodeOptions }) | undefined | null,
21
- ): Promise<string>
22
- export async function execAsync(command: string, options?: any) {
23
- const decode = options?.decode as IconvDecodeOptions | undefined
24
- if (typeof options === "object" && options !== null && options.decode) {
25
- const { decode, ...rest } = options as { decode: IconvDecodeOptions }
26
- options = rest
27
- }
28
- return await new Promise<string | Buffer>((resolve, reject) => {
29
- exec(command, options, (error, stdout, stderr) => {
30
- if (error) return reject(error)
31
- // if (stderr) console.warn(stderr)
32
- if (decode && stdout instanceof Buffer) return resolve(iconv.decode(stdout, decode.encoding, decode.options))
33
- resolve(stdout)
34
- })
35
- })
36
- }
1
+ import { ExecOptions, exec } from "child_process"
2
+ import { ObjectEncodingOptions } from "fs"
3
+ import iconv, { Options } from "iconv-lite"
4
+
5
+ export type IconvDecodeOptions = {
6
+ encoding: string
7
+ options?: Options
8
+ }
9
+
10
+ export async function execAsync(command: string): Promise<string>
11
+ export async function execAsync(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<Buffer>
12
+ export async function execAsync(command: string, options: { encoding: "buffer" | null } & ExecOptions & { decode: IconvDecodeOptions }): Promise<string>
13
+ export async function execAsync(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<string>
14
+ export async function execAsync(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<string | Buffer>
15
+ export async function execAsync(command: string, options: { encoding: BufferEncoding } & ExecOptions & { decode: IconvDecodeOptions }): Promise<string>
16
+ export async function execAsync(command: string, options: ExecOptions): Promise<string>
17
+ export async function execAsync(command: string, options: (ObjectEncodingOptions & ExecOptions) | undefined | null): Promise<string | Buffer>
18
+ export async function execAsync(
19
+ command: string,
20
+ options: (ObjectEncodingOptions & ExecOptions & { decode: IconvDecodeOptions }) | undefined | null,
21
+ ): Promise<string>
22
+ export async function execAsync(command: string, options?: any) {
23
+ const decode = options?.decode as IconvDecodeOptions | undefined
24
+ if (typeof options === "object" && options !== null && options.decode) {
25
+ const { decode, ...rest } = options as { decode: IconvDecodeOptions }
26
+ options = rest
27
+ }
28
+ return await new Promise<string | Buffer>((resolve, reject) => {
29
+ exec(command, options, (error, stdout, stderr) => {
30
+ if (error) return reject(error)
31
+ // if (stderr) console.warn(stderr)
32
+ if (decode && stdout instanceof Buffer) return resolve(iconv.decode(stdout, decode.encoding, decode.options))
33
+ resolve(stdout)
34
+ })
35
+ })
36
+ }
@@ -1,22 +1,22 @@
1
- import { createWriteStream } from "fs"
2
- import { Readable } from "stream"
3
-
4
- export type SaveFileOptions = {
5
- /** 要保存的文件 */
6
- input: File
7
- /** 保存文件的目标位置 */
8
- output: string
9
- }
10
-
11
- /**
12
- * 保存文件
13
- */
14
- export async function saveFile({ input, output }: SaveFileOptions) {
15
- await new Promise<void>((resolve, reject) => {
16
- const writeAble = createWriteStream(output)
17
- Readable.fromWeb(input.stream() as any)
18
- .pipe(writeAble)
19
- .on("finish", resolve)
20
- .on("error", reject)
21
- })
22
- }
1
+ import { createWriteStream } from "fs"
2
+ import { Readable } from "stream"
3
+
4
+ export type SaveFileOptions = {
5
+ /** 要保存的文件 */
6
+ input: File
7
+ /** 保存文件的目标位置 */
8
+ output: string
9
+ }
10
+
11
+ /**
12
+ * 保存文件
13
+ */
14
+ export async function saveFile({ input, output }: SaveFileOptions) {
15
+ await new Promise<void>((resolve, reject) => {
16
+ const writeAble = createWriteStream(output)
17
+ Readable.fromWeb(input.stream() as any)
18
+ .pipe(writeAble)
19
+ .on("finish", resolve)
20
+ .on("error", reject)
21
+ })
22
+ }
@@ -1,17 +1,17 @@
1
- import { createWriteStream } from "fs"
2
- import { Readable } from "stream"
3
-
4
- /**
5
- * 从 Response 对象中下载文件
6
- * @param response Response 对象
7
- * @param file 文件路径
8
- */
9
- export async function saveResponse(response: Response, file: string) {
10
- const writeable = createWriteStream(file)
11
- await new Promise<void>((resolve, reject) =>
12
- Readable.fromWeb(response.body! as any)
13
- .pipe(writeable)
14
- .on("close", resolve)
15
- .on("error", reject),
16
- )
17
- }
1
+ import { createWriteStream } from "fs"
2
+ import { Readable } from "stream"
3
+
4
+ /**
5
+ * 从 Response 对象中下载文件
6
+ * @param response Response 对象
7
+ * @param file 文件路径
8
+ */
9
+ export async function saveResponse(response: Response, file: string) {
10
+ const writeable = createWriteStream(file)
11
+ await new Promise<void>((resolve, reject) =>
12
+ Readable.fromWeb(response.body! as any)
13
+ .pipe(writeable)
14
+ .on("close", resolve)
15
+ .on("error", reject),
16
+ )
17
+ }
@@ -1,156 +1,156 @@
1
- import {
2
- ChildProcess,
3
- ChildProcessByStdio,
4
- ChildProcessWithoutNullStreams,
5
- SpawnOptions,
6
- SpawnOptionsWithStdioTuple,
7
- SpawnOptionsWithoutStdio,
8
- StdioNull,
9
- StdioPipe,
10
- spawn,
11
- } from "child_process"
12
- import { Readable, Writable } from "stream"
13
-
14
- export interface PromiseWithChildProcess<T> extends Promise<T> {
15
- child: T
16
- }
17
-
18
- export type Options =
19
- | SpawnOptionsWithoutStdio
20
- | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>
21
- | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>
22
- | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>
23
- | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>
24
- | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>
25
- | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>
26
- | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>
27
- | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>
28
- | SpawnOptions
29
-
30
- let defaultOptions: Options = {}
31
-
32
- /**
33
- * @description get default options for spawnAsync
34
- * @returns {Options} options
35
- */
36
- export function getDefaultOptions(): Options {
37
- return defaultOptions
38
- }
39
-
40
- /**
41
- * @description set default options for spawnAsync
42
- * @param {Options | ((prev: Options) => Options)} options
43
- */
44
- export function setDefaultOptions(options: Options | ((prev: Options) => Options)) {
45
- if (typeof options === "function") {
46
- defaultOptions = options(defaultOptions)
47
- return
48
- }
49
- defaultOptions = options
50
- return defaultOptions
51
- }
52
-
53
- export function spawnAsync(command: string, options?: SpawnOptionsWithoutStdio): PromiseWithChildProcess<ChildProcessWithoutNullStreams>
54
- export function spawnAsync(
55
- command: string,
56
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
57
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, Readable>>
58
- export function spawnAsync(
59
- command: string,
60
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
61
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, null>>
62
- export function spawnAsync(
63
- command: string,
64
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
65
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, Readable>>
66
- export function spawnAsync(
67
- command: string,
68
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
69
- ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, Readable>>
70
- export function spawnAsync(
71
- command: string,
72
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
73
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, null>>
74
- export function spawnAsync(
75
- command: string,
76
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
77
- ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, null>>
78
- export function spawnAsync(
79
- command: string,
80
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
81
- ): PromiseWithChildProcess<ChildProcessByStdio<null, null, Readable>>
82
- export function spawnAsync(
83
- command: string,
84
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
85
- ): PromiseWithChildProcess<ChildProcessByStdio<null, null, null>>
86
- export function spawnAsync(command: string, options: SpawnOptions): PromiseWithChildProcess<ChildProcess>
87
- export function spawnAsync(
88
- command: string,
89
- args?: readonly string[],
90
- options?: SpawnOptionsWithoutStdio,
91
- ): PromiseWithChildProcess<ChildProcessWithoutNullStreams>
92
- export function spawnAsync(
93
- command: string,
94
- args: readonly string[],
95
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
96
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, Readable>>
97
- export function spawnAsync(
98
- command: string,
99
- args: readonly string[],
100
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
101
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, null>>
102
- export function spawnAsync(
103
- command: string,
104
- args: readonly string[],
105
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
106
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, Readable>>
107
- export function spawnAsync(
108
- command: string,
109
- args: readonly string[],
110
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
111
- ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, Readable>>
112
- export function spawnAsync(
113
- command: string,
114
- args: readonly string[],
115
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
116
- ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, null>>
117
- export function spawnAsync(
118
- command: string,
119
- args: readonly string[],
120
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
121
- ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, null>>
122
- export function spawnAsync(
123
- command: string,
124
- args: readonly string[],
125
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
126
- ): PromiseWithChildProcess<ChildProcessByStdio<null, null, Readable>>
127
- export function spawnAsync(
128
- command: string,
129
- args: readonly string[],
130
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
131
- ): PromiseWithChildProcess<ChildProcessByStdio<null, null, null>>
132
- export function spawnAsync(command: string, args: readonly string[], options: SpawnOptions): PromiseWithChildProcess<ChildProcess>
133
-
134
- /**
135
- * @description wait for the command to exit
136
- * @returns a promise that resolves with the child process when the command exits successfully. Also, the child process is attached to the promise as a property.
137
- */
138
- export function spawnAsync(command: string, args?: any, options?: any): Promise<any> {
139
- let child: any
140
- const promise = new Promise<any>((resolve, reject) => {
141
- if (Array.isArray(args)) options = { ...defaultOptions, ...options }
142
- else args = { ...defaultOptions, ...args }
143
- child = spawn(command, args, options)
144
- child.on("exit", (code: number) => {
145
- if (code === 0) return resolve(child)
146
- if (Array.isArray(args)) {
147
- const args2 = args.map((item: string) => item.trim()).filter(Boolean)
148
- if (args2.length > 0) command = `${command} ${args2.join(" ")}`
149
- }
150
- reject(new Error(`spawn "${command}" failed with code ${code}`))
151
- return
152
- })
153
- }) as PromiseWithChildProcess<any>
154
- promise.child = child
155
- return promise
156
- }
1
+ import {
2
+ ChildProcess,
3
+ ChildProcessByStdio,
4
+ ChildProcessWithoutNullStreams,
5
+ SpawnOptions,
6
+ SpawnOptionsWithStdioTuple,
7
+ SpawnOptionsWithoutStdio,
8
+ StdioNull,
9
+ StdioPipe,
10
+ spawn,
11
+ } from "child_process"
12
+ import { Readable, Writable } from "stream"
13
+
14
+ export interface PromiseWithChildProcess<T> extends Promise<T> {
15
+ child: T
16
+ }
17
+
18
+ export type Options =
19
+ | SpawnOptionsWithoutStdio
20
+ | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>
21
+ | SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>
22
+ | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>
23
+ | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>
24
+ | SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>
25
+ | SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>
26
+ | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>
27
+ | SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>
28
+ | SpawnOptions
29
+
30
+ let defaultOptions: Options = {}
31
+
32
+ /**
33
+ * @description get default options for spawnAsync
34
+ * @returns {Options} options
35
+ */
36
+ export function getDefaultOptions(): Options {
37
+ return defaultOptions
38
+ }
39
+
40
+ /**
41
+ * @description set default options for spawnAsync
42
+ * @param {Options | ((prev: Options) => Options)} options
43
+ */
44
+ export function setDefaultOptions(options: Options | ((prev: Options) => Options)) {
45
+ if (typeof options === "function") {
46
+ defaultOptions = options(defaultOptions)
47
+ return
48
+ }
49
+ defaultOptions = options
50
+ return defaultOptions
51
+ }
52
+
53
+ export function spawnAsync(command: string, options?: SpawnOptionsWithoutStdio): PromiseWithChildProcess<ChildProcessWithoutNullStreams>
54
+ export function spawnAsync(
55
+ command: string,
56
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
57
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, Readable>>
58
+ export function spawnAsync(
59
+ command: string,
60
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
61
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, null>>
62
+ export function spawnAsync(
63
+ command: string,
64
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
65
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, Readable>>
66
+ export function spawnAsync(
67
+ command: string,
68
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
69
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, Readable>>
70
+ export function spawnAsync(
71
+ command: string,
72
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
73
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, null>>
74
+ export function spawnAsync(
75
+ command: string,
76
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
77
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, null>>
78
+ export function spawnAsync(
79
+ command: string,
80
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
81
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, null, Readable>>
82
+ export function spawnAsync(
83
+ command: string,
84
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
85
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, null, null>>
86
+ export function spawnAsync(command: string, options: SpawnOptions): PromiseWithChildProcess<ChildProcess>
87
+ export function spawnAsync(
88
+ command: string,
89
+ args?: readonly string[],
90
+ options?: SpawnOptionsWithoutStdio,
91
+ ): PromiseWithChildProcess<ChildProcessWithoutNullStreams>
92
+ export function spawnAsync(
93
+ command: string,
94
+ args: readonly string[],
95
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
96
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, Readable>>
97
+ export function spawnAsync(
98
+ command: string,
99
+ args: readonly string[],
100
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
101
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, Readable, null>>
102
+ export function spawnAsync(
103
+ command: string,
104
+ args: readonly string[],
105
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
106
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, Readable>>
107
+ export function spawnAsync(
108
+ command: string,
109
+ args: readonly string[],
110
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
111
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, Readable>>
112
+ export function spawnAsync(
113
+ command: string,
114
+ args: readonly string[],
115
+ options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
116
+ ): PromiseWithChildProcess<ChildProcessByStdio<Writable, null, null>>
117
+ export function spawnAsync(
118
+ command: string,
119
+ args: readonly string[],
120
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
121
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, Readable, null>>
122
+ export function spawnAsync(
123
+ command: string,
124
+ args: readonly string[],
125
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
126
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, null, Readable>>
127
+ export function spawnAsync(
128
+ command: string,
129
+ args: readonly string[],
130
+ options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
131
+ ): PromiseWithChildProcess<ChildProcessByStdio<null, null, null>>
132
+ export function spawnAsync(command: string, args: readonly string[], options: SpawnOptions): PromiseWithChildProcess<ChildProcess>
133
+
134
+ /**
135
+ * @description wait for the command to exit
136
+ * @returns a promise that resolves with the child process when the command exits successfully. Also, the child process is attached to the promise as a property.
137
+ */
138
+ export function spawnAsync(command: string, args?: any, options?: any): Promise<any> {
139
+ let child: any
140
+ const promise = new Promise<any>((resolve, reject) => {
141
+ if (Array.isArray(args)) options = { ...defaultOptions, ...options }
142
+ else args = { ...defaultOptions, ...args }
143
+ child = spawn(command, args, options)
144
+ child.on("exit", (code: number) => {
145
+ if (code === 0) return resolve(child)
146
+ if (Array.isArray(args)) {
147
+ const args2 = args.map((item: string) => item.trim()).filter(Boolean)
148
+ if (args2.length > 0) command = `${command} ${args2.join(" ")}`
149
+ }
150
+ reject(new Error(`spawn "${command}" failed with code ${code}`))
151
+ return
152
+ })
153
+ }) as PromiseWithChildProcess<any>
154
+ promise.child = child
155
+ return promise
156
+ }
@@ -1,34 +1,34 @@
1
- import which from "which"
2
-
3
- import { execAsync } from "./execAsync"
4
-
5
- export type UnzipOptions = {
6
- /**
7
- * 要解压的文件
8
- */
9
- input: string
10
- /**
11
- * 解压到的目标文件夹位置
12
- */
13
- output: string
14
- /**
15
- * 压缩文件时的工作目录
16
- */
17
- cwd?: string
18
- }
19
-
20
- /**
21
- * 使用 7z 命令解压文件
22
- * - 如果没有安装 7z,请先安装 7z 后再执行
23
- * - 下载地址:https://www.7-zip.org/download.html
24
- * - 如果已经安装,请按照以下步骤将 7z 添加到环境变量中
25
- * 1. 设置 → 系统 → 右侧系统信息 → 高级系统设置 → 环境变量
26
- * 2. 在系统变量中找到并选中 Path,点击编辑
27
- * 3. 点击新建,输入 7z 的安装路径(默认是 C:\Program Files\7-Zip),点击确定
28
- * 4. 重启终端,输入 7z,如果出现 7z 的版本信息,则安装成功
29
- * 5. 如果没有出现版本信息,请重启电脑,或者检查 7z 的安装路径是否正确
30
- */
31
- export async function unzip({ input, output, cwd }: UnzipOptions) {
32
- await which("7z")
33
- return await execAsync(`7z x ${input} -o${output}`, { cwd })
34
- }
1
+ import which from "which"
2
+
3
+ import { execAsync } from "./execAsync"
4
+
5
+ export type UnzipOptions = {
6
+ /**
7
+ * 要解压的文件
8
+ */
9
+ input: string
10
+ /**
11
+ * 解压到的目标文件夹位置
12
+ */
13
+ output: string
14
+ /**
15
+ * 压缩文件时的工作目录
16
+ */
17
+ cwd?: string
18
+ }
19
+
20
+ /**
21
+ * 使用 7z 命令解压文件
22
+ * - 如果没有安装 7z,请先安装 7z 后再执行
23
+ * - 下载地址:https://www.7-zip.org/download.html
24
+ * - 如果已经安装,请按照以下步骤将 7z 添加到环境变量中
25
+ * 1. 设置 → 系统 → 右侧系统信息 → 高级系统设置 → 环境变量
26
+ * 2. 在系统变量中找到并选中 Path,点击编辑
27
+ * 3. 点击新建,输入 7z 的安装路径(默认是 C:\Program Files\7-Zip),点击确定
28
+ * 4. 重启终端,输入 7z,如果出现 7z 的版本信息,则安装成功
29
+ * 5. 如果没有出现版本信息,请重启电脑,或者检查 7z 的安装路径是否正确
30
+ */
31
+ export async function unzip({ input, output, cwd }: UnzipOptions) {
32
+ await which("7z")
33
+ return await execAsync(`7z x ${input} -o${output}`, { cwd })
34
+ }
package/src/utils/zip.ts CHANGED
@@ -1,52 +1,52 @@
1
- import { cpus } from "os"
2
- import which from "which"
3
-
4
- import { execAsync } from "./execAsync"
5
-
6
- export type ZipOptions = {
7
- /**
8
- * 要压缩的文件
9
- */
10
- input: string | string[]
11
- /**
12
- * 压缩到的目标位置,文件名的后缀就是压缩格式,例如:.zip、.7z
13
- */
14
- output: string
15
- /**
16
- * 线程数
17
- */
18
- thread?: number | "auto" | "max"
19
- /**
20
- * 压缩等级,0-9
21
- */
22
- level?: number
23
- /**
24
- * 是否加密
25
- */
26
- password?: string
27
- /**
28
- * 压缩文件时的工作目录
29
- */
30
- cwd?: string
31
- }
32
-
33
- /**
34
- * 使用 7z 命令压缩文件
35
- * - 如果没有安装 7z,请先安装 7z 后再执行
36
- * - 下载地址:https://www.7-zip.org/download.html
37
- * - 如果已经安装,请按照以下步骤将 7z 添加到环境变量中
38
- * 1. 设置 → 系统 → 右侧系统信息 → 高级系统设置 → 环境变量
39
- * 2. 在系统变量中找到并选中 Path,点击编辑
40
- * 3. 点击新建,输入 7z 的安装路径(默认是 C:\Program Files\7-Zip),点击确定
41
- * 4. 重启终端,输入 7z,如果出现 7z 的版本信息,则安装成功
42
- * 5. 如果没有出现版本信息,请重启电脑,或者检查 7z 的安装路径是否正确
43
- */
44
- export async function zip({ input, output, thread = "auto", level, password, cwd }: ZipOptions) {
45
- await which("7z")
46
- input = Array.isArray(input) ? input.join(" ") : input
47
- if (thread === "max") thread = cpus().length
48
- return await execAsync(
49
- `7z a ${output} ${input} -mmt=${thread === "auto" ? "on" : thread}${typeof level === "number" ? ` -mx=${level}` : ""}${password ? ` -p${password}` : ""}`,
50
- { cwd },
51
- )
52
- }
1
+ import { cpus } from "os"
2
+ import which from "which"
3
+
4
+ import { execAsync } from "./execAsync"
5
+
6
+ export type ZipOptions = {
7
+ /**
8
+ * 要压缩的文件
9
+ */
10
+ input: string | string[]
11
+ /**
12
+ * 压缩到的目标位置,文件名的后缀就是压缩格式,例如:.zip、.7z
13
+ */
14
+ output: string
15
+ /**
16
+ * 线程数
17
+ */
18
+ thread?: number | "auto" | "max"
19
+ /**
20
+ * 压缩等级,0-9
21
+ */
22
+ level?: number
23
+ /**
24
+ * 是否加密
25
+ */
26
+ password?: string
27
+ /**
28
+ * 压缩文件时的工作目录
29
+ */
30
+ cwd?: string
31
+ }
32
+
33
+ /**
34
+ * 使用 7z 命令压缩文件
35
+ * - 如果没有安装 7z,请先安装 7z 后再执行
36
+ * - 下载地址:https://www.7-zip.org/download.html
37
+ * - 如果已经安装,请按照以下步骤将 7z 添加到环境变量中
38
+ * 1. 设置 → 系统 → 右侧系统信息 → 高级系统设置 → 环境变量
39
+ * 2. 在系统变量中找到并选中 Path,点击编辑
40
+ * 3. 点击新建,输入 7z 的安装路径(默认是 C:\Program Files\7-Zip),点击确定
41
+ * 4. 重启终端,输入 7z,如果出现 7z 的版本信息,则安装成功
42
+ * 5. 如果没有出现版本信息,请重启电脑,或者检查 7z 的安装路径是否正确
43
+ */
44
+ export async function zip({ input, output, thread = "auto", level, password, cwd }: ZipOptions) {
45
+ await which("7z")
46
+ input = Array.isArray(input) ? input.join(" ") : input
47
+ if (thread === "max") thread = cpus().length
48
+ return await execAsync(
49
+ `7z a ${output} ${input} -mmt=${thread === "auto" ? "on" : thread}${typeof level === "number" ? ` -mx=${level}` : ""}${password ? ` -p${password}` : ""}`,
50
+ { cwd },
51
+ )
52
+ }
package/tsconfig.json CHANGED
@@ -1,15 +1,15 @@
1
- {
2
- "compilerOptions": {
3
- "baseUrl": ".",
4
- "strict": true,
5
- "declaration": true,
6
- "skipLibCheck": true,
7
- "target": "ESNext",
8
- "module": "ESNext",
9
- "moduleResolution": "Bundler",
10
- "paths": {
11
- "@/*": ["src/*"]
12
- }
13
- },
14
- "include": ["src"]
15
- }
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "strict": true,
5
+ "declaration": true,
6
+ "skipLibCheck": true,
7
+ "target": "ESNext",
8
+ "module": "ESNext",
9
+ "moduleResolution": "Bundler",
10
+ "paths": {
11
+ "@/*": ["src/*"]
12
+ }
13
+ },
14
+ "include": ["src"]
15
+ }