From 5faa1f575a23bced6848957506a670e2e2a125b9 Mon Sep 17 00:00:00 2001 From: Killer Boss Original <73131550+killerbossoriginal@users.noreply.github.com> Date: Fri, 3 Feb 2023 18:30:34 +0100 Subject: [PATCH] ttf --- package.json | 14 +++++++++----- readme.md | 15 +++++++++++++++ src/index.ts | 6 ++---- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 1018502..f69a437 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/ThunderNetworkRaD/std.git" + "url": "git+https://github.com/ThunderNetworkRaD/node-cin.git" }, "keywords": [ "std", @@ -17,14 +17,18 @@ "npmjs", "npm", "module", - "javascript" + "javascript", + "typescript", + "input", + "cin", + "await" ], "author": "Thunder Network RaD | Killer Boss Original", - "license": "SEE LICENSE IN LICENSE.txt", + "license": "Mozilla Public License 2.0", "bugs": { - "url": "https://github.com/ThunderNetworkRaD/std/issues" + "url": "https://github.com/ThunderNetworkRaD/node-cin/issues" }, - "homepage": "https://github.com/ThunderNetworkRaD/std#readme", + "homepage": "https://github.com/ThunderNetworkRaD/node-cin#readme", "dependencies": { "@thundernetworkrad/readline-sync": "^2023.1.30", "@types/node": "^18.11.18", diff --git a/readme.md b/readme.md index e69de29..30164a1 100644 --- a/readme.md +++ b/readme.md @@ -0,0 +1,15 @@ +# CIN + +This module allow you to make CLI in NodeJS + +##Examples + +### Then + +#### CommonJS + +```js +const cin = require('cin').default; + +cin('What is your favorite food?').then(ans => console.log(ans)) +``` \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 9a13373..ff278e7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import readlineSync from '@thundernetworkrad/readline-sync'; * @returns */ -function cin (question: string, hide: boolean) { +export function cin (question: string, hide: boolean) { return new Promise((resolve) => { try { let answer: string = readlineSync.question(`${question} `, { @@ -19,6 +19,4 @@ function cin (question: string, hide: boolean) { return resolve('error'); } }) -}; - -export default cin; \ No newline at end of file +}; \ No newline at end of file