File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
packages/node-localstorage Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 47
47
"dependencies" : {
48
48
"@kvs/storage" : " ^2.1.4" ,
49
49
"app-root-path" : " ^3.1.0" ,
50
- "mkdirp" : " ^3.0.1" ,
51
50
"node-localstorage" : " ^2.1.6"
52
51
},
53
52
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
import path from "path" ;
2
2
import { JsonValue , KvsStorage , kvsStorage } from "@kvs/storage" ;
3
3
import { KVS , KVSOptions } from "@kvs/types" ;
4
+ import fs from "node:fs/promises" ;
4
5
// @ts -ignore
5
6
import { LocalStorage } from "node-localstorage" ;
6
7
// @ts -ignore
7
8
import appRoot from "app-root-path" ;
8
- import { mkdirp } from "mkdirp" ;
9
9
10
10
export type KvsLocalStorageSchema = {
11
11
[ index : string ] : JsonValue ;
@@ -20,7 +20,9 @@ export const kvsLocalStorage = async <Schema extends KvsLocalStorageSchema>(
20
20
) : Promise < KvsStorage < Schema > > => {
21
21
const defaultCacheDir = path . join ( appRoot . toString ( ) , ".cache" ) ;
22
22
if ( ! options . storeFilePath ) {
23
- await mkdirp ( defaultCacheDir ) ;
23
+ await fs . mkdir ( defaultCacheDir , {
24
+ recursive : true
25
+ } ) ;
24
26
}
25
27
const saveFilePath = options . storeFilePath
26
28
? options . storeFilePath
You can’t perform that action at this time.
0 commit comments