<commit_before># Expressionist

[![Build Status](https://travis-ci.org/olalonde/expressionist.png)](https://travis-ci.org/olalonde/expressionist) [![NPM version](https://badge.fury.io/js/expressionist.png)](http://badge.fury.io/js/expressionist)

Programmatically generate expression trees in Node.js or plain browser Javascript.

## Install

    npm install expressionist

## Usage

```javascript
var WhereExpression = require('expressionist')([
  'or', 'and', 'eql', 'notEql', 'in'
]);

var _ = WhereExpression.start;

var res = 
  _('country')
  .eql('Canada')
  .or(
    _('country').eql('USA')
    .and(_('job').notEql('spy'))
    .and(_('company').notEql('nsa'))
  );

  var pretty = res.pretty();

  console.log(util.inspect(pretty, null, 10));

/* 

Outputs:

  { or:
   [ { eql: [ 'country', 'Canada' ] },
     { and:
        [ { eql: [ 'country', 'USA' ] },
          { notEql: [ 'job', 'spy' ] },
          { notEql: [ 'company', 'nsa' ] } ] } ] }

*/
```

## Roadmap

- Syntax sugar. 
- Operator precedence.
- Browser friendly build.<commit_msg>fixed typo<commit_after># Expressionist

[![Build Status](https://travis-ci.org/olalonde/expressionist.png)](https://travis-ci.org/olalonde/expressionist) [![NPM version](https://badge.fury.io/js/expressionist.png)](http://badge.fury.io/js/expressionist)

Programmatically generate expression trees in Node.js or plain browser Javascript.

## Install

    npm install expressionist

## Usage

```javascript
var WhereExpression = require('expressionist')([
  'or', 'and', 'eql', 'notEql', 'in'
]);

var _ = WhereExpression.start;

var res = 
  _('country')
  .eql('Canada')
  .or(
    _('country').eql('USA')
    .and(_('job').notEql('spy'))
    .and(_('company').notEql('nsa'))
  );

var pretty = res.pretty();

console.log(util.inspect(pretty, null, 10));

/* 

Outputs:

  { or:
   [ { eql: [ 'country', 'Canada' ] },
     { and:
        [ { eql: [ 'country', 'USA' ] },
          { notEql: [ 'job', 'spy' ] },
          { notEql: [ 'company', 'nsa' ] } ] } ] }

*/
```

## Roadmap

- Syntax sugar. 
- Operator precedence.
- Browser friendly build.
{'fraction_non_alphanumeric': 0.20692928334124347, 'fraction_numerical': 0.0018984337921214998, 'mean_word_length': 3.3734439834024896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4239616', 'n_tokens_mistral': 804, 'n_tokens_neox': 763, 'n_words': 138}