Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
docker-config-loader
Advanced tools
A really simple utility which loads the config from docker secrets if a specified env var is passed, if not it loads the config from a local path
A extremely basic module to load a different config based on the environment.
Base Usage:
var loader = require('docker-config-loader');
var config;
try {
config = loader({secretName:'prod_config.json',localPath:'./local_config.json'})
} catch(e) {
//An Error occured, maybe the config was not found or could not be required.
}
If a environment var with the name set in secretName
exists, the loader prefers it over the local path and tries to load it from /run/secrets/secretName
##Local Loading
The Path is relative to node_modules.
For Example:
if you got a project structure as follows:
- node_modules
- config.json
- src
- index.js
The loader will use the root path of the project,
so if you want to require the config.json
you would have to set the following options:
loader({secretName:'prod_config.json',localPath:'./config.json'})
I hope this module is a nice utility for very basic needs like mine.
FAQs
A really simple utility which loads the config from docker secrets if a specified env var is passed, if not it loads the config from a local path
The npm package docker-config-loader receives a total of 0 weekly downloads. As such, docker-config-loader popularity was classified as not popular.
We found that docker-config-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.