narwhal-bindeprecated

Node.js binary wrapper for Narwhal 0.3.2

Usage no npm install needed!

<script type="module">
  import narwhalBin from 'https://cdn.skypack.dev/narwhal-bin';
</script>

README

narwhal-bin

narwhal-bin is a Node.js binary wrapper for Narwhal 0.3.2.

Installation

$ npm install --save narwhal-bin

Usage

var child_process = require('child_process');
var narwhal = require('narwhal-bin');

// Using `child_process.spawn`
var proc = child_process.spawn(narwhal.path, ['file.js']);

proc.stdout.on('data', function (data) {
  console.log(data);
});

proc.stderr.on('data', function (data) {
  console.log(data);
});

proc.on('close', function (code) {
  console.log('Code ' + code);
});

// Using `child_process.execFile`
child_process.execFile(narwhal.path, ['file.js'], function (err) {
  if (err) { throw err; }

  console.log('`file.js` ran!');
});

CLI

$ npm install --global narwhal-bin
$ narwhal --help