@exodus/storage-unsafe-desktop
v1.1.2
Published
storage-spec interface implementation for the Node.js environment
Downloads
1,631
Readme
@exodus/storage-unsafe-desktop
An unsafe implementation of the storage spec.
Usage
const { createStorage } = require('@exodus/storage-unsafe-desktop')
const storage = createStorage({
file: 'path/to/unsafe-storage.json', // creates new or loads existing file
})
await storage.set('foo', 'bar') // etc.
isStorageWriting()
Check if storage is currently writing before killing the application to prevent corruption.
NOTE: synchronous filesystem call!
const { isStorageWriting } = require('@exodus/storage-unsafe-desktop')
isStorageWriting('path/to/storage.json')
// returns true or false