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