Comparing version 0.1.0 to 0.2.0
@@ -6,2 +6,3 @@ import ora from 'ora'; | ||
table(...args: unknown[]): Terminal; | ||
question(question: string): Promise<string>; | ||
loading(text: string): { | ||
@@ -8,0 +9,0 @@ changeText(textChange: string): void; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -7,2 +16,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.terminal = void 0; | ||
const readline_1 = require("readline"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
@@ -24,2 +34,16 @@ const ora_1 = __importDefault(require("ora")); | ||
}, | ||
question(question) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return new Promise(resolve => { | ||
const questionInterface = (0, readline_1.createInterface)({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}); | ||
questionInterface.question(question, answer => { | ||
questionInterface.close(); | ||
resolve(answer); | ||
}); | ||
}); | ||
}); | ||
}, | ||
loading(text) { | ||
@@ -26,0 +50,0 @@ const spinner = (0, ora_1.default)({ |
{ | ||
"name": "cowmand", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Fast helper to create a cli", | ||
@@ -5,0 +5,0 @@ "tags": [ |
@@ -72,3 +72,4 @@ ![Cowmand][cowmand-logo] | ||
- [ ] Terminal - Add table console | ||
- [ ] Terminal - Add question on terminal | ||
- [x] Terminal - Add question on terminal | ||
- [ ] Terminal - Add option to hide a password | ||
@@ -75,0 +76,0 @@ **** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20971
20
462
82