Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Manage the configuration of your Nodejs application with multiple environments and custom preferences, utilizing Configuru in CI and development as well!
Manage the configuration of your Nodejs application with multiple environments and custom preferences, utilizing Configuru in CI and development as well!
Configuru is a library for configuration management. Merge default project configuration with your user config, you can link yo your project. Atop of that, override your configuration with system environment variables.
npm install configuru
.env.jsonc
in root of your project, add defaults or placeholders.{
// HTTP server
"SERVER_PORT": 3000 // port the server will be listening on
}
(optional) As a developer (or environment), create a custom override file (e.g. ~/.env/my-project.jsonc
) and save the path in your CFG_JSON_PATH
.
Create a configuration module (e.g. config.ts
)
import { createLoader, values } from 'configuru'
// create loader that cascades overrides and creates a config storage
const loader = createLoader()
// Pass configuration schema to `values` transformer to get configuration
export default values({
server: {
// use loader accessors, place them in custom structure
// loader parses correct type from store
port: loader.number('SERVER_PORT'),
},
})
import config from './config' // e.g. { server: { port: 3000 } }
console.log(config.server.port) // 3000
config
- Simple JSON config loader using NODE_ENVdotenv
- Load your configuration file to process.ENVcosmiconfig
- Traverse your filesystem to load find your lost configuration fileconfigstore
- KV storage for configurationfiggy-pudding
- Config object builder / storageKnow other popular projects that solve the same issue? Open a PR to help people find what they need!
This project is licensed under MIT.
FAQs
Manage the configuration of your Nodejs application with multiple environments and custom preferences, utilizing Configuru in CI and development as well!
The npm package configuru receives a total of 0 weekly downloads. As such, configuru popularity was classified as not popular.
We found that configuru demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.