0.2.0 • Published 6 years ago
@t99/delicate v0.2.0
delicate
Touch any key to die!
Find @t99/delicate on NPM.
Table of Contents
Installation
Install from NPM with
$ npm install --save @t99/delicateNote that delicate only works with NodeJS, as it relies on both process#exit and Node's access to stdin (process.stdin).
Basic Usage
import * as delicate from "@t99/delicate";
delicate.prompt();
// Then press a key. You'll never guess what happens next!If you want to change the action that occurs after the any key is pressed:
import * as delicate from "@t99/delicate";
delicate.prompt(() => {
// Die with style.
});If you would rather still use the default implementation but want to exit with a different status code (other than the default exit code, 0):
import * as delicate from "@t99/delicate";
delicate.prompt(42);
// Quit with an exit code of '42'.License
@t99/delicate is made available under the GNU General Public License v3.
Copyright (C) 2019 Trevor Sears