TaffyDB - an open source JavaScript Database for your browser
Installations
npm install taffydb
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
6.6.0
NPM Version
3.10.3
Score
99.8
Supply Chain
100
Quality
80.3
Maintenance
84
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
236,552,787
Last Day
84,513
Last Week
383,156
Last Month
1,861,923
Last Year
30,754,541
GitHub Statistics
2,210 Stars
130 Commits
286 Forks
109 Watching
1 Branches
13 Contributors
Bundle Size
15.41 kB
Minified
4.95 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.7.3
Package Id
taffydb@2.7.3
Size
24.08 kB
NPM Version
3.10.3
Node Version
6.6.0
Publised On
18 Sept 2016
Total Downloads
Cumulative downloads
Total Downloads
236,552,787
Last day
-6.7%
84,513
Compared to previous day
Last week
-15.5%
383,156
Compared to previous week
Last month
1.8%
1,861,923
Compared to previous month
Last year
-34.8%
30,754,541
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
5
TaffyDB (taffy.js)
TaffyDB is an open source JavaScript library that provides powerful in-memory database capabilities to both browser and server applications.
Introduction
Have 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 looks a lot like a database table? We did too.
We created TaffyDB easily and efficiently manipulate these 'tables'
with a uniform and familiar SQL-like interface.
We use TaffyDB instead of ad-hoc data manipulation routines throughout our applications. This reduces development time, improves performance, simplifies maintenance, and increases quality.
Please see the official website for more complete documentation.
What makes it sticky
- Extremely fast
- Powerful JavaScript-centric data selection engine
- SQL inspired features such as insert, update, unique, count, and more
- Robust cross browser support
- Easily extended with your own functions
- Compatible with any DOM library (jQuery, YUI, Dojo, etc)
TaffyDB is compatible with all modern browsers: IE9+, FF3+, Safari 5+, and Chrome 1.0+. It also works in NodeJS 0.10+.
Create a DB
Just pass in a JSON array:
1var product_db = TAFFY([ 2 { "item" : 1, 3 "name" : "Blue Ray Player", 4 "price" : 99.99 5 }, 6 { "item" : 2, 7 "name" : "3D TV", 8 "price" : 1799.99 9 } 10]);
Example queries
1// where item is equal to 1 2var item1 = products({item:1}); 3 4// where price is less than 100 5var lowPricedItems = products({price:{lt:100}}); 6 7// where name is like "Blue Ray" 8var blueRayPlayers = products({name:{like:"Blue Ray"}}); 9 10// get first record 11products().first(); 12 13// get last record 14products().last();
Example record manipulation
1// update the price of the Blue Ray Player to 89.99 2products({item:1}).update({price:89.99}); 3 4// loop over the records and call a function 5products().each(function (r) {alert(r.name)}); 6 7// sort the records by price descending 8products.sort("price desc"); 9 10// select only the item names into an array 11products().select("name"); // returns ["3D TV","Blue Ray Player"] 12 13// Inject values from a record into a string template. 14// Row value will be set to "<tr><td>3D TV</td><td>17999.99</td></tr>" 15var row = products({item:2}) 16 .supplant("<tr><td>{name}</td><td>{price}</td></tr>");
Use it in Node.JS
Node is easy to use in Node.JS. Simply install using npm
and require
the
package:
1$ npm install --production taffy 2 3# and then in your code 4TAFFY = require( 'taffy' ).taffy;
The automated regression test file nodeunit_suite.js
is an excellent
example.
Help improve taffydb
TaffyDB has been used and refined for years for numerous production tools and commercial products. It is therefore is quite stable and reliable. However, we want expand our regression test coverage so we can easily improve the code with the confidence that we are unlikely to break exising capabilities.
Getting started with development
Run the install_dev.sh
script to install development utilities such as jslint
,
nodeunit
, and uglifyjs
to the bin
directory.
1./install_dev.sh
Running regression tests
Running the nodeunit regression test suite is simple:
1cd taffydb 2./install_dev.sh # as above 3 4bin/nodeunit ./nodeunit_suite.js
Please do not send a pull request unless your changes have passed these tests. We check, you know :)
Adding to regression tests
We wish to substantially expand the number of tests, and your
help is welcome! The code, nodeunit_suite.js
, should be easy to adjust.
Pull requests that include regression test inclusions are very much
appreciated. Alternately, if you just send along a test scenario, we'd be
happy to include it in the suite, time permitting.
Documentation, support, updates
View more docs and examples, get support, and get notified of updates:
Web: http://taffydb.com Twitter: http://twitter.com/biastoact
Software License Agreement (BSD License)
Copyright (c) All rights reserved.
Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following condition is met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Stable Version
Stable Version
2.7.3
HIGH
1
7.5/10
Summary
TaffyDB can allow access to any data items in the DB
Affected Versions
<= 2.7.3
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: License:0
- Info: FSF or OSI recognized license: MIT License: License:0
Reason
0 existing vulnerabilities detected
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 6 are checked with a SAST tool
Score
3.2
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to taffydb
@jsdoc/salty
A drop-in replacement for (some of) TaffyDB.
taffydb-es
TaffyDB packed as ESM Module
node-taffydb
TaffyDB is an opensource library that brings database features into your JavaScript applications. This NPM module uses taffy 2.6.1
@asun01/taffydb-new
taffydb-new is clone library from TaffyDB.