docker-hush-hush

2.1.1 • Public • Published

docker-hush-hush

Node module to retrieve docker secrets

Usage:

const hush = require('docker-hush-hush');

// Get all secrets in '/run/secrets' dir
const secrets = hush.getAllSecrets();
console.log(secrets);

// Get single secret in '/run/secrets' dir
const secretName = 'fieldName';
const secret = hush.getSecret(secretName);
console.log(secret);

// Change default dir (i.e. other than /run/secrets)
hush.setBasePath('./different/path');

// Disable caching. 
// By default values will be accessed via fs once.
// After that they are retrieved from memory.
// Using this ensures they are always accessed via fs.
hush.disableCache();

// Here's a good way to get all secrets into process.env in one step
process.env = { ...process.env, ...hush.getAllSecrets() };

Readme

Keywords

Package Sidebar

Install

npm i docker-hush-hush

Weekly Downloads

1

Version

2.1.1

License

ISC

Unpacked Size

9.33 kB

Total Files

7

Last publish

Collaborators

  • amodelbello