chamomile

Javascript but slightly less annoying

npm install chamomile
2 downloads in the last week
4 downloads in the last month

Chamomile: A JavaScript superset.

This package implements a compiler that translates Chamomile into JavaScript. Chamomile is a superset of JavaScript (all valid JavaScript is also valid Chamomile).

It is a fork of http://github.com/mishoo/UglifyJS/ so provides the same minifying/beautifying features of that project. It is also distributed under the BSD license.

Shortcuts added:

Short functions

Chamomile:

var f = -> { return 1 }

JavaScript:

var f = function() { return 1 }

Short functions that preserve this

Chamomile:

var f = (arg) => { return this.cat(arg) }

JavaScript:

var f = (function(arg) { this.cat(arg) }).bind(this)

Accessing members of this

Chamomile:

@member = 420;
@method('argument!')

JavaScript:

this.member = 420;
this.method('argument!')

Installation

% npm install -g chamomile

Usage

% chamomile source.chmo > output.js
% chamomile -o output.js source.chmo
% chamomile --help
npm loves you