2.0.0 • Published 8 months ago

@exodus/storage-unsafe-desktop v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@exodus/storage-unsafe-desktop

An implementation unified storage spec on top of Node.js's fs module. "Unsafe" = no encryption out of the box.

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.
// use as any other `@exodus/storage-spec` compliant interface

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
1.1.3

10 months ago

2.0.0

8 months ago

1.1.2

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago