- Secure JSON JSON storage library to securely persist JSON data on disk. Cipher is configured to use AES-256-CBC with initialization vector.
- There are two types of storage schema: inmemory or disk
- inmemory: Store items are not persisted on disk and are not encrypted.
- disk: Store items are persisted on disk and can be encrypted.
npm install secure-json --saveconst SecureJStore = require("secure-json");var instance = new SecureJStore();var options = {
store: <Path to SecureJStore directory>,
dbType: <Specify "inmemory" or "disk">,
password: <Specify password to encrypt the SecureJStore>
};
instance.init(options);var instance = new SecureJStore();instance.setItem("key1", "value1");let value = instance.getItem("key1");let value = instance.removeItem("key1");let keys = instance.keys();let values = instance.values();let items = instance.entries();for(let item of instance ) { ... }instance.forEach( (x) => { ... });instance.archive();npm install
npm run test
npm run coverage
OR
istanbul cover ./test/test.js
Check coverage folder
