@kvs/node-localstorage 0.3.0 → 2.0.0
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 +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -3
- package/lib/index.js.map +1 -1
- package/module/index.d.ts +1 -1
- package/package.json +10 -11
- package/CHANGELOG.md +0 -38
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @kvs/node-localstorage
|
|
2
2
|
|
|
3
|
-
Node.js localstorage for KVS.
|
|
3
|
+
Node.js localstorage for [KVS](https://github.com/azu/kvs).
|
|
4
4
|
|
|
5
5
|
## Dependencies
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ Install with [npm](https://www.npmjs.com/):
|
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
See <https://github.com/azu/kvs#usage>
|
|
18
18
|
|
|
19
19
|
## Changelog
|
|
20
20
|
|
package/lib/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export declare type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema>
|
|
|
8
8
|
kvsVersionKey?: string;
|
|
9
9
|
storeFilePath?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<
|
|
11
|
+
export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KvsStorage<Schema>>;
|
package/lib/index.js
CHANGED
|
@@ -21,14 +21,15 @@ const node_localstorage_1 = require("node-localstorage");
|
|
|
21
21
|
const app_root_path_1 = __importDefault(require("app-root-path"));
|
|
22
22
|
// @ts-ignore
|
|
23
23
|
const mkdirp_1 = __importDefault(require("mkdirp"));
|
|
24
|
-
|
|
24
|
+
const kvsLocalStorage = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
25
|
const defaultCacheDir = path_1.default.join(app_root_path_1.default.toString(), ".cache");
|
|
26
26
|
if (!options.storeFilePath) {
|
|
27
|
-
yield mkdirp_1.default(defaultCacheDir);
|
|
27
|
+
yield (0, mkdirp_1.default)(defaultCacheDir);
|
|
28
28
|
}
|
|
29
29
|
const saveFilePath = options.storeFilePath
|
|
30
30
|
? options.storeFilePath
|
|
31
31
|
: path_1.default.join(defaultCacheDir, "kvs-node-localstorage");
|
|
32
|
-
return storage_1.kvsStorage(Object.assign(Object.assign({}, options), { storage: new node_localstorage_1.LocalStorage(saveFilePath) }));
|
|
32
|
+
return (0, storage_1.kvsStorage)(Object.assign(Object.assign({}, options), { storage: new node_localstorage_1.LocalStorage(saveFilePath) }));
|
|
33
33
|
});
|
|
34
|
+
exports.kvsLocalStorage = kvsLocalStorage;
|
|
34
35
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,0CAAiE;AAEjE,aAAa;AACb,yDAAiD;AACjD,aAAa;AACb,kEAAoC;AACpC,aAAa;AACb,oDAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,0CAAiE;AAEjE,aAAa;AACb,yDAAiD;AACjD,aAAa;AACb,kEAAoC;AACpC,aAAa;AACb,oDAA4B;AAUrB,MAAM,eAAe,GAAG,CAC3B,OAAuC,EACZ,EAAE;IAC7B,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,uBAAO,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;QACxB,MAAM,IAAA,gBAAM,EAAC,eAAe,CAAC,CAAC;KACjC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa;QACtC,CAAC,CAAC,OAAO,CAAC,aAAa;QACvB,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,eAAe,EAAE,uBAAuB,CAAC,CAAC;IAC1D,OAAO,IAAA,oBAAU,kCACV,OAAO,KACV,OAAO,EAAE,IAAI,gCAAY,CAAC,YAAY,CAAC,IACzC,CAAC;AACP,CAAC,CAAA,CAAC;AAdW,QAAA,eAAe,mBAc1B"}
|
package/module/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export declare type KvsLocalStorageOptions<Schema extends KvsLocalStorageSchema>
|
|
|
8
8
|
kvsVersionKey?: string;
|
|
9
9
|
storeFilePath?: string;
|
|
10
10
|
};
|
|
11
|
-
export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<
|
|
11
|
+
export declare const kvsLocalStorage: <Schema extends KvsLocalStorageSchema>(options: KvsLocalStorageOptions<Schema>) => Promise<KvsStorage<Schema>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvs/node-localstorage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Node.js localstorage for KVS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kvs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"build": "tsc -p . && tsc --project ./tsconfig.module.json",
|
|
35
35
|
"clean": "rimraf lib/ module/",
|
|
36
36
|
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
|
|
37
|
-
"
|
|
37
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
38
38
|
"test": "mocha \"test/**/*.ts\"",
|
|
39
39
|
"watch": "tsc -p . --watch"
|
|
40
40
|
},
|
|
@@ -45,25 +45,24 @@
|
|
|
45
45
|
"trailingComma": "none"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@kvs/storage": "^0.
|
|
48
|
+
"@kvs/storage": "^2.0.0",
|
|
49
49
|
"app-root-path": "^3.0.0",
|
|
50
50
|
"mkdirp": "^1.0.4",
|
|
51
51
|
"node-localstorage": "^2.1.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@jsdevtools/karma-config": "^3.1.7",
|
|
55
|
-
"@kvs/common-test-case": "^0.
|
|
56
|
-
"@types/mocha": "^
|
|
57
|
-
"@types/node": "^
|
|
58
|
-
"
|
|
59
|
-
"mocha": "^8.1.1",
|
|
55
|
+
"@kvs/common-test-case": "^2.0.0",
|
|
56
|
+
"@types/mocha": "^9.0.0",
|
|
57
|
+
"@types/node": "^16.9.1",
|
|
58
|
+
"mocha": "^9.1.1",
|
|
60
59
|
"prettier": "^2.0.5",
|
|
61
60
|
"rimraf": "^3.0.2",
|
|
62
|
-
"ts-loader": "^8.0
|
|
63
|
-
"typescript": "^
|
|
61
|
+
"ts-loader": "^8.2.0",
|
|
62
|
+
"typescript": "^4.2.4"
|
|
64
63
|
},
|
|
65
64
|
"publishConfig": {
|
|
66
65
|
"access": "public"
|
|
67
66
|
},
|
|
68
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b43dd2fdbefe4ee5714d0690b2f8f576dc8c1417"
|
|
69
68
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
# [0.3.0](https://github.com/azu/kvs/compare/v0.2.1...v0.3.0) (2020-08-22)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @kvs/node-localstorage
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
## [0.2.1](https://github.com/azu/kvs/compare/v0.2.0...v0.2.1) (2020-08-22)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @kvs/node-localstorage
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# [0.2.0](https://github.com/azu/kvs/compare/v0.1.0...v0.2.0) (2020-08-08)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Features
|
|
26
|
-
|
|
27
|
-
* **@kvs/env:** migrate Schema Type ([0951d08](https://github.com/azu/kvs/commit/0951d08405d42588454878a03c9082961ad0c363))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# 0.1.0 (2020-08-08)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Features
|
|
37
|
-
|
|
38
|
-
* **@kvs/node-localstorage:** add node implementation ([5160012](https://github.com/azu/kvs/commit/516001286c96ac85cb54d55fbba62549d6d7eb0e))
|