An event-based command executor written for nodejs.

Usage no npm install needed!

<script type="module">
  import exeggutor from 'https://cdn.skypack.dev/exeggutor';


npm npm npm

Gitlab pipeline status Gitlab code coverage


Exeggutor is a simple, event-driven commandline executor written for nodejs.

Exeggutor lets you subscribe multiple listeners to the stdout and stderr pipes. This allows you to process large outputs in chunks rather than one large blob - avoiding issues regarding maximum length. It's also a nice alternative to complex shell scripting, if the environment already contains NodeJs


Quick Start

In JavaScript:

const { execute } = require('exeggutor');
await execute('ls', ['-la']);

In TypeScript:

import { execute } from 'exeggutor';
await execute('cat', ['a_really_large_input_file.txt']);


In some instances, you may want to perform more complex parsing on the outputs of a command.

First, construct an Exeggutor instance to handle events.

In JavaScript:

const { Exeggutor } = require('exeggutor');
const exeggutor = new Exeggutor();

In TypeScript:

import { Exeggutor } from 'exeggutor';
const exeggutor: Exeggutor = new Exeggutor();

Next, add one to many event listeners to the stdout and stderr events.

    .on('stdout', (buf) => {
        /* possibly write to stdout */
    .on('stdout', (buf) => {
        /* possibly parse for keywords/ symbols */
    .on('stderr', (buf) => {
        /* possibly write to stderr */