README
PMT
PMT is a process manager for node.js.
Brief
- PMT is still developing.
- PMT haven't tested in windows.
- Will release v1.0.0 when Stable.
- Thanks for testing.
- If you have any suggestions, please send email to 277501642@qq.com or create new issue.
Installation
$ npm install pmt -g
Example
See test/test.js and test/index.js to use pmt.
test.js
var pmt = require('pmt');
pmt.start({
'name' : 'myTitan', // your app name
'entrance' : 'index.js', // your app entrance js
'worker_count' : 0, // worker count, 0 for cpu count, default : 0
'args' : '--harmony', // your app args
'max_momery' : '128', // worker max momery restart / MB, 0 for not based on max memory to restart,default : 0
'auto_restart' : false // auto restart if worker stopped or errored, default : false
},function (){
pmt.disconnect();
});
index.js
var net = require('net');
var server = net.createServer(function(c) {
c.write('hello world');
c.end();
});
server.listen(8080);
node
$ node test.js
Command
$ npm install pmt --save # for require
$ npm install pmt -g # for easy CLI
$ pmt start [appName]/all # start [appName]/all when stop
$ pmt stop [appName]/all # stop [appName]/all
$ pmt kill # kill pmt daemon
$ pmt reboot # reboot pmt daemon
$ pmt restart [appName]/all # restart [appName]/all
$ pmt grestart [appName]/all # restart [appName]/all gracefully
$ pmt list # list all workers status
$ pmt monit # monit all workers status/cpu/monery
$ pmt logs # tail your app log
$ pmt daemonlogs # tail pmt daemon log
Design document(Adding)
License
MIT