@archivistnerd/onkeypress

1.0.5 • Public • Published

node-onkeypress

npm version

Archivist Nerd's onkeypress Package

Calls a callback function after key has been pressed (terminal)

Installation

npm install --save @archivistnerd/onkeypress

Usage

'use strict';

const onKeypress = require('@archivistnerd/onkeypress');

process.stdout.write(`Test: onKeypress (Package)\n`)

onKeypress( ()=>{
  process.stdout.write(`Closing\n`)
  process.exit(0)
})

Note

You can change the message as well by providing it as a second argument.

'use strict';

const onKeypress = require('@archivistnerd/onkeypress');

process.stdout.write(`Test: onKeypress (Package)\n`)

onKeypress( ()=>{
  process.stdout.write(`Closing\n`)
  process.exit(0)
}, 'I will close after you press a key...')

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @archivistnerd/onkeypress

Weekly Downloads

4

Version

1.0.5

License

MIT

Unpacked Size

3.24 kB

Total Files

4

Last publish

Collaborators

  • archivistnerd