@dot-store/fs
v1.6.0
Published
Filesystem operations with dot-store
Downloads
4
Readme
@dot-store/fs
Filesystem operations with dot-store
.
Install
npm install --save dot-event dot-store @dot-store/fs
Usage
import dotEvent from "dot-event"
import dotStore from "dot-store"
import fs from "@dot-store/fs"
const events = dotEvent()
const store = dotStore(events)
fs({ events, store })
const id = Math.random()
const path = `${__dirname}/id.json`
await events.fs("writeJson.test", { json: { id }, path })
store.get("fs.writeJson.test").success // true
await events.fs("readJson.test", { path })
store.get("fs.readJson.test.id") // id