Node.js bindings for pmemkv
This is experimental pre-release software and should not be used in production systems. APIs and file formats may change at any time without preserving backwards compatibility. All known issues and limitations are logged as GitHub issues.
- Node.js 6.10 or higher
- PMDK - native persistent memory libraries
- pmemkv - native key/value library
- node-ffi - for native library integration
- Used only for testing:
- chai - test assertion library
- chai-string - string assertion library
- mocha - test framework
Start by installing pmemkv on your system.
Add npm module to your project:
npm install pmem/pmemkv-nodejs --save
We are using /dev/shm
to
emulate persistent memory
in this simple example.
const pmemkv = require('pmemkv');
const kv = new pmemkv.KVEngine('kvtree', '/dev/shm/mykv');
kv.put('key1', 'value1');
expect(kv.get('key1')).to.equal('value1');
kv.remove('key1');
kv.close();