exeggutor
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

npm npm npm

Gitlab pipeline status Gitlab code coverage

Exeggutor

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

Documentation

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']);

Exeggutor

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.

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

Package Sidebar

Install

npm i exeggutor

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

8.48 kB

Total Files

6

Last publish

Collaborators

  • noface