@exodus/storage-unsafe-storage
Installation
npm i @exodus/storage-unsafe-storage
Usage
const { createStorage } = require('@exodus/storage-unsafe-storage');
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.
Synchronous filesystem call.
const { isStorageWriting } = require('@exodus/storage-unsafe');
isStorageWriting('path/to/storage.json');
// returns true or false
Last updated on