{"_id":"@derhuerst/cli-on-key","_rev":"2-19dcd9ca2fc10beade876967db7a267a","name":"@derhuerst/cli-on-key","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@derhuerst/cli-on-key","description":"Read command line key presses from process.stdin.","version":"0.1.0","main":"index.js","files":["index.js"],"keywords":["command line","cli","key","keypress","stdin","event"],"author":{"name":"Jannis R","email":"mail@jannisr.de"},"homepage":"https://github.com/derhuerst/cli-on-key","repository":{"type":"git","url":"git+https://github.com/derhuerst/cli-on-key.git"},"bugs":{"url":"https://github.com/derhuerst/cli-on-key/issues"},"license":"ISC","engines":{"node":">=6"},"gitHead":"8c846e06e64deb53fce3ca00f350f16b558fce15","_id":"@derhuerst/cli-on-key@0.1.0","_npmVersion":"5.6.0","_nodeVersion":"9.7.1","_npmUser":{"name":"derhuerst","email":"mail@jannisr.de"},"dist":{"integrity":"sha512-+Q3J+a/4fSyR9SIsV9PEW24AuIHyMwsZ3yNd1nGGOXKIz0aoqovBHE+LQSd7FkfV6ZJi0N1Mw2RwaZq2xMa3BA==","shasum":"5bd4e03f33ff50e2590680ff57be4ad76796924b","tarball":"https://registry.npmjs.org/@derhuerst/cli-on-key/-/cli-on-key-0.1.0.tgz","fileCount":4,"unpackedSize":9474,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDvBVL+2EsMmubcFQgA1df2wEtSsfkT1VtE6ZM+VPLgCAiEA5U96AortZ8PoBBh0dZizsL2Kn5VK0yIVtbdBecXHBNc="}]},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-on-key_0.1.0_1522507084768_0.045982415446950364"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-31T14:38:04.713Z","0.1.0":"2018-03-31T14:38:04.851Z","modified":"2022-04-05T03:48:36.037Z"},"maintainers":[{"name":"derhuerst","email":"mail@jannisr.de"}],"description":"Read command line key presses from process.stdin.","homepage":"https://github.com/derhuerst/cli-on-key","keywords":["command line","cli","key","keypress","stdin","event"],"repository":{"type":"git","url":"git+https://github.com/derhuerst/cli-on-key.git"},"author":{"name":"Jannis R","email":"mail@jannisr.de"},"bugs":{"url":"https://github.com/derhuerst/cli-on-key/issues"},"license":"ISC","readme":"# cli-on-key\n\n**Read command line key presses from process.stdin.** Based on [`TooTallNate/keypress`](https://github.com/TooTallNate/keypress).\n\n[![npm version](https://img.shields.io/npm/v/cli-on-key.svg)](https://www.npmjs.com/package/cli-on-key)\n[![build status](https://api.travis-ci.org/derhuerst/cli-on-key.svg?branch=master)](https://travis-ci.org/derhuerst/cli-on-key)\n![ISC-licensed](https://img.shields.io/github/license/derhuerst/cli-on-key.svg)\n[![chat with me on Gitter](https://img.shields.io/badge/chat%20with%20me-on%20gitter-512e92.svg)](https://gitter.im/derhuerst)\n[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)\n\n\n## Installing\n\n```shell\nnpm install @derhuerst/cli-on-key\n```\n\n\n## Usage\n\n`listen` will switch the stream to [raw mode](https://nodejs.org/api/tty.html#tty_readstream_israw), `stopListening` will revert to the previous value.\n\n```js\nconst listen = require('cli-on-key')\n\nconst stopListening = listen(process.stdin, (key) => {\n\tif (key.ctrl && key.name === 'c') {\n\t\tstopListening() // stop on Ctrl + C\n\t} else console.log(key)\n})\n```\n\n\n## Contributing\n\nIf you have a question or have difficulties using `cli-on-key`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/cli-on-key/issues).\n","readmeFilename":"readme.md"}