zest-runner

0.0.6 • Public • Published

zest-runner

Build Status

NPM

A runtime for Zest scripts.

To use

  1. Install it:
```bash
$ npm i zest-runner
```
  1. 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

Package Sidebar

Install

npm i zest-runner

Weekly Downloads

1

Version

0.0.6

License

MPL

Last publish

Collaborators

  • darkowlzz