# credstash

> Module for reading credstash secrets

Latest version **1.0.44** (published 2017-11-02) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.44 |
| Published | 2017-11-02 |
| First published | 2016-02-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Roy Lines |
| Maintainers | roylines |
| Keywords | credstash, secrets |

## Links

- npm: https://www.npmjs.com/package/credstash
- Repository: https://github.com/roylines/node-credstash
- Homepage: https://github.com/roylines/node-credstash#readme
- Issues: https://github.com/roylines/node-credstash/issues
- npm.io page: https://npm.io/package/credstash

## Dependencies (4)

- [async](https://npm.io/package/async.md) 1.5.2
- [xtend](https://npm.io/package/xtend.md) 4.0.1
- [aes-js](https://npm.io/package/aes-js.md) 0.2.2
- [aws-sdk](https://npm.io/package/aws-sdk.md) 2.2.35

## Recent versions

- 1.0.44 (latest) — 2017-11-02
- 1.0.43 — 2017-11-02
- 1.0.42 — 2017-02-07
- 1.0.41 — 2017-02-07
- 1.0.39 — 2017-01-07
- 1.0.36 — 2017-01-06
- 1.0.34 — 2017-01-06
- 1.0.32 — 2017-01-06
- 1.0.31 — 2017-01-05
- 1.0.30 — 2016-12-26
- 1.0.27 — 2016-12-16
- 1.0.26 — 2016-12-05
- 1.0.20 — 2016-05-12
- 1.0.18 — 2016-04-07
- 1.0.17 — 2016-04-07
- … 7 more at https://npm.io/package/credstash/versions

## README

# node-credstash
[![Circle CI](https://circleci.com/gh/roylines/node-credstash.svg?style=svg)](https://circleci.com/gh/roylines/node-credstash)

Node.js module for reading [credstash](https://github.com/fugue/credstash) secrets without needing snakes

```js
const Credstash = require('credstash');
const credstash = new Credstash();

// .get method for one key (table query)
credstash.get('secret', (e, secret) => {
  console.log('do not share the secret', secret);
});

// .list method for multiple keys (table scan)
credstash.list((e, secrets) => {
  console.log('do not share the secrets', secrets);
});
```

## Installation
Ensure you have [AWS credentials configured](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html).
The credentials should be set up as a [secret reader](https://github.com/fugue/credstash#secret-reader)

```bash
$ npm install credstash
```

## What is credstash?
[Credstash](https://github.com/fugue/credstash) is a little utility for managing credentials in the cloud

## Who this module for?
This module is for environments where you are using [credstash](https://github.com/fugue/credstash) to store secrets,
and you want to read secrets within node without installing python.
The module could be used within your node module to retrieve, for instance, database connection credentials from credstash.

## Retrieving the last N versions of a secret
Credstash support [versioning of secrets](https://github.com/fugue/credstash#versioning-secrets) which allows to easily rotate secrets.

By default node-credstash will return the latest (most recent version of a secret).
You can also retrieve the latest N versions of a secret as follows:

```js
const Credstash = require('credstash');
const credstash = new Credstash();

credstash.get('secret', {limit: 3}, (e, secrets) => {
  console.log('this is the last version', secrets[0]);
  console.log('this is the second-last', secrets[1]);
  console.log('this is the third-last', secrets[2]);
});
```

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