2014-08-21 00:00:00 +0100 by Alex R. Young

LowDB (GitHub: typicode / lowdb, License: MIT, npm: lowdb) by typicode is a JSON database that uses Lo-Dash. Rather than using a MongoDB-inspired API, it feels more like functional JavaScript.

Data is queried using familiar chained operators, ending in value when you want to obtain the result:

var topFiveSongs = low('posts')
  .where({ published: true })

LowDB accepts some configuration options, allowing you to control how it behaves. For example, if you want to use it like an in-memory database, then you can set autoSave to false:

var low = require('lowdb')
low.autoSave = false;

There's also a short syntax API for the basic operations. To perform a where query, you can do this:

low('songs', {title: 'low!'})
// -> low('songs').where({title: 'low!'}).value()

low('songs', {published: false}, {published: true})
// -> low('songs').updateWhere({published: false}, {published: true}).value()

It doesn't seem to work with localStorage, which I think would be cool, but it might work with Browserify.