Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (16 sloc) 388 Bytes

atExit

like ruby #at_exit

usage

var at_exit = require('at-exit');
at_exit(function() {
  console.log("at exit!");
});



var express = require('express'),
  app = express.createServer(),
  at_exit = require('at-exit');

at_exit(function() {
  app.listen(3000);
});

app.get('/', function(req, res) {
  res.send('example');
});