Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

confme

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confme - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

4

package.json
{
"name": "confme",
"version": "0.0.5",
"description": "Opinionated config library that allows you to have complex config and behaves according to 12-factors apps rules ",
"version": "0.0.6",
"description": "Opinionated config library that allows you to have complex config and behaves according to 12-factor app rules ",
"main": "src/confme.js",

@@ -6,0 +6,0 @@ "directories": {

@@ -5,9 +5,9 @@ ## confme

- It is build on top of ["dotenv-defaults"](https://www.npmjs.com/package/dotenv-defaults)
- It is build on top of [dotenv-defaults](https://www.npmjs.com/package/dotenv-defaults)
- Uses [LIVR](https://www.npmjs.com/package/livr) ([with extra rules](https://www.npmjs.com/package/livr-extra-rules)) for config schema validation.
- Follows the ideas of ["Twelve Factor App"](https://12factor.net/config)
- Follows the ideas of [Twelve Factor App](https://12factor.net/config)
### How does it work?
"confme" loads your config and replaces placeholders with environment variables. For environemnt loading it uses ["dotenv-defaults"](https://www.npmjs.com/package/dotenv-defaults), so you can create ".env.defaults" file to set default values of environment variables. If you have placeholders for non set environment variables then "confme" will throw an error.
"confme" loads your config and replaces placeholders with environment variables. For environemnt loading it uses [dotenv-defaults](https://www.npmjs.com/package/dotenv-defaults), so you can create ".env.defaults" file to set default values of environment variables. If you have placeholders for non set environment variables then "confme" will throw an error.

@@ -83,2 +83,3 @@ You can pass a path to a JSON file with [LIVR](https://www.npmjs.com/package/livr) rules as a second argument. In this case, it will use [LIVR](https://www.npmjs.com/package/livr) ([with extra rules](https://www.npmjs.com/package/livr-extra-rules)) to validate the config.

- `node app.js`
- `DOMAIN=myapp.com PORT=80 node app.js`
- `DOMAIN=myapp.com PORT=80 node app.js`
- `PORT='AAA' node app.js`

@@ -29,3 +29,7 @@ require("dotenv-defaults").config();

if (!validConfig) {
throw new Error(JSON.stringify(validator.getErrors(), null, 2));
const error = {
FAILED_CONFIG: config,
ERRORS: validator.getErrors()
};
throw new Error(JSON.stringify(error, null, 2));
}

@@ -32,0 +36,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc