load-secret
v0.0.5
Published
Basic secret loader, useful for Self Hosted applications.
Downloads
35
Readme
Load Secret
Basic secret loader, useful for Self Hosted applications.
Usage
import { load } from 'secret-loader';
const value = load('secretName');
It will look for the secret in the following order:
- Environment variable:
process.env.SECRET_${VARIABLE_NAME_UPPERCASE}
- SOPS/Docker Secret:
/run/secrets/secretName
If the secret begins with 'file:', the loader will read the file content at that path and substitute the secret with the file content.