chamomile

0.10.0 • Public • Published

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

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i chamomile

    Weekly Downloads

    1

    Version

    0.10.0

    License

    none

    Last publish

    Collaborators

    • jpike