qiao-config
Advanced tools
Comparing version 2.0.4 to 3.0.0
{ | ||
"name": "qiao-config", | ||
"version": "2.0.4", | ||
"version": "3.0.0", | ||
"description": "json config to local file", | ||
@@ -33,3 +33,3 @@ "keywords": [ | ||
"dependencies": { | ||
"qiao-file": "^3.0.0" | ||
"qiao-file": "^3.0.1" | ||
}, | ||
@@ -53,3 +53,3 @@ "nx": { | ||
}, | ||
"gitHead": "438ac047332a912cceba9880d70ff1e89b135298" | ||
"gitHead": "5b04b03fd27566449f795ec99ef4ce97c5b2f0be" | ||
} |
@@ -16,10 +16,24 @@ ## qiao-config | ||
## use | ||
使用 | ||
```javascript | ||
// cjs | ||
const DB = require('qiao-config'); | ||
// mjs | ||
import DB from 'qiao-config'; | ||
``` | ||
## db | ||
db 实例 | ||
```javascript | ||
// default | ||
const db = require('qiao-config')(); | ||
const db = DB(); | ||
// custom | ||
const db = require('qiao-config')('your path'); | ||
const db = DB('/custom/path/to/db.json'); | ||
``` | ||
@@ -31,4 +45,10 @@ | ||
获取所有信息 | ||
- return | ||
- 类型: object | ||
- 说明: 所有信息 | ||
```javascript | ||
await db.all(); | ||
const all = await db.all(); | ||
``` | ||
@@ -38,2 +58,4 @@ | ||
清空所有信息 | ||
```javascript | ||
@@ -45,2 +67,16 @@ await db.clear(); | ||
获取,设置,删除数据 | ||
- key | ||
- 类型: string | ||
- 说明: 只传入 key 时,获取信息 | ||
- value | ||
- 类型: any | ||
- 说明: | ||
- 设置信息时,传入 key 和 value | ||
- 删除信息时传入 null | ||
- return | ||
- 类型: any | ||
- 说明: 获取信息是返回 value,其他无返回 | ||
```javascript | ||
@@ -59,2 +95,7 @@ // get | ||
### 0.0.6.20230407 | ||
1. 优化测试用例和 readme | ||
2. 3.0.0 | ||
### 0.0.5.20230404 | ||
@@ -61,0 +102,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10198
122
Updatedqiao-file@^3.0.1