@cowave-cli/utils 2.5.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 +115 -0
- package/dist/error.d.ts +1 -0
- package/dist/js/fullscreen.d.ts +24 -0
- package/dist/js/http.d.ts +26 -0
- package/dist/js/logic.d.ts +1 -0
- package/dist/js/navigator.d.ts +9 -0
- package/dist/js/number.d.ts +15 -0
- package/dist/js/object.d.ts +52 -0
- package/dist/js/string.d.ts +44 -0
- package/dist/js/style.d.ts +6 -0
- package/dist/js/time.d.ts +77 -0
- package/dist/js/tiny-color.d.ts +288 -0
- package/dist/js.cjs +1652 -0
- package/dist/js.d.ts +10 -0
- package/dist/js.js +1627 -0
- package/dist/node/file.d.ts +40 -0
- package/dist/node/path.d.ts +26 -0
- package/dist/node.cjs +1883 -0
- package/dist/node.d.ts +3 -0
- package/dist/node.js +1849 -0
- package/dist/vue/api.d.ts +28 -0
- package/dist/vue/file.d.ts +16 -0
- package/dist/vue/store.d.ts +2 -0
- package/dist/vue/subscribe.d.ts +4 -0
- package/dist/vue.cjs +1846 -0
- package/dist/vue.d.ts +5 -0
- package/dist/vue.js +1816 -0
- package/package.json +77 -0
- package/type.d.ts +17 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PathOrFileDescriptor, PathLike } from 'fs';
|
|
2
|
+
/**
|
|
3
|
+
* 创建文件夹
|
|
4
|
+
*
|
|
5
|
+
* @param path 文件夹路径
|
|
6
|
+
*/
|
|
7
|
+
export declare const createDir: (path: PathLike) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* 读取文件夹
|
|
10
|
+
*
|
|
11
|
+
* @param path 文件夹路径
|
|
12
|
+
* @returns {{dirs,files}}
|
|
13
|
+
*/
|
|
14
|
+
export declare const readDir: (path: PathLike) => Promise<{
|
|
15
|
+
dirs: any[];
|
|
16
|
+
files: any[];
|
|
17
|
+
}>;
|
|
18
|
+
/** 读取文件
|
|
19
|
+
*
|
|
20
|
+
* @param pathName 文件名
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const readFile: (pathName: PathOrFileDescriptor, encoding?: BufferEncoding) => Promise<string>;
|
|
24
|
+
/** 写入内容
|
|
25
|
+
*
|
|
26
|
+
* @param pathName 文件路径
|
|
27
|
+
* @param content 内容
|
|
28
|
+
*/
|
|
29
|
+
export declare const writeFile: (pathName: PathOrFileDescriptor, content: string | NodeJS.ArrayBufferView) => Promise<void>;
|
|
30
|
+
/** 复制文件夹或者文件
|
|
31
|
+
*
|
|
32
|
+
* @param src 文件夹或者文件
|
|
33
|
+
* @param dest 目标文件夹
|
|
34
|
+
*/
|
|
35
|
+
export declare const copyFileOrDir: (src: PathLike, dest: PathLike) => Promise<void>;
|
|
36
|
+
/** 删除文件夹或者文件
|
|
37
|
+
*
|
|
38
|
+
* @param path 路径
|
|
39
|
+
*/
|
|
40
|
+
export declare const removeFileOrDir: (path: PathLike) => Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断从toPath引入fromPath的路径相对关系
|
|
3
|
+
*
|
|
4
|
+
* @param fromPath 源路径
|
|
5
|
+
* @param toPath 目标路径
|
|
6
|
+
* @example
|
|
7
|
+
* relation('src/components', 'src/views/home.vue') // '../components/'
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare const relation: (fromPath: string, toPath: string) => string;
|
|
11
|
+
/**
|
|
12
|
+
* 过滤文件(仅过滤文件路径,不过滤文件夹路径)
|
|
13
|
+
*
|
|
14
|
+
* @param {string[]} files 文件名列表
|
|
15
|
+
* @returns {} { includeFiles, excludeFiles }
|
|
16
|
+
*/
|
|
17
|
+
export declare const filter: (files: string[], basePath?: string | null, includePath?: (string | RegExp)[], excludePath?: (string | RegExp)[]) => Promise<{
|
|
18
|
+
include: string[];
|
|
19
|
+
exclude: string[];
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* 遍历寻找src目录下的所有文件
|
|
23
|
+
* @param dirs
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
export declare const findFiles: (srcs: any, includePath?: (string | RegExp)[], excludePath?: (string | RegExp)[]) => Promise<string[]>;
|