minivault-core

1.1.0 • Public • Published

Minivault (Core)

npm Dependencies Build Status Coverage Status JavaScript Standard Style

A pretty rudimentary vault. Keeps a key-value store under ~/.minivault, encrypted with a password.

This package provides the core API. You may also be interested in the Web front end and the RESTful API.

Usage

var Minivault = require('minivault-core')
 
var vault = new Minivault({secret: 'myMasterPassword'})
 
vault.get('someKey')
  .then(function (data) {
    console.info('Data for someKey:', data)
  })
  .catch(function (err) {
    console.error(err)
  })
 
vault.put('someOtherKey', data)
  .then(function () {
    console.info('Data stored')
  })
  .catch(function (err) {
    console.error(err)
  })
 
vault.delete('uselessKey')
  .then(function () {
    console.info('Key deleted')
  })
  .catch(function (err) {
    console.error(err)
  })
 
vault.index()
  .then(function (keys) {
    console.info('Keys in vault:', keys)
  })
  .catch(function (err) {
    console.error(err)
  })

A synchronous API is also available. The corresponding functions are getSync, putSync, deleteSync, and indexSync.

Author

Tim De Pauw

License

MIT

Package Sidebar

Install

npm i minivault-core

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • timdp