data-store
Advanced tools
Comparing version 0.15.5 to 0.16.0
@@ -100,5 +100,12 @@ 'use strict'; | ||
utils.validateName(this, name); | ||
var self = this; | ||
var cwd = path.join(path.dirname(this.path), this.name); | ||
var substore = new Store(name, { cwd: cwd }); | ||
this[name] = substore; | ||
substore.on('set', function(key, val) { | ||
self.set([name, key], val); | ||
}); | ||
return substore; | ||
@@ -105,0 +112,0 @@ }; |
{ | ||
"name": "data-store", | ||
"description": "Easily get, set and persist config data.", | ||
"version": "0.15.5", | ||
"version": "0.16.0", | ||
"homepage": "https://github.com/jonschlinkert/data-store", | ||
@@ -24,10 +24,11 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"dependencies": { | ||
"cache-base": "^0.8.0", | ||
"cache-base": "^0.8.3", | ||
"clone-deep": "^0.2.4", | ||
"define-property": "^0.2.5", | ||
"graceful-fs": "^4.1.3", | ||
"extend-shallow": "^2.0.1", | ||
"graceful-fs": "^4.1.4", | ||
"has-own-deep": "^0.1.4", | ||
"lazy-cache": "^1.0.3", | ||
"lazy-cache": "^2.0.1", | ||
"mkdirp": "^0.5.1", | ||
"project-name": "^0.2.4", | ||
"project-name": "^0.2.5", | ||
"resolve-dir": "^0.1.0", | ||
@@ -80,9 +81,8 @@ "rimraf": "^2.5.2", | ||
"related": { | ||
"highlight": "base-store", | ||
"list": [ | ||
"base", | ||
"cache-base", | ||
"base-store", | ||
"get-value", | ||
"set-value", | ||
"union-value" | ||
"set-value" | ||
] | ||
@@ -89,0 +89,0 @@ }, |
@@ -1,5 +0,7 @@ | ||
# data-store [![NPM version](https://img.shields.io/npm/v/data-store.svg)](https://www.npmjs.com/package/data-store) [![Build Status](https://img.shields.io/travis/jonschlinkert/data-store.svg)](https://travis-ci.org/jonschlinkert/data-store) | ||
# data-store [![NPM version](https://img.shields.io/npm/v/data-store.svg?style=flat)](https://www.npmjs.com/package/data-store) [![NPM downloads](https://img.shields.io/npm/dm/data-store.svg?style=flat)](https://npmjs.org/package/data-store) [![Build Status](https://img.shields.io/travis/jonschlinkert/data-store.svg?style=flat)](https://travis-ci.org/jonschlinkert/data-store) | ||
> Easily get, set and persist config data. | ||
Easily get, set and persist config data. | ||
You might also be interested in [base-store](https://github.com/node-base/base-store). | ||
## TOC | ||
@@ -90,3 +92,3 @@ | ||
### [.set](index.js#L136) | ||
### [.set](index.js#L143) | ||
@@ -123,3 +125,3 @@ Assign `value` to `key` and save to disk. Can be a key-value pair or an object. | ||
### [.union](index.js#L152) | ||
### [.union](index.js#L159) | ||
@@ -143,3 +145,3 @@ Add or append an array of unique values to the given `key`. | ||
### [.get](index.js#L178) | ||
### [.get](index.js#L185) | ||
@@ -164,3 +166,3 @@ Get the stored `value` of `key`, or return the entire store if no `key` is defined. | ||
### [.has](index.js#L194) | ||
### [.has](index.js#L201) | ||
@@ -184,3 +186,3 @@ Returns `true` if the specified `key` has truthy value. | ||
### [.hasOwn](index.js#L215) | ||
### [.hasOwn](index.js#L222) | ||
@@ -209,3 +211,3 @@ Returns `true` if the specified `key` exists. | ||
### [.save](index.js#L236) | ||
### [.save](index.js#L243) | ||
@@ -224,3 +226,3 @@ Persist the store to disk. | ||
### [.clear](index.js#L251) | ||
### [.clear](index.js#L258) | ||
@@ -235,3 +237,3 @@ Clear in-memory cache. | ||
### [.del](index.js#L276) | ||
### [.del](index.js#L283) | ||
@@ -256,3 +258,3 @@ Delete `keys` from the store, or delete the entire store if no keys are passed. A `del` event is also emitted for each key deleted. | ||
### [.define](index.js#L338) | ||
### [.define](index.js#L345) | ||
@@ -269,8 +271,8 @@ Define a non-enumerable property on the instance. | ||
* [base](https://www.npmjs.com/package/base): base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… [more](https://www.npmjs.com/package/base) | [homepage](https://github.com/node-base/base) | ||
* [base-store](https://www.npmjs.com/package/base-store): Plugin for getting and persisting config values with your base-methods application. Adds a 'store' object… [more](https://www.npmjs.com/package/base-store) | [homepage](https://github.com/jonschlinkert/base-store) | ||
You might also be interested in these projects: | ||
* [base-store](https://www.npmjs.com/package/base-store): Plugin for getting and persisting config values with your base-methods application. Adds a 'store' object… [more](https://www.npmjs.com/package/base-store) | [homepage](https://github.com/node-base/base-store) | ||
* [cache-base](https://www.npmjs.com/package/cache-base): Basic object cache with `get`, `set`, `del`, and `has` methods for node.js/javascript projects. | [homepage](https://github.com/jonschlinkert/cache-base) | ||
* [get-value](https://www.npmjs.com/package/get-value): Use property paths (` a.b.c`) to get a nested value from an object. | [homepage](https://github.com/jonschlinkert/get-value) | ||
* [set-value](https://www.npmjs.com/package/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths. | [homepage](https://github.com/jonschlinkert/set-value) | ||
* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://www.npmjs.com/package/union-value) | [homepage](https://github.com/jonschlinkert/union-value) | ||
@@ -312,3 +314,3 @@ ## Contributing | ||
Copyright © 2016 [Jon Schlinkert](https://github.com/jonschlinkert) | ||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT license](https://github.com/jonschlinkert/data-store/blob/master/LICENSE). | ||
@@ -318,2 +320,2 @@ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on March 02, 2016._ | ||
_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on May 19, 2016._ |
16
utils.js
'use strict'; | ||
var utils = module.exports = require('lazy-cache')(require); | ||
var fn = require; | ||
require = utils; // eslint-disable-line | ||
/** | ||
* Expose the `lazy` object | ||
* Utils | ||
*/ | ||
var utils = require('lazy-cache')(require); | ||
var fn = require; | ||
require = utils; // eslint-disable-line | ||
require('clone-deep', 'clone'); | ||
require('extend-shallow', 'extend'); | ||
require('define-property', 'define'); | ||
@@ -70,7 +72,1 @@ require('graceful-fs', 'fs'); | ||
}; | ||
/** | ||
* Expose `utils` | ||
*/ | ||
module.exports = utils; |
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
403
309
19975
12
+ Addedextend-shallow@^2.0.1
Updatedcache-base@^0.8.3
Updatedgraceful-fs@^4.1.4
Updatedlazy-cache@^2.0.1
Updatedproject-name@^0.2.5