/pmemkv-nodejs

NodeJS bindings for pmemkv

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

pmemkv-nodejs

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.

Dependencies

  • 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:

Installation

Start by installing pmemkv on your system.

Add npm module to your project:

npm install pmem/pmemkv-nodejs --save

Sample Code

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();