Right now, Elan needs to be installed manually. (This will change in a later version.) To install from source, clone the git repository:
git clone git://github.com/momikey/elan.git
cd elan
npm installIf you want to use Elan in your own project, then, in your project's directory, run:
npm install <path to elan repo>The browser-based version of Elan is built using Gulp. In the top level of the Elan repository, run:
gulpThis will create two files in the build/ directory: elan.js and elan.min.js. The only difference between the two is that elan.min.js is minified using UglifyJS2.
Elan exports two functions that you can use: parse and compile.
In IO.js or Node, these are exported by the Elan module:
// From IO.js/Node
var Elan = require('elan');
Elan.parse("#some code#"); // parses code and returns an AST
Elan.compile("#some code#"); // parses code and compiles into a string that contains JS codeIn the browser, elan.js (or elan.min.js) creates an object called window.Elan:
// From browser-based code
// Elan is created on the global window object when the script loads
Elan.parse("#some code#"); // parses code and returns an AST
Elan.compile("#some code#"); // parses code and compiles into a string that contains JS codeSee this post for examples.
Elan is copyright (C) 2015 Michael Potter under the MIT license .
The browser version of Elan contains code from the following: