zest-runner
v0.0.6
Published
A runtime for Zest scripts.
Downloads
29
Maintainers
Readme
zest-runner
A runtime for Zest scripts.
To use
- Install it:
```bash
$ npm i zest-runner
```
- Require it and use:
```js
var ZestRunner = require('zest-runner');
var opts = {
sourceType: 'file',
file: 'abc.zst'
};
var zr = new ZestRunner(opts);
zr.run();
```
Example
Run zest script from a file.
var ZestRunner = require('zest-runner');
var opts = {
sourceType: 'file',
file: 'abc.zst'
};
var zr = new ZestRunner(opts);
zr.run().then(resultHandler); // Run the script, returns a promise
run()
returns a javascript promise object, which could be used with .then
.
zr.run()
.then(function (r) {
// parse the result and use
});
Example of a run result.
Run zest script from a json object.
var opts = {
sourceType: 'object',
zest: objData
};
var zr = new ZestRunner(opts);
zr.run().then(resultHandler);
LICENSE
MPL