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'];