elasticsearch/elasticsearch-lang-javascript — pull request #11 by dadoonet (2014-01-15 14:25:22+00:00)
Title: Add support for CommonJS with Rhino

You can add your javascript modules under `config/scripts/modules/` and use them
in scripts:

For example, add `config/scripts/modules/pi.js`

```javascript
exports.getPI = function(value) {
return 3.14;
};
```

You can use it in a script:

```javascript
var pi = require('pi');
ctx.pi = pi.getPI();
```

Closes #6.
Closes #7.