@furystack/filesystem-store 7.0.27 → 7.0.29
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
CHANGED
|
@@ -5,10 +5,9 @@ Filesystem store implementation for FuryStack. Recommended for lightweight usage
|
|
|
5
5
|
Usage example:
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
import { join } from 'path'
|
|
9
8
|
import { Injector } from '@furystack/inject'
|
|
10
|
-
import '@furystack/
|
|
11
|
-
import {
|
|
9
|
+
import { StoreManager } from '@furystack/core'
|
|
10
|
+
import { useFileSystemStore } from '@furystack/filesystem-store'
|
|
12
11
|
|
|
13
12
|
class MyModel {
|
|
14
13
|
declare id: number
|
|
@@ -16,8 +15,13 @@ class MyModel {
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
const myInjector = new Injector()
|
|
19
|
-
|
|
18
|
+
useFileSystemStore({
|
|
19
|
+
injector: myInjector,
|
|
20
|
+
model: MyModel,
|
|
21
|
+
primaryKey: 'id',
|
|
22
|
+
fileName: 'example.json',
|
|
23
|
+
})
|
|
20
24
|
|
|
21
|
-
const myStore = myInjector.getInstance(StoreManager).getStoreFor(MyModel)
|
|
25
|
+
const myStore = myInjector.getInstance(StoreManager).getStoreFor(MyModel, 'id')
|
|
22
26
|
await myStore.add({ id: 1, value: 'foo' })
|
|
23
27
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Constructable, Injector } from '@furystack/inject';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Creates and registers a FileSystemStore with the StoreManager
|
|
4
4
|
* @param options The Options for store creation
|
|
5
5
|
* @param options.injector The injector to use for creating the store
|
|
6
6
|
* @param options.model The model to use for the store
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addStore } from '@furystack/core';
|
|
2
2
|
import { FileSystemStore } from './filesystem-store.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Creates and registers a FileSystemStore with the StoreManager
|
|
5
5
|
* @param options The Options for store creation
|
|
6
6
|
* @param options.injector The injector to use for creating the store
|
|
7
7
|
* @param options.model The model to use for the store
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@furystack/filesystem-store",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.29",
|
|
4
4
|
"description": "Simple File System store implementation for FuryStack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://github.com/furystack/furystack",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@furystack/core": "^15.0.
|
|
41
|
-
"@furystack/inject": "^12.0.
|
|
42
|
-
"@furystack/utils": "^8.1.
|
|
40
|
+
"@furystack/core": "^15.0.29",
|
|
41
|
+
"@furystack/inject": "^12.0.23",
|
|
42
|
+
"@furystack/utils": "^8.1.5",
|
|
43
43
|
"semaphore-async-await": "^1.5.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^24.
|
|
46
|
+
"@types/node": "^24.10.1",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
|
-
"vitest": "^
|
|
48
|
+
"vitest": "^4.0.10"
|
|
49
49
|
},
|
|
50
50
|
"gitHead": "1045d854bfd8c475b7035471d130d401417a2321"
|
|
51
51
|
}
|
|
@@ -3,7 +3,7 @@ import type { Constructable, Injector } from '@furystack/inject'
|
|
|
3
3
|
import { FileSystemStore } from './filesystem-store.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Creates and registers a FileSystemStore with the StoreManager
|
|
7
7
|
* @param options The Options for store creation
|
|
8
8
|
* @param options.injector The injector to use for creating the store
|
|
9
9
|
* @param options.model The model to use for the store
|