caql-js-compiler
Compile CaQL queries into executable JavaScript.
Learn more: Calypso Query Language (CaQL) Specification.
Install
npm install caql-js-compiler
Example
var JSCompiler = ; var entries = name: 'Postini' founded_year: 1999 total_money_raised: '$0' name: 'Digg' founded_year: 2004 total_money_raised: '$45M' name: 'Airbnb' founded_year: 2007 total_money_raised: '$120M' name: 'TripIt' founded_year: 2006 total_money_raised: '$13.1M' name: 'Twitter' founded_year: 2006 total_money_raised: '$1.16B' name: 'Spotify' founded_year: 2006 total_money_raised: '$183M' name: 'Airbnb' founded_year: 2008 total_money_raised: '$776.4M' ; var compiler = ; var query = 'select name, founded_year, total_money_raised as worth ' + 'where founded_year >= 1999 and name not like "%air%" ' + 'order by founded_year desc, name'; compiler ; // Output://// { name: 'Spotify', founded_year: 2006, worth: '$183M' }// { name: 'TripIt', founded_year: 2006, worth: '$13.1M' }// { name: 'Twitter', founded_year: 2006, worth: '$1.16B' }// { name: 'Digg', founded_year: 2004, worth: '$45M' }// { name: 'Postini', founded_year: 1999, worth: '$0' }
License
MIT