Skip to content
ImSpeddyPublic

About

Raw Input for Node.js Console

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

TermInput

Raw input inspired on Python's input() function, intended to get easier input from the user.

Install

From NPM:

npm i terminput

Syntax

await TermInput(prompt: string) // Returns a string with an input provided by the user

prompt: string: Prompt for the input, Optional

Example

const input = require('terminput')

async function getInput() {
    const myInput = await input(); // Retrieves first input, no prompt
    console.log(myInput); // Outputs the input

    const mySecondInput = await input("Enter your name: "); // Retrieves the input, asking for a name
    console.log(mySecondInput); // Outputs the input
}

getInput();

About

Raw Input for Node.js Console

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages