npm

Check out our latest tech talk, "JavaScript Supply Chain Security" presented by VP of Security, Adam Baldwin.Watch it here »

task-manager

1.7.0 • Public • Published

task-manager

NPM version Linux Status Dependency Status Coveralls

Task-manager for cluster or single application, through TCP, TLS, UDP, Unix domain socket.

Use nc, openssl, Telnet or whatever you want as client

Installation

Install through NPM

npm install task-manager

or

git clone git://github.com/hex7c0/task-manager.git

API

for TCP socket

var task = require('task-manager');
 
task(30000); // tcp port

open client for send commands

$ nc 127.0.0.1 30000

for TLS socket

var task = require('task-manager');
 
task(30000, {
  tls: {
    key: ''
  }
}); // tls port and cert key

open client for send commands

$ openssl s_client -connect 127.0.0.1:30000

for UDP socket

var task = require('task-manager');
 
task(30000, {
  udp: true
}); // udp port

open client for send commands

$ nc -u 127.0.0.1 30000

for unix domain socket

var task = require('task-manager');
 
task('s.sock'); // unix domain socket string

open client for send commands

$ nc -U s.sock

commands

show all commands

help

disconnect all children

disconnect

disconnect selected child, with his pid

disconnect 8564

fork a new child

fork

kill all children

kill

kill selected child, with his pid

kill 8564

get father memory

memory

show all pids

ps

get father title

title

set father title

title Ciao

get father uptime

uptime

process exit

exit

close TCP/socket listener

close

task(listen [, options])

listen

  • listen- Number | String Number for TCP, TLS, UDP port, String (path) for Unix Domain socket (default "required")

[options]

  • auth - String Accept commands only if auth is correct (default "disabled")
  • output- Boolean Flag for print info to console (main process) (default "disabled")
  • custom- String | RegExp Custom validation for client command (after built-in command) (default "disabled")
  • callback- Function Execute this function, if custom command is accepted (socket and command as arguments) (default "disabled")
  • json- Boolean Flag for print info in JSON (default "disabled")
  • tls- Object TLS options (default "disabled")
  • udp- Boolean Flag for use UDP socket (default "disabled")

Examples

Take a look at my examples

License GPLv3

install

npm i task-manager

Downloadsweekly downloads

49

version

1.7.0

license

GPL-3.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability