DailyJS

JOQULAR, angular-atomic-notify

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

libraries databases node modules angularjs

JOQULAR, angular-atomic-notify

Posted by Alex R. Young on .
Featured

libraries databases node modules angularjs

JOQULAR, angular-atomic-notify

Posted by Alex R. Young on .

JOQULAR

Simon Y. Blackwell sent in JOQULAR (GitHub: anywhichway/joqular, License: GPL3, npm: joqular), a query language that can be serialised safely as JSON. It has 30 built-in predicates and operators, and extensive date and time representations.

It manages indexes using a just-in-time in-memory database, which is faster than a linear search:

Because JOQULAR defers 75% of the indexing effort until the first query requiring the index, the up front cost of indexing is marginal. It also turns out that the just-in-time indexing has a negligible impact on the first query. What is avoided and passed onto the user as time savings is lots of thrashing during object inserts and updates.

The authors claim it's faster than IndexedDB and PouchDB for insert and search.

The library was created as part of commercial work by the company behind it (AnyWhichWay). The original work was capable of querying Google Cloud Datastore, Quickbase, Elastic Search, and some Amazon AWS services using the same expression language.

To make queries, you need to create some classes to index. You can use plain old prototype classes:

function Person(name,age) {  
  this.name = name;
  this.age = age;
}
Person.prototype = new Entity();

Person = JOQULAR.createIndex(Person, true);

var p1 = new Person('Joe', 24);  
var p2 = new Person('Mary', 18);

Person.joqularSave();  

And then make a query like this:

Person.joqularFind({ name: 'Joe' });  

It's got an ODM feel to it, but you could technically index anything. This example is based on the example code from the wiki -- if you want to read more take a look at the JOQULAR API documentation and the patterns page.

JOQULAR works with Chrome and Node out of the box, but Firefox and IE need polyfills for Object.Observe.

angular-atomic-notify

Maxi Gimenez's angular-atomic-notify (GitHub: maxigimenez/angular-atomic-notify, License: MIT, npm: angular-atomic-notify) is an AngularJS library for presenting notifications. There's an ng-atomic-notify directive, and methods like atomicNotify.info(message, delay) and atomicNotify.error.

The samples use Font Awesome for icons, and the overall design looks Material Design-inspired to me.