# getsecret

> a simple api for retrieving secrets stored in yaml files and environment variables

Latest version **1.0.2** (published 2017-01-30) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2017-01-30 |
| First published | 2015-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Geza Kovacs |
| Maintainers | geza |
| Keywords | secrets, yaml, environment, variables, keys, authentication |

## Links

- npm: https://www.npmjs.com/package/getsecret
- Repository: https://github.com/gkovacs/getsecret
- Issues: https://github.com/gkovacs/getsecret/issues
- npm.io page: https://npm.io/package/getsecret

## Dependencies (1)

- [yamlfile](https://npm.io/package/yamlfile.md) ^1.0.1

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-01-30
- 1.0.1 — 2015-03-18
- 1.0.0 — 2015-03-13

## README

# getsecret

A simple way to get credentials stored in yaml files and environment variables

## Install

    npm install getsecret

## Storing secrets

You can store secrets in 3 locations (in decreasing order of priority)

* An environment variable. These are commonly used in Heroku. ex: `process.env.some_keyname`

* A file named `.getsecret.yaml` in your current directory

* A file named `.getsecret.yaml` in your home directory. The format should map key names to secrets, ie:

    some_keyname: some_secret_value
    another_keyname: another_secret_value

## Accessing secrets from code

Simply pass the key name to getsecret and its value will be returned. ex:

```javascript
var getsecret = require('getsecret')
var secret_value = getsecret('some_keyname')
```

## Author

[Geza Kovacs](http://github.com/gkovacs)

## License

MIT

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