JQ

a DSL for querying javascript object.

npm install JQ
13 downloads in the last day
71 downloads in the last week
349 downloads in the last month

JQ Build Status

JQ is a DSL for querying javascript object. APIs are very similar to jQuery. If you know jQuery, you can use this library immediately.

Instalation

via npm:

$ npm install JQ

Browser Support

To compile JQ to a single file runnable for client-side use simply execute:

$ make JQ.js

Sample

var JQ = require('JQ').JQ;

var family = {
  father_name: 'bob',
  mother_name: 'kathy',
  children: [
    { 
      name: 'john',
      age: 3
    },
    {
      name: 'alice',
      age: 2
    },
    {
      name: 'mike',
      age: 1
    }
  ]
};

var $family = JQ(family);
$family("name === 'john' || age === 1").get(0); // -> { name: 'john', age: 3 }
$family("name === 'john' || age === 1").get(1); // -> { name: 'make', age: 1 }
npm loves you