1.0.7 • Published 3 years ago

clikey v1.0.7

Weekly downloads
3
License
BSD-2-Clause
Repository
github
Last release
3 years ago

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
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago