Port of TaffyDB to work as Node NPM Module
Here are some quick instructions on how to use this module. You can see the help docs located at http://www.taffydb.com/
You will have to first require the module
var TAFFY = require('node-taffydb').TAFFY;
Next, pass an array of objects.
// Create DB and fill it with records
var friends = TAFFY([ {"id":1,"gender":"M","first":"John","last":"Smith","city":"Seattle, WA","status":"Active"}, {"id":2,"gender":"F","first":"Kelly","last":"Ruth","city":"Dallas, TX","status":"Active"}, {"id":3,"gender":"M","first":"Jeff","last":"Stevenson","city":"Washington, D.C.","status":"Active"}, {"id":4,"gender":"F","first":"Jennifer","last":"Gill","city":"Seattle, WA","status":"Active"} ]);
Now you can query friends and do different operations. I have highlighted a few below.
var results = friends().get();
var results = friends().order("city asec").get();
var results = friends().order("city desc").get();
var results = friends({gender:"F"}).get();
var results = friends().last();
var results = friends().first();
var results = friends({id:2}).select("id","gender");
var results = friends().distinct("first");