sstur / readline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

readline

Read user input from the command line.

Demo here

npm install @jot/readline

This comes in both a sync (blocking) version and an async (promises) version.

Sync usage

import { readline } from '@jot/readline/sync';

const answer = readline('Enter something:');
console.log(`You entered: ${answer}`);

Async usage

import { readline } from '@jot/readline';

const answer = await readline('Enter something:');
console.log(`You entered: ${answer}`);

About


Languages

Language:TypeScript 65.1%Language:JavaScript 32.6%Language:Shell 2.3%