@furystack/filesystem-store

6.0.2 • Public • Published

filesystem-store

Filesystem Store implementation for FuryStack. Recommended for lightweight usage, embedded operations, experimenting / tryout, not for production.

An usage example:

import { join } from 'path'
import { Injector } from '@furystack/inject'
import '@furystack/filesystem-store'
import { PhysicalStore, StoreManager } from '@furystack/core'

class MyModel {
  declare id: number
  declare value: string
}

const myInjector = new Injector()
myInjector.setupStores((stores) => stores.useFileSystem({ model: MyModel, primaryKey: 'id', fileName: 'example.json' }))

const myStore = myInjector.getInstance(StoreManager).getStoreFor(MyModel)
await myStore.add({ id: 1, value: 'foo' })

Package Sidebar

Install

npm i @furystack/filesystem-store

Weekly Downloads

57

Version

6.0.2

License

GPL-2.0

Unpacked Size

56 kB

Total Files

29

Last publish

Collaborators

  • gallayl