1.0.2 • Published 8 years ago

json-crypt v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

json-crypt

Dumping and loading JSON-serializable objects to file

'use strict';

const Crypt = require('json-crypt');

const myObj = {
    foo: {
        bar: [1, 2, 3]
    }
};

Crypt.dump(myObj, 'password!23', './file.ejs')
.then(() => {
   Crypt.load('password!23', './file.ejs')
   .then(obj => obj.foo.bar[0] === 1) 
});

CLI

npm i -g json-crypt

jcrypt enc password!23 myfile.json myencryptedfile.ejs

OR

jcrypt dec password!23 myencryptedfile.ejs myfile.json