Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Creates a PID file for the running process

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

pid

Install

npm install pid

Usage

var pidfile = require('pid');

pidfile('node-pid'); // /tmp/node-pid.pid -- puts in /tmp with ext .pid by default

pidfile('./node-pid'); // ./node-pid

pidfile('/var/run/node-pid.pid'); // /var/run/node-pid.pid -- if you have permissions

Notes

  • Fails silently and without callback if you don't have write permissions to path
  • adds process.on('exit', fn) event to unlink the pid file on quit
Something went wrong with that request. Please try again.