npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

iproc

5.1.2 • Public • Published

Node module to simulate processes.

Usage:

var iproc=require("iproc");
var proc=iproc();

// create a process - pid returned
var pid=proc.create({
    exec:function(){
        /*code here*/
        self.onmessage=function(ev){
            // ev.data = message
            postMessage("/*message back to main process*/");
        };
    },
    autostart:(true|false),
    name:"process name",
    onmessage:function(ev){/*ev.data is the message*/}
});

// start a process via pid
proc.start(pid);

// stop an active process via pid
proc.stop(pid);

// stop and kill a process via pid
proc.destroy(pid);

// send message to process
proc.message(pid,message);

// get info on a pid
proc.info(pid);

// list active processes pids
proc.list();

Since last publish, I have completely reworked the system, not it only takes a function, (it can take a filepath if needed)

install

npm i iproc

Downloadsweekly downloads

5

version

5.1.2

license

ISC

last publish

collaborators

  • avatar
Report a vulnerability