@liteflow/vault
Store securely your information
Installation
npm install @liteflow/vault
Usage
const Vault = require('@liteflow/vault')
const MemoryStore = require('@liteflow/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
@liteflow/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('@liteflow/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('@liteflow/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('@liteflow/vault/lib/store/file')
new Vault(new LocalStorageStore())