clikey
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

clikey

Prompts for a single keypress in a node.js CLI app

Usage

#!/usr/bin/env node
const clikey = require('clikey');

(async () => {
  const answer = await clikey('Are you sure? [y/N]');
  // answer received when a single key is pressed

  if (answer.toLowerCase() === 'y') {
    return console.log('You said YES!!!');
  }

  console.log('You said NO');
})();

Install

$ npm install --save clikey

Test

$ npm install && npm test

Package Sidebar

Install

npm i clikey

Weekly Downloads

2

Version

1.0.7

License

BSD-2-Clause

Unpacked Size

2.05 kB

Total Files

4

Last publish

Collaborators

  • zewish