@wzyjs/utils 0.0.21 → 0.0.24
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/esm/rd/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sendMail: (title: string, content: string) => Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"main": "dist/cjs/index_rd.js",
|
|
8
8
|
"module": "dist/esm/index_fe.js",
|
|
9
9
|
"typings": "dist/esm/index_all.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/esm/index_fe.js",
|
|
13
|
+
"require": "./dist/cjs/index_rd.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
10
17
|
"scripts": {
|
|
11
18
|
"dev": "rollup -c -w --bundleConfigAsCjs",
|
|
12
19
|
"build": "rollup -c --bundleConfigAsCjs"
|
|
@@ -46,5 +53,5 @@
|
|
|
46
53
|
"type": "git",
|
|
47
54
|
"url": "https://gitee.com/wang-zhenyu/app.git"
|
|
48
55
|
},
|
|
49
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "88f98cb055865da4149661980ca61e50e081b35f"
|
|
50
57
|
}
|
package/dist/cjs/rd/jsonFile.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
// 实现一个文件系统读写数据库
|
|
6
|
-
class JsonFile {
|
|
7
|
-
filePath;
|
|
8
|
-
constructor(filePath) {
|
|
9
|
-
this.filePath = path.resolve(__dirname, filePath);
|
|
10
|
-
}
|
|
11
|
-
get(key) {
|
|
12
|
-
return new Promise((resolve) => {
|
|
13
|
-
fs.readFile(this.filePath, (err, data) => {
|
|
14
|
-
const json = data ? JSON.parse(data) : {};
|
|
15
|
-
resolve(json[key]);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
set(key, value) {
|
|
20
|
-
fs.readFile(this.filePath, { encoding: 'utf-8' }, (err, data) => {
|
|
21
|
-
const json = data ? JSON.parse(data || '{}') : {};
|
|
22
|
-
json[key] = value;
|
|
23
|
-
fs.writeFile(this.filePath, JSON.stringify(json), () => {
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
exports.JsonFile = JsonFile;
|
|
File without changes
|