JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 148
  • Score
    100M100P100Q74884F
  • 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

#json-file-encrypt

json-file-encrypt is a node.js module for encrypting json files, with minimal effort. It uses sha256 and AES 256.

###Usage

Require the module:

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

Create a new instance of the class:

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

Save JSON to a file:

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

Load JSON from a file:

//load file, decrypt with pre-specified key
//will return json data, {string: "This is a random JSON Object."}
var data = key1.load("./file.json");