Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to detech ctrl+C exist in nodejs

export const detectKeyboard = () => {
	process.openStdin().on('keypress', function (_, key) {
		if (key && key.name === 'c' && key.ctrl) {
			deleteData()
			process.exit()
		}
	})
}
 
PREVIOUS NEXT
Tagged: #detech #exist #nodejs
ADD COMMENT
Topic
Name
3+7 =