npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pm

v2.2.6

Published

Process Manager for Node.js, branched from node-cluster.

Downloads

8,926

Readme

npm version Build Status Coverage Status npm download

About

pm 是一个轻量级的Node.js多进程管理器,基于之前的node-cluster重构而来,在淘宝内部的生产系统中得到了广泛的应用.

  • 基于 master + worker 模式,master负责进程管理,worker 处理业务逻辑,有效利用现代服务器的多CPU;
  • 同一 master 可管理多种类型的worker, 并且支持在不同类型的 worker 之间进行轻量的消息传递;
  • 同一类型的 worker ,对于TCP请求,采用抢占式的方式进行负载均衡;
  • 平滑退出和 不退出前提下的 worker 进程重载 (reload).

Api

  • Visit the wiki page to get more infomation about pm.
  • Also, we supply demo scripts in the code directory demo.

Install

$ npm install pm

Benchmark


$ siege -b -c100 -t 60S http://172.0.0.2:33749/
  • QPS (only one child, http server, response req.url) (node0.6.17):

Usage

  • in master.js, run as master:
var app = require('pm').createMaster({
 'pidfile' : '/tmp/demo.pid',
});

app.register('group1', __dirname + '/http.js', {
 'listen' : [8080, 8081], 
 'addr': '127.0.0.1' // it uses '0.0.0.0' by default
});

app.on('giveup', function (name, num, pause) {
  // YOU SHOULD ALERT HERE!
});
app.dispatch();
  • in http.js, run as worker:
var http = require('http').createServer(function (req, res) {
 res.end('hello world');
});

require('pm').createWorker().ready(function (socket, port) {
 http.emit('connection', socket);
});

Contributors

Thanks goes to the people who have contributed code to this module, see the GitHub Contributors page.

Below is the output from git-summary

 project: pm
 commits: 91
 files  : 27
 authors: 
    86	aleafs                  94.5%
     4	wanglang                4.4%
     1	fengmk2                 1.1%

License

pm is published under MIT license. See license text in LICENSE file.