when-exit
Execute a function right before the process, or the browser's tab, is about to exit.
Last updated a year ago by fabiospampinato .
Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install when-exit 
SYNC missed versions from official npm registry.

WhenExit

Execute a function right before the process, or the browser's tab, is about to exit.

Install

npm install --save when-exit

Usage

import whenExit from 'when-exit';

onExit ( () => {
  console.log ( 'Callback 1' );
});

onExit ( () => {
  console.log ( 'Callback 2' );
});

const disposer = onExit ( () => {
  console.log ( 'Callback 3' );
});

disposer ();

process.exit (); // Callback 1 and 2 are called before exiting

License

MIT © Fabio Spampinato

Current Tags

  • 2.1.2                                ...           latest (a year ago)

5 Versions

  • 2.1.2                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (3)

Copyright 2013 - present © cnpmjs.org | Home |