# avault

> Simple module to protect api keys, username credentials, and other sensitive data.

Latest version **0.1.17** (published 2014-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install avault
pnpm add avault
yarn add avault
bun add avault
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.17 |
| Published | 2014-07-17 |
| First published | 2014-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Randy Solton |
| Maintainers | rsolton |
| Keywords | secure, vault, sensitive |

## Links

- npm: https://www.npmjs.com/package/avault
- Repository: https://github.com/apigee-127/avault
- Issues: https://github.com/apigee-127/avault/issues
- npm.io page: https://npm.io/package/avault

## Dependencies (4)

- [q](https://npm.io/package/q.md) 1.0.1
- [chalk](https://npm.io/package/chalk.md) 0.4.0
- [minimist](https://npm.io/package/minimist.md) 0.2.0
- [node-uuid](https://npm.io/package/node-uuid.md) 1.4.1

## Recent versions

- 0.1.17 (latest) — 2014-07-17
- 0.1.16 — 2014-07-17
- 0.1.15 — 2014-07-11
- 0.1.14 — 2014-07-11
- 0.1.13 — 2014-07-07
- 0.1.12 — 2014-07-05
- 0.1.11 — 2014-07-03
- 0.1.10 — 2014-07-03
- 0.1.9 — 2014-07-03
- 0.1.8 — 2014-07-03
- 0.1.7 — 2014-07-03
- 0.1.6 — 2014-07-03
- 0.1.5 — 2014-07-03
- 0.1.4 — 2014-07-03
- 0.1.3 — 2014-07-03
- … 3 more at https://npm.io/package/avault/versions

## README

avault
=========

A small module providing the ability to store sensitive data securely and retrieve it decrypted at runtime.

## Installation

  npm install avault

## Usage
There are two steps to follow to use the avault service:

1. First, use the vaultcli.js utility to store sensitive data encrypted in a named vault.  You may create as many vaults as you like.  Each vault contains a string, which would typically be a stringified JSON object.
2. Then, it can later be retrieved decrypted for use at runtime.

Step 1 is performed very infrequently.  Step 2 is performed frequently, whenever sensitive data (e.g. credentials) needs to be retrieved.

### Create a Vault, Empty All Vaults or Set the Master Secret with Command-line Tool 'vaultcli.js'
  usage: vaultcli.js  [--version]  [--zap] [--verbose] [--reallyverbose] [--secret=&lt;secretValue&gt;] [--value=&lt;vaultValue&gt;] &lt;vaultName&gt;

  example - create a vault entry:

    node_modules/avault/vaultcli.js --verbose --value='{"username": "mrogers", "password": "director", "host": "nsa.rds.amazonaws.com", "database": "prism"}' sigad

  example - remove all vaults:

    node_modules/avault/vaultcli.js --zap --verbose

  example - set the master key:

    node_modules/avault/vaultcli.js --secret=skeleton --verbose

### Create a Vault with Code
    var vault = require('avault').createVault(__dirname);
    var keyName = 'key1';
    vault.generateKey(keyName).then(
        function (keyResponse) {
            vault.store(keyName, '{"username": "mrogers", "password": "director", "host": "nsa.rds.amazonaws.com", "database": "prism"}', 'sigad').then(
                function (storeResponse) {
                    console.log('Ok', storeResponse);
                },
                function (err) {
                    console.log('Error', err);
                });
        },
        function (err) {
            console.log('Error', err);
        });


### Retrieve Decrypted Data from a Vault at Runtime
    var vault = require('avault').createVault(__dirname);

    vault.get('sigad', function (profileString) {
        var profile = JSON.parse(profileString);
        console.log(profile);
    });

## Tests

  npm test

## Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.

## Release History

* 0.1.0 Initial release

---
_Source: https://npm.io/package/avault · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
