started using readline

This commit is contained in:
Philipp Kunz 2016-05-20 19:44:52 +02:00
parent 4dab0f250a
commit ef20c00999
3 changed files with 23 additions and 19 deletions

20
dist/index.js vendored
View File

@ -1,16 +1,18 @@
"use strict"; "use strict";
/// <reference path="./typings/index.d.ts" /> /// <reference path="./typings/index.d.ts" />
var ora = require("ora"); var colors = require("colors");
var earlyOra; var readline = require("readline");
exports.start = function (moduleStringArg) { var rl = readline.createInterface({
earlyOra = ora({ input: process.stdin,
text: "Loading " + moduleStringArg.green, output: process.stdout
spinner: "bouncingBar"
}); });
earlyOra.start(); exports.start = function (moduleStringArg) {
rl.write('Delete me!');
setTimeout(function () {
rl.write(null, { ctrl: true, name: 'u' });
}, 1000);
}; };
exports.stop = function () { exports.stop = function () {
earlyOra.stop();
}; };
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw2Q0FBNkM7QUFDN0MsSUFBSSxHQUFHLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3pCLElBQUksUUFBUSxDQUFDO0FBRUYsYUFBSyxHQUFHLFVBQVMsZUFBc0I7SUFDOUMsUUFBUSxHQUFHLEdBQUcsQ0FBQztRQUNYLElBQUksRUFBQyxVQUFVLEdBQUcsZUFBZSxDQUFDLEtBQUs7UUFDdkMsT0FBTyxFQUFDLGFBQWE7S0FDeEIsQ0FBQyxDQUFDO0lBQ0gsUUFBUSxDQUFDLEtBQUssRUFBRSxDQUFDO0FBQ3JCLENBQUMsQ0FBQztBQUVTLFlBQUksR0FBRztJQUNkLFFBQVEsQ0FBQyxJQUFJLEVBQUUsQ0FBQztBQUNwQixDQUFDLENBQUMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL2luZGV4LmQud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SSxFQUFFLEdBQUcsRUFBQyxDQUFDLENBQUM7SUFDNUMsQ0FBQyxFQUFDLElBQUksQ0FBQyxDQUFDO0FBQ1osQ0FBQyxDQUFDO0FBRVMsWUFBSSxHQUFHO0FBRWxCLENBQUMsQ0FBQyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvaW5kZXguZC50c1wiIC8+XHJcbmxldCBjb2xvcnMgPSByZXF1aXJlKFwiY29sb3JzXCIpO1xyXG5sZXQgcmVhZGxpbmUgPSByZXF1aXJlKFwicmVhZGxpbmVcIik7XHJcblxyXG5jb25zdCBybCA9IHJlYWRsaW5lLmNyZWF0ZUludGVyZmFjZSh7XHJcbiAgaW5wdXQ6IHByb2Nlc3Muc3RkaW4sXHJcbiAgb3V0cHV0OiBwcm9jZXNzLnN0ZG91dFxyXG59KTtcclxuXHJcbmV4cG9ydCBsZXQgc3RhcnQgPSBmdW5jdGlvbihtb2R1bGVTdHJpbmdBcmc6c3RyaW5nKXtcclxuICAgIHJsLndyaXRlKCdEZWxldGUgbWUhJyk7XHJcbiAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7XHJcbiAgICAgICAgcmwud3JpdGUobnVsbCwge2N0cmw6IHRydWUsIG5hbWU6ICd1J30pO1xyXG4gICAgfSwxMDAwKTtcclxufTtcclxuXHJcbmV4cG9ydCBsZXQgc3RvcCA9IGZ1bmN0aW9uKCl7XHJcbiAgICBcclxufTtcclxuXHJcbiJdfQ==

View File

@ -23,7 +23,6 @@
"npmts": "^5.1.8" "npmts": "^5.1.8"
}, },
"dependencies": { "dependencies": {
"colors": "^1.1.2", "colors": "^1.1.2"
"ora": "^0.2.3"
} }
} }

View File

@ -1,17 +1,20 @@
/// <reference path="./typings/index.d.ts" /> /// <reference path="./typings/index.d.ts" />
let colors = require("colors"); let colors = require("colors");
let ora = require("ora"); let readline = require("readline");
let earlyOra;
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
export let start = function(moduleStringArg:string){ export let start = function(moduleStringArg:string){
earlyOra = ora({ rl.write('Delete me!');
text:"Loading " + moduleStringArg.green, setTimeout(function(){
spinner:"bouncingBar" rl.write(null, {ctrl: true, name: 'u'});
}); },1000);
earlyOra.start();
}; };
export let stop = function(){ export let stop = function(){
earlyOra.stop();
}; };