JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 161
  • Score
    100M100P100Q76468F
  • License ISC

Package for encrypting JSON

Package Exports

  • json-file-encrypt

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json-file-encrypt) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#jsonEncrypt

jsonEncrypt is a node module for encrypting json files, with minimal effort. It uses sha256 and aes256 to encrypt these.

###Usage

Require the module:

const encryptor = require("json-file-encrypt");

For encrypting json a new instance of the class has to be made, and then the functions can be used to encrypt/decrypt files with this key.

//create Instance with "test Key" as the key
var key1 = new encryptor ("test Key");

//save JSON with this key
//first argument is the path to save to, the second the data
key1.save("./file.json", {string: "This is a random JSON Object."});

//load a file that was encrypted with this key
//will return the json data, in this case {string: "This is a random JSON Object."}
var data = key1.load("./file.json");