shared-store
Advanced tools
Comparing version 4.0.8 to 4.1.0
@@ -0,1 +1,8 @@ | ||
### v4.1.0 (2021-04-20) | ||
#### 🚀 New Features | ||
* [#51](https://github.com/groupon/shared-store/pull/51) feat: support yaml ([@aaarichter](https://github.com/aaarichter)) | ||
### v4.0.8 (2021-03-26) | ||
@@ -2,0 +9,0 @@ |
@@ -41,2 +41,4 @@ /* | ||
const yaml = require('js-yaml'); | ||
const debug = require('debug')('shared-store:file'); | ||
@@ -64,2 +66,13 @@ | ||
function parseYML(filename, content = '') { | ||
if (content.trim().length === 0) return {}; | ||
try { | ||
return yaml.load(content); | ||
} catch (err) { | ||
err.message += ` in ${filename}`; | ||
throw err; | ||
} | ||
} | ||
/** | ||
@@ -105,2 +118,5 @@ * @param {string} filename | ||
case '.yml': | ||
return parseYML.bind(null, filename); | ||
default: | ||
@@ -107,0 +123,0 @@ return value => value; |
{ | ||
"name": "shared-store", | ||
"version": "4.0.8", | ||
"version": "4.1.0", | ||
"description": "Keeping config data in sync", | ||
@@ -42,5 +42,6 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"cson-parser": "^4.0.8", | ||
"cson-parser": "^4.0.9", | ||
"debug": "^4.3.1", | ||
"deep-freeze-es6": "^1.4.1", | ||
"js-yaml": "^4.1.0", | ||
"lodash.isequal": "^4.5.0", | ||
@@ -56,11 +57,11 @@ "lodash.merge": "^4.6.2", | ||
"@types/rx-lite-aggregates": "^4.0.3", | ||
"c8": "^7.6.0", | ||
"eslint": "^7.22.0", | ||
"eslint-config-groupon": "^10.0.2", | ||
"c8": "^7.7.1", | ||
"eslint": "^7.24.0", | ||
"eslint-config-groupon": "^10.0.3", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-mocha": "^8.1.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"mocha": "^8.3.2", | ||
"nlm": "^5.4.0", | ||
"nlm": "^5.4.1", | ||
"prettier": "^2.2.1", | ||
@@ -67,0 +68,0 @@ "rimraf": "^3.0.2", |
[![nlm-github](https://img.shields.io/badge/github-groupon%2Fshared--store%2Fissues-F4D03F?logo=github&logoColor=white)](https://github.com/groupon/shared-store/issues) | ||
![nlm-node](https://img.shields.io/badge/node-%3E%3D10.13-blue?logo=node.js&logoColor=white) | ||
![nlm-version](https://img.shields.io/badge/version-4.0.8-blue?logo=version&logoColor=white) | ||
![nlm-version](https://img.shields.io/badge/version-4.1.0-blue?logo=version&logoColor=white) | ||
# shared-store | ||
This module allows you load data from a JSON/CSON file, URL or custom loader | ||
This module allows you load data from a `.json`, `.cson` or `.yml` file, URL or custom loader | ||
function and share that data easily amongst multiple node.js worker processes. | ||
@@ -120,3 +120,3 @@ When the data changes, the master process will load the latest changes, which | ||
An observable representing the content of a file. | ||
By default parses the content based on the extension. | ||
By default, parses the content based on the extension. | ||
@@ -129,2 +129,4 @@ Support for the following extensions is built in: | ||
Parsed using [`CSON.parse`](https://github.com/groupon/cson-parser) | ||
* `.yml`: | ||
Parsed using [`yaml.load`](https://github.com/nodeca/js-yaml) | ||
@@ -131,0 +133,0 @@ ##### Options |
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
66878
1160
272
10
+ Addedjs-yaml@^4.1.0
+ Addedargparse@2.0.1(transitive)
+ Addedjs-yaml@4.1.0(transitive)
Updatedcson-parser@^4.0.9