Skip to content

JCloudYu/phook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Process Hook (PHook)

This library is designed to allow developers to hook clear handlers before the process exits.

Install

Run the following command

npm install phook

APIs

phook.configure

Allow developers to modify the phook's default behaviors

phook.configure({
	// True prevents the system from showing error logs
	silent: false,

	durations: {
		// Duration before exit when system receives SIGINT
		// Set to negative value to stop quiting
		SIGINT: 100,

		// Duration before exit when receiving SIGTERM
		// Set to negative value to stop quiting
		SIGTERM: 100,

		// Duration before exit when receiving SIGQUIT
		// Set to negative value to stop quiting
		SIGQUIT: 100,

		// Duration before exit when receiving any unhandled error
		// Set to negative value to stop quiting
		UNHANDLED_ERROR: 100
	}
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published