# taffydb **Repository Path**: mirrors_developit/taffydb ## Basic Information - **Project Name**: taffydb - **Description**: TaffyDB - an open source JavaScript Database for your browser - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TaffyDB (taffy.js) TaffyDB is an open source library that brings database features into your JavaScript applications. ## Introduction How you ever noticed how JavaScript object literals look a lot like records? And that if you wrap a group of them up in an array you have something that atcs a lot like a database table? TaffyDB brings powerful database funtionality to that concept and rapidly improves the way you work with data inside of JavaScript. ## What makes it sticky - Extremely fast - Powerful JavaScript centric data selection engine - Database inspired features such as insert, update, unique, count, etc - Robust cross browser support - Easily extended with your own functions - Compatible with any DOM library (jQuery, YUI, Dojo, etc) - Compatible with CommonJS (node.js, etc) ## Create a DB Just pass in JSON: var products = TAFFY([{ "item":1, "name":"Blue Ray Player", "price":99.99 }, { "item":2, name:"3D TV", price:1799.99 }]); ## Find data Use JSON to compare: var item1 = products({item:1}); // where item is equal to 1 var lowPricedItems = products({price:{lt:100}}); // where price is less than 100 var blueRayPlayers = products({name:{like:"Blue Ray"}}); // where name is like "Blue Ray" ## Use data // update the price of the Blue Ray Player to 89.99 products({item:1}).update({price:89.99}); // loop over the records and call a function products().each(function (r) {alert(r.name)}); // get first record products().first(); // get last record products().last(); // sort the records by price descending products.sort("price desc"); // select only the item names into an array products().select("name"); // returns ["3D TV","Blue Ray Player"] // inject values from a record into a string template var row = products({item:2}).supplant("