Skip to content

denosaurs/exit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exit

Tags CI Status License

Handle SIGQUIT, SIGINT, and SIGTERM in your application.


⚠️ Signals are still not very well supported in deno. As APIs become more stable this library will be updated. Currently not supported for windows


import { onExit, exit } from "https://deno.land/x/exit/mod.ts";

onExit(() => {
  console.log("Program is exiting, doing some cleanup!");
});

onExit(async () => {
  console.log("I will be called after the first one!");
});

exit(0); // needed as signal hooks need to be disposed

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.

Licence

Copyright 2020-present, the denosaurs team. All rights reserved. MIT license.