HomeBlog
todo

Input-Deno v2.0.3 Released

After a long hiatus from maintaining my deno input handling library, input-deno, I've published a new version with a new input handling type and a critical bug fix for private input!

This version switches to use a deferred promise for handling private input (a mode where the output is not displayed in the console as it is typed). Using this same approach, I also implemented a wait method, that can be used to prompt the user to "press any key to continue".

You can now use the following:

import Input from 'https://raw.githubusercontent.com/keegandonley/input-deno/master/index.ts';

const input = new Input();

await input.wait();
const result = await input.question('Say something: ', false);
console.log('You said', result);
javascript

to yield the following output:

    Press any key to continue...
    Say something: Hello, world!
    You said Hello, world!unknown

Using this new deferred promise also fixes an issue where the program could crash when using private input.

Bear in mind that this new wait method needs to be run with the --unstable flag, or it will have no effect.

You can refer to the issue on Github and any feedback is always welcome!