Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

carcass-monitor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carcass-monitor

(Node.js) A simple wrap of forever-monitor, in Carcass style.

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

Carcass Monitor

A simple wrap of forever-monitor, in Carcass style.

This is only meant to be used in tests where you need to start and stop some scripts easily. For production, use forever or equivalent.

Quick Example

In a Mocha test:

var Monitor = require('carcass-monitor');

describe('Something:', function() {
    var monitor = new Monitor();

    before(function(done) {
        /**
         * Each stack will be started with an instance of forever Monitor, in
         *   the syntax of:
         *
         * `new forever.Monitor('something', {...other_options...});`
         */
        monitor.stack({
            script: 'something',
            sourceDir: 'somewhere',
            options: ['some', 'options']
        }).stack(...).start(done);
    });

    after(function(done) {
        monitor.close(done);
    });

    ...
});

APIs

Instantiate

var monitor = new Monitor([id])

ID is optional; defaults to a random string.

Add an item

monitor.stack(options)

Returns the monitor itself so it's chain-able. options is an object and will be used to instantiate a forever.Monitor, with options.script as the first argument, and the others as the second. See forever-monitor's document for details.

Can be used multiple times to add multiple items.

Start

monitor.start(done)

Starts all the items; returns the monitor itself.

Close

monitor.close(done)

Closes (stops) all the items; returns the monitor itself.

Keywords

carcass

FAQs

Package last updated on 23 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts