Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JSON storage library to securely persist json data on disk

License

NotificationsYou must be signed in to change notification settings

HydroCarbons/secure-json

Repository files navigation

Secure-JSON Icon

Travis CI Status

Build StatusCoverage Status

Secure JSON

  • 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.

Usage

Install

npminstallsecure-json--save

Require

constSecureJStore=require("secure-json");

Create an instance of SecureJStore

varinstance=newSecureJStore();

Initialize instance with options

varoptions={store:<PathtoSecureJStoredirectory>,    dbType:<Specify"inmemory"or"disk">,password:<SpecifypasswordtoencrypttheSecureJStore>};instance.init(options);

Create an instance of SecureJStore

varinstance=newSecureJStore();

Storing an item

instance.setItem("key1","value1");

Retrieving an item

letvalue=instance.getItem("key1");

Removing an item

letvalue=instance.removeItem("key1");

Retrieving all keys

letkeys=instance.keys();

Retrieving all values

letvalues=instance.values();

Retrieving all entries of (key, value) pairs

letitems=instance.entries();

Retrieving all entries with for...of loop

for(letitemofinstance){ ...}

Retrieving all entries with forEach loop

instance.forEach((x)=>{ ...});

Archiving instance

instance.archive();

Library Usage/Test

Install

npm install

Test

npm run test

Coverage

npm run coverage

OR

istanbul cover ./test/test.js

Check coverage folder

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp