Secure JSON JSON storage library to securely persist JSON data on disk.Cipher is configured to useAES-256-CBC with initialization vector.There are two types of storage schema:inmemory ordisk 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 -- save const SecureJStore = require ( "secure-json" ) ; Create an instance of SecureJStore var instance = new SecureJStore ( ) ; Initialize instance with options var options = { store :< Path to SecureJStore directory > , dbType:< Specify "inmemory" or "disk" > , password :< Specify password to encrypt the SecureJStore > } ; instance . init ( options ) ; Create an instance of SecureJStore var instance = new SecureJStore ( ) ; instance . setItem ( "key1" , "value1" ) ; let value = instance . getItem ( "key1" ) ; let value = instance . removeItem ( "key1" ) ; let values = instance . values ( ) ; Retrieving all entries of (key, value) pairs let items = instance . entries ( ) ; Retrieving all entries with for...of loop for ( let item of instance ) { ...} Retrieving all entries with forEach loop instance . forEach ( ( x ) => { ...} ) ; npm install
npm run test
npm run coverage
OR
istanbul cover ./test/test.js
Check coverage folder