Comparing version 0.12.4 to 0.12.5
@@ -114,3 +114,6 @@ 'use strict'; | ||
function db(key) { | ||
var array = db.object[key] = db.object[key] || []; | ||
if (typeof db.object[key] === 'undefined') { | ||
db.object[key] = []; | ||
} | ||
var array = db.object[key]; | ||
var short = lowChain(_, array, _save); | ||
@@ -120,2 +123,6 @@ short.chain = function () { | ||
}; | ||
// Prevents db.write being called when just calling db('foo').value() | ||
short.value = function () { | ||
return db.object[key]; | ||
}; | ||
return short; | ||
@@ -122,0 +129,0 @@ } |
{ | ||
"name": "lowdb", | ||
"version": "0.12.4", | ||
"version": "0.12.5", | ||
"description": "JSON database for Node and the browser powered by lodash", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -10,2 +10,3 @@ # lowdb [![NPM version](https://badge.fury.io/js/lowdb.svg)](http://badge.fury.io/js/lowdb) [![Build Status](https://travis-ci.org/typicode/lowdb.svg?branch=master)](https://travis-ci.org/typicode/lowdb) | ||
const storage = require('lowdb/file-sync') | ||
const db = low('db.json', { storage }) | ||
@@ -16,3 +17,3 @@ | ||
Database is __automatically__ saved to `db.json` | ||
Database is __automatically__ saved to `db.json`. | ||
@@ -33,2 +34,8 @@ ```js | ||
And access underlying database object any time. | ||
```js | ||
db.object.posts | ||
``` | ||
__[Click here to try lowdb in the browser.](http://typicode.github.io/lowdb/)__ | ||
@@ -35,0 +42,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
576412
14639
405
0