1.0.0 • Published 6 years ago

@tiaanduplessis/cleanup v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@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

1.0.0

6 years ago