0.1.0 • Published 5 years ago
@mesg/vault v0.1.0
@mesg/vault
Website - Docs - Forum - Chat - Blog
Store securely your information
Installation
npm install @mesg/vault
Usage
const Vault = require('@mesg/vault')
const MemoryStore = require('@mesg/vault/lib/store/memory')
const encryptedStore = new MemoryStore()
const vault = new Vault(encryptedStore)
vault.set('my-key', { foo: 'bar' }, 'my-password')
const data = vault.get('my-key', 'my-password')
Store
@mesg/vault can use different stores to store your data.
Memory store
This store will not persist any data and keep everything in a map in memory.
const MemoryStore = require('@mesg/vault/lib/store/memory')
new Vault(new MemoryStore())
File store
This store will persist the values in a json file on disk (only available in node).
const FileStore = require('@mesg/vault/lib/store/file')
new Vault(new FileStore('./store.json'))
Localstorage
This store is only available on browser and will persist on the localstorage of your browser.
const LocalStorageStore = require('@mesg/vault/lib/store/file')
new Vault(new LocalStorageStore())
0.1.0
5 years ago