Package Exports
- flash-store
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (flash-store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
FLASH-STORE
FlashStore is a Key-Value database tool and makes using leveldb more easy for Node.js

EXAMPLES
Try the following command
npm install
npm run demoThe basic function as follows:
import { FlashStore } from 'flash-store'
const flashStore = new FlashStore('falshstore.workdir')
await flashStore.put(1, 'a')
console.log(`key: 1, value: ${await flashStore.get(1)}`)
await flashStore.del(1)
console.log(`key: 1, value: ${await flashStore.get(1)}`)API Reference
FlashStore
FlashStore implments the Standard ES6 Map API with Async modification:
/**
* ES6 Map API with Async
*/
export interface AsyncMap<K = any, V = any> {
[Symbol.asyncIterator](): AsyncIterableIterator<[K, V]>
clear () : Promise<void>
delete (key: K) : Promise<void>
entries() : AsyncIterableIterator<[K, V]>
get (key: K) : Promise<V | undefined>
has (key: K) : Promise<boolean>
keys () : AsyncIterableIterator<K>
set (key: K, value: V) : Promise<void>
size () : Promise<number>
values () : AsyncIterableIterator<V>
}
class FlashStore<K, V> implments AsyncMap<K, V> {}FlashStoreSync
FlashStoreSync implments the Standard ES6 Map API:
class FlashStoreSync<K, V> implments Map<K, V> {}See more in documentation.
DOCUMENT
SEE ALSO
- Node.js databases: an embedded database using LevelDB
- How to Cook a Graph Database in a Night - LevelGraph
- Graph database JS style for Node.js and the Browser. Built upon LevelUp and LevelDB.
- 浅析 Bigtable 和 LevelDB 的实现
CHANGELOG
v0.4 master (Jun 2018)
1. Refactor API to implenment ES6 Map interface
- Update the API to ES6
Map-like, the difference is that FlashStore is all async.
2. Add FlashStoreSync as a in-memory Write-back Cache for Flash-Store
Add a new class FlashStoreSync which is a in-memory full loaded Write-back Cache for Flash-Store:
- Writes directly to
cache, lazy writes tostore. - Reads from cache, never read-miss because cache have the full data of the store which will never expire.
- API of
FlashStoreSyncis the same as the ES6Map
v0.2 (Sep 2017)
Init version, API is LevelDB-like.
AUTHOR
Huan LI <zixia@zixia.net> (http://linkedin.com/in/zixia)
COPYRIGHT & LICENSE
- Code & Docs © 2017 Huan LI <zixia@zixia.net>
- Code released under the Apache-2.0 License
- Docs released under Creative Commons