@venuee/docker-secrets
v1.0.0
Published
Converts Docker Secrets mounted into a container to an object.
Downloads
3
Maintainers
Readme
Docker Secrets
This NPM module loads Docker secrets from directory created by Docker Swarm into a JS object for use within Node.js applications.
Installation
npm install @venuee/docker-secrets
Usage
const getSecrets = require('@venuee/docker-secrets');
const secrets = getSecrets('/run/secrets')
// or const secrets = getSecrets('/run/secrets/myDir')
console.log(secrets)
{
secret_1: ...,
secret_2: ...,
}
const secret_1 = secrets['secret_1'];