@tiaanduplessis/cleanup

1.0.0 • Public • Published

@tiaanduplessis/cleanup

package version package downloads standard-readme compliant package license make a pull request

Cleanup when process is terminated

Table of Contents

Install

This project uses node and npm.

$ npm install @tiaanduplessis/cleanup
$ # OR
$ yarn add @tiaanduplessis/cleanup

Usage

const {cleanup} = require('@tiaanduplessis/cleanup')

const remove = cleanup((opts) => {
  console.log(opts) // { event: 'SIGINT' }
  session.close()
  driver.close()
}, {
  exit: true // call process.exit after handler
})

remove()// will remove handler

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @tiaanduplessis/cleanup

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.95 kB

Total Files

5

Last publish

Collaborators

  • tiaanduplessis