1.0.5 • Published 7 years ago
@strong-roots-capital/docker-secrets-nodejs v1.0.5
Install
npm install @strong-roots-capital/docker-secrets-nodejsUse
Note that docker-secrets take precedence over environment variables.
import * as secrets from 'docker-secrets-nodejs'
secrets.setupSecretsDir('/dir') // optional, default directory is '/run/secrets'
secrets.get('env_variable_a') // will try to get
// - `env_variable_a` from /run/secrets/env_variable_a, or
// - $ENV_VARIABLE_A from environment variablesConventions
Several conventions for this library:
* the secret name has to always be in lowercase from secrets of docker.
* the environment variable name has to be in uppercase.
* it doesn't matter whether you pass the parameter in 'secrets.get()' using lowercase or uppercase, it converts accordingly.Any suggestion is welcome!
1.0.5
7 years ago