Console Input Module for NodeJS Javascript / Typescript
Find a file
Killer Boss Original c967884dbb fix
2023-02-03 18:46:00 +01:00
.github/workflows 2023.02.03 - 1 2023-02-03 18:14:20 +01:00
readme-images Readme Update 2023-02-03 18:43:26 +01:00
src ttf 2023-02-03 18:30:34 +01:00
.gitignore 2023.02.03 - 1 2023-02-03 18:14:20 +01:00
.npmrc Initial commit 2023-02-03 18:01:42 +01:00
LICENSE Initial commit 2023-02-03 18:01:42 +01:00
package.json fix 2023-02-03 18:46:00 +01:00
readme.md Readme Update 2023-02-03 18:43:26 +01:00
tsconfig.json 2023.02.03 - 1 2023-02-03 18:14:20 +01:00

CIN

This module allow you to make CLI in NodeJS

Examples

In this example is expected this Input/Output

Image-1

CommonJS

const { cin } = require('cin');

cin('What is your favorite food?').then(ans => console.log(ans));
// or
async function hello() {
    var ans = await cin('What is your favorite food?');
    console.log(ans);
}
hello();

ModuleJS

import { cin } from 'cin';


cin('What is your favorite food?').then(ans => console.log(ans));
// or
async function hello() {
    var ans = await cin('What is your favorite food?');
    console.log(ans);
}

hello();

TypeScript

import { cin } from 'cin';


cin('What is your favorite food?').then(ans => console.log(ans));
// or
async function hello() {
    var ans = await cin('What is your favorite food?');
    console.log(ans);
}

hello();