Socket
Socket
Sign inDemoInstall

lowdb

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lowdb - npm Package Compare versions

Comparing version 0.11.1 to 0.11.2

11

index.js
'use strict';
var lodash = require('lodash');
var isPromise = require('is-promise');

@@ -98,3 +99,11 @@ // Returns a lodash chain that calls .value()

if (db.source && db.read) {
db.object = db.read(db.source, db.deserialize);
var res = db.read(db.source, db.deserialize);
if (isPromise(res)) {
return res.then(function (obj) {
db.object = obj;
return db;
});
} else {
db.object = res;
}
}

@@ -101,0 +110,0 @@

5

package.json
{
"name": "lowdb",
"version": "0.11.1",
"version": "0.11.2",
"description": "JSON database for Node and the browser powered by lodash",

@@ -21,3 +21,3 @@ "keywords": [

"scripts": {
"test": "babel-node test/all && standard {src,test}/**/*.js",
"test": "babel-node test/all && standard",
"prepublish": "npm run build",

@@ -39,2 +39,3 @@ "precommit": "npm test",

"graceful-fs": "^3.0.8",
"is-promise": "^2.1.0",
"json-parse-helpfulerror": "^1.0.3",

@@ -41,0 +42,0 @@ "lodash": "^3.1.0",

@@ -32,4 +32,6 @@ # 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)

Please note that lowdb can only be run in one instance of Node, it doesn't support Cluster.
_Examples use ES2015 syntax, it's supported by Node 5+. Node 0.12 is supported too but you need to use the older syntax._
_Please note that lowdb can only be run in one instance of Node, it doesn't support Cluster._
## Install

@@ -51,3 +53,3 @@

Lowdb is also very easy to learn since it has __only 4 methods and properties__.
Lowdb is also very easy to learn since it has __only a few methods and properties__.

@@ -144,5 +146,4 @@ _lowdb powers [json-server](https://github.com/typicode/json-server) package, [jsonplaceholder](http://jsonplaceholder.typicode.com/) website and [many other great projects](https://www.npmjs.com/browse/depended/lowdb)._

// To create read-only or write-only database
// pass only the read or write function.
// For example:
// To create read-only or write-only database,
// set only storage.read or storage.write
const fileSync = require('lowdb/fileSync')

@@ -166,3 +167,3 @@

storage: {
read: (source, deserialize) => // obj
read: (source, deserialize) => // obj or a Promise
write: (dest, obj, serialize) => // undefined or a Promise

@@ -169,0 +170,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