Comparing version 0.0.14 to 1.0.0
{ | ||
"name": "confme", | ||
"version": "0.0.14", | ||
"version": "1.0.0", | ||
"description": "Opinionated config library that allows you to have complex config and behaves according to Twelve Factor App rules", | ||
@@ -45,2 +45,3 @@ "main": "src/confme.js", | ||
"dotenv-defaults": "^1.1.1", | ||
"json5": "^2.1.3", | ||
"livr": "^2.2.4", | ||
@@ -47,0 +48,0 @@ "livr-extra-rules": "^1.2.1" |
@@ -21,3 +21,3 @@ ## confme | ||
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. | ||
You can pass a path to a JSON/JSON5 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. | ||
@@ -24,0 +24,0 @@ ### Usage examples |
require("dotenv-defaults").config(); | ||
const JSON5 = require("json5") | ||
const fs = require("fs"); | ||
@@ -12,5 +13,5 @@ | ||
try { | ||
config = JSON.parse(configStr); | ||
config = JSON5.parse(configStr); | ||
} catch (error) { | ||
console.error("CANNOT PARSE JSON:", configStr); | ||
console.error("CANNOT PARSE JSON5:", configStr); | ||
throw error; | ||
@@ -30,3 +31,3 @@ } | ||
const livrRules = JSON.parse(fs.readFileSync(livrSchemaPath).toString()); | ||
const livrRules = JSON5.parse(fs.readFileSync(livrSchemaPath).toString()); | ||
const validator = new LIVR.Validator(livrRules, true); | ||
@@ -33,0 +34,0 @@ validator.registerRules(livrExtraRules); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10319
81
0
4
+ Addedjson5@^2.1.3
+ Addedjson5@2.2.3(transitive)