docker-secreto
"Secreto" is the word for secret, in Spanish.
This provides a super simple way to pull docker secret
passwords into your code.
Installation
npm i -S docker-secreto
To pull all secrets in
const secreto = require('secreto')
secreto()
.then(secretos => console.info(secretos))
.catch(err => console.error(err))
Output:
{
secret_name: 'secret value goes here',
another_password: 'password123'
}
To pull a specific secret
const secreto = require('secreto')
secreto('secret_name', 'Default Value')
.then(secretos => console.info(secretos))
.catch(err => console.error(err))
Output if there is a match
'secret value goes here'
If there is no matching secret
const secreto = require('secreto')
secreto('secret_name', 'Default Value')
.then(secretos => console.info(secretos))
.catch(err => console.error(err))
Output if there is not a match
'Default Value'