added ora
This commit is contained in:
parent
234c393749
commit
fc1b61e7de
12
dist/beautylog.classes.d.ts
vendored
12
dist/beautylog.classes.d.ts
vendored
@ -1,8 +1,4 @@
|
||||
export declare class ConsoleTable {
|
||||
tableHead: string[];
|
||||
rows: any;
|
||||
type: string;
|
||||
constructor(tableTypeArg: string, tableHeadArrayArg?: string[]);
|
||||
push(row: string[]): void;
|
||||
print(): void;
|
||||
}
|
||||
import { Table } from "./beautylog.classes.table";
|
||||
import { Ora } from "./beautylog.classes.ora";
|
||||
export declare let table: (tableTypeArg: string, tableHeadArrayArg?: string[]) => Table;
|
||||
export declare let ora: (textArg: string, colorArg: string) => Ora;
|
||||
|
60
dist/beautylog.classes.js
vendored
60
dist/beautylog.classes.js
vendored
@ -1,54 +1,12 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./beautylog.plugins");
|
||||
var tableHelpers = {
|
||||
makeRow: function (cellCounterArg, colorArg) {
|
||||
if (cellCounterArg === void 0) { cellCounterArg = 2; }
|
||||
if (colorArg === void 0) { colorArg = "cyan"; }
|
||||
var rowArray = [];
|
||||
for (var i = 0; i < (cellCounterArg); i++) {
|
||||
rowArray.push(String(i + 1).cyan);
|
||||
}
|
||||
return rowArray;
|
||||
}
|
||||
"use strict";
|
||||
var beautylog_classes_table_1 = require("./beautylog.classes.table");
|
||||
var beautylog_classes_ora_1 = require("./beautylog.classes.ora");
|
||||
exports.table = function (tableTypeArg, tableHeadArrayArg) {
|
||||
return new beautylog_classes_table_1.Table(tableTypeArg, tableHeadArrayArg);
|
||||
};
|
||||
exports.ora = function (textArg, colorArg) {
|
||||
return new beautylog_classes_ora_1.Ora(textArg, colorArg);
|
||||
};
|
||||
var ConsoleTable = (function () {
|
||||
function ConsoleTable(tableTypeArg, tableHeadArrayArg) {
|
||||
if (tableHeadArrayArg === void 0) { tableHeadArrayArg = tableHelpers.makeRow(); }
|
||||
switch (tableTypeArg) {
|
||||
case "checks":
|
||||
this.tableHead = ['Check Item:'.cyan, 'Status:'.cyan];
|
||||
break;
|
||||
case "custom":
|
||||
this.tableHead = tableHeadArrayArg;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.rows = [];
|
||||
this.type = tableTypeArg;
|
||||
}
|
||||
ConsoleTable.prototype.push = function (row) {
|
||||
this.rows.push(row);
|
||||
};
|
||||
ConsoleTable.prototype.print = function () {
|
||||
var table = new plugins.cliTable({
|
||||
head: this.tableHead
|
||||
});
|
||||
for (var row in this.rows) {
|
||||
if (this.rows[row][1] == "success") {
|
||||
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
|
||||
}
|
||||
else if (this.rows[row][1] == "error") {
|
||||
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
|
||||
}
|
||||
table.push(this.rows[row]);
|
||||
}
|
||||
;
|
||||
console.log(table.toString());
|
||||
};
|
||||
return ConsoleTable;
|
||||
}());
|
||||
exports.ConsoleTable = ConsoleTable;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcscUJBQXFCLENBQUMsQ0FBQztBQUVoRCxJQUFJLFlBQVksR0FBRztJQUNmLE9BQU8sRUFBRSxVQUFTLGNBQXlCLEVBQUMsUUFBd0I7UUFBbEQsOEJBQXlCLEdBQXpCLGtCQUF5QjtRQUFDLHdCQUF3QixHQUF4QixpQkFBd0I7UUFDaEUsSUFBSSxRQUFRLEdBQUcsRUFBRSxDQUFDO1FBQ2xCLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxjQUFjLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRSxDQUFDO1lBQ3hDL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L3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vYmVhdXR5bG9nLnBsdWdpbnNcIik7XG5cbnZhciB0YWJsZUhlbHBlcnMgPSB7XG4gICAgbWFrZVJvdzogZnVuY3Rpb24oY2VsbENvdW50ZXJBcmc6bnVtYmVyID0gMixjb2xvckFyZzpzdHJpbmcgPSBcImN5YW5cIil7XG4gICAgICAgIHZhciByb3dBcnJheSA9IFtdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IChjZWxsQ291bnRlckFyZyk7IGkrKykge1xuICAgICAgICAgICAgcm93QXJyYXkucHVzaChTdHJpbmcoaSArIDEpLmN5YW4pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByb3dBcnJheTtcbiAgICB9XG59O1xuXG5leHBvcnQgY2xhc3MgQ29uc29sZVRhYmxlIHtcbiAgICB0YWJsZUhlYWQ6c3RyaW5nW107XG4gICAgcm93cztcbiAgICB0eXBlOnN0cmluZztcbiAgICBjb25zdHJ1Y3Rvcih0YWJsZVR5cGVBcmc6c3RyaW5nLHRhYmxlSGVhZEFycmF5QXJnOnN0cmluZ1tdID0gdGFibGVIZWxwZXJzLm1ha2VSb3coKSkge1xuICAgICAgICBzd2l0Y2ggKHRhYmxlVHlwZUFyZykge1xuICAgICAgICAgICAgY2FzZSBcImNoZWNrc1wiOlxuICAgICAgICAgICAgICAgIHRoaXMudGFibGVIZWFkID0gWydDaGVjayBJdGVtOicuY3lhbiwnU3RhdHVzOicuY3lhbl07XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlIFwiY3VzdG9tXCI6XG4gICAgICAgICAgICAgICAgdGhpcy50YWJsZUhlYWQgPSB0YWJsZUhlYWRBcnJheUFyZztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5yb3dzID0gW107XG4gICAgICAgIHRoaXMudHlwZSA9IHRhYmxlVHlwZUFyZztcbiAgICB9XG4gICAgcHVzaChyb3c6c3RyaW5nW10pe1xuICAgICAgICB0aGlzLnJvd3MucHVzaChyb3cpO1xuICAgIH1cbiAgICBwcmludCgpIHtcbiAgICAgICAgdmFyIHRhYmxlID0gbmV3IHBsdWdpbnMuY2xpVGFibGUoe1xuICAgICAgICAgICAgaGVhZDogdGhpcy50YWJsZUhlYWRcbiAgICAgICAgfSk7XG4gICAgICAgIGZvciAodmFyIHJvdyBpbiB0aGlzLnJvd3Mpe1xuICAgICAgICAgICAgaWYodGhpcy5yb3dzW3Jvd11bMV0gPT0gXCJzdWNjZXNzXCIpe1xuICAgICAgICAgICAgICAgIHRoaXMucm93c1tyb3ddWzFdID0gJyAnLmJnR3JlZW4gKyAnICcgKyB0aGlzLnJvd3Nbcm93XVsxXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5yb3dzW3Jvd11bMV0gPT0gXCJlcnJvclwiKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yb3dzW3Jvd11bMV0gPSAnICcuYmdSZWQgKyAnICcgKyB0aGlzLnJvd3Nbcm93XVsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRhYmxlLnB1c2godGhpcy5yb3dzW3Jvd10pO1xuICAgICAgICB9O1xuICAgICAgICBjb25zb2xlLmxvZyh0YWJsZS50b1N0cmluZygpKTtcbiAgICB9XG59XG4iXX0=
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFNUMsd0NBQW9CLDJCQUEyQixDQUFDLENBQUE7QUFDaEQsc0NBQWtCLHlCQUF5QixDQUFDLENBQUE7QUFFakMsYUFBSyxHQUFHLFVBQVMsWUFBbUIsRUFBQyxpQkFBMkI7SUFDdkUsTUFBTSxDQUFDLElBQUksK0JBQUssQ0FBQyxZQUFZLEVBQUMsaUJBQWlCLENBQUMsQ0FBQztBQUNyRCxDQUFDLENBQUE7QUFFVSxXQUFHLEdBQUcsVUFBUyxPQUFjLEVBQUMsUUFBZTtJQUNwRCxNQUFNLENBQUMsSUFBSSwyQkFBRyxDQUFDLE9BQU8sRUFBQyxRQUFRLENBQUMsQ0FBQztBQUNyQyxDQUFDLENBQUEiLCJmaWxlIjoiYmVhdXR5bG9nLmNsYXNzZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XHJcblxyXG5pbXBvcnQge1RhYmxlfSBmcm9tIFwiLi9iZWF1dHlsb2cuY2xhc3Nlcy50YWJsZVwiO1xyXG5pbXBvcnQge09yYX0gZnJvbSBcIi4vYmVhdXR5bG9nLmNsYXNzZXMub3JhXCI7XHJcblxyXG5leHBvcnQgbGV0IHRhYmxlID0gZnVuY3Rpb24odGFibGVUeXBlQXJnOnN0cmluZyx0YWJsZUhlYWRBcnJheUFyZz86c3RyaW5nW10pe1xyXG4gICAgcmV0dXJuIG5ldyBUYWJsZSh0YWJsZVR5cGVBcmcsdGFibGVIZWFkQXJyYXlBcmcpO1xyXG59XHJcblxyXG5leHBvcnQgbGV0IG9yYSA9IGZ1bmN0aW9uKHRleHRBcmc6c3RyaW5nLGNvbG9yQXJnOnN0cmluZyl7XHJcbiAgICByZXR1cm4gbmV3IE9yYSh0ZXh0QXJnLGNvbG9yQXJnKTtcclxufSJdfQ==
|
||||
|
9
dist/beautylog.classes.ora.d.ts
vendored
Normal file
9
dist/beautylog.classes.ora.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
export declare class Ora {
|
||||
private _oraObject;
|
||||
state: string;
|
||||
constructor(textArg: string, colorArg: string);
|
||||
text(textArg: any): void;
|
||||
end(): void;
|
||||
endOk(textArg: any): void;
|
||||
endError(textArg: any): void;
|
||||
}
|
36
dist/beautylog.classes.ora.js
vendored
Normal file
36
dist/beautylog.classes.ora.js
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./beautylog.plugins");
|
||||
var log = require("./beautylog.log");
|
||||
var Ora = (function () {
|
||||
function Ora(textArg, colorArg) {
|
||||
this._oraObject = plugins.ora({
|
||||
spinner: "dots",
|
||||
text: textArg,
|
||||
color: colorArg
|
||||
});
|
||||
this._oraObject.start();
|
||||
}
|
||||
Ora.prototype.text = function (textArg) {
|
||||
this._oraObject.text = textArg;
|
||||
};
|
||||
;
|
||||
Ora.prototype.end = function () {
|
||||
this._oraObject.stop();
|
||||
this._oraObject.clear();
|
||||
};
|
||||
Ora.prototype.endOk = function (textArg) {
|
||||
this.end();
|
||||
log.ok(textArg);
|
||||
};
|
||||
;
|
||||
Ora.prototype.endError = function (textArg) {
|
||||
this.end();
|
||||
log.error(textArg);
|
||||
};
|
||||
;
|
||||
return Ora;
|
||||
}());
|
||||
exports.Ora = Ora;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLm9yYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQVksT0FBTyxXQUFNLHFCQUFxQixDQUFDLENBQUE7QUFDL0MsSUFBWSxHQUFHLFdBQU0saUJBQWlCLENBQUMsQ0FBQTtBQUV2QztJQUdJLGFBQVksT0FBYyxFQUFDLFFBQWU7UUFDdEMsSUFBSSxDQUFDLFVBQVUsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDO1lBQzFCLE9BQU8sRUFBQyxNQUFNO1lBQ2QsSUFBSSxFQUFDLE9BQU87WUFDWixLQUFLLEVBQUMs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c3RhdGU6c3RyaW5nO1xyXG4gICAgY29uc3RydWN0b3IodGV4dEFyZzpzdHJpbmcsY29sb3JBcmc6c3RyaW5nKXtcclxuICAgICAgICB0aGlzLl9vcmFPYmplY3QgPSBwbHVnaW5zLm9yYSh7XHJcbiAgICAgICAgICAgIHNwaW5uZXI6XCJkb3RzXCIsXHJcbiAgICAgICAgICAgIHRleHQ6dGV4dEFyZyxcclxuICAgICAgICAgICAgY29sb3I6Y29sb3JBcmdcclxuICAgICAgICB9KTtcclxuICAgICAgICB0aGlzLl9vcmFPYmplY3Quc3RhcnQoKTtcclxuICAgIH1cclxuICAgIHRleHQodGV4dEFyZyl7XHJcbiAgICAgICAgdGhpcy5fb3JhT2JqZWN0LnRleHQgPSB0ZXh0QXJnO1xyXG4gICAgfTtcclxuICAgIGVuZCgpe1xyXG4gICAgICAgIHRoaXMuX29yYU9iamVjdC5zdG9wKCk7XHJcbiAgICAgICAgdGhpcy5fb3JhT2JqZWN0LmNsZWFyKCk7XHJcbiAgICB9XHJcbiAgICBlbmRPayh0ZXh0QXJnKXtcclxuICAgICAgICB0aGlzLmVuZCgpO1xyXG4gICAgICAgIGxvZy5vayh0ZXh0QXJnKTtcclxuICAgIH07XHJcbiAgICBlbmRFcnJvcih0ZXh0QXJnKXtcclxuICAgICAgICB0aGlzLmVuZCgpO1xyXG4gICAgICAgIGxvZy5lcnJvcih0ZXh0QXJnKTtcclxuICAgIH07XHJcbn0iXX0=
|
8
dist/beautylog.classes.table.d.ts
vendored
Normal file
8
dist/beautylog.classes.table.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
export declare class Table {
|
||||
tableHead: string[];
|
||||
rows: any;
|
||||
type: string;
|
||||
constructor(tableTypeArg: string, tableHeadArrayArg?: string[]);
|
||||
push(row: string[]): void;
|
||||
print(): void;
|
||||
}
|
54
dist/beautylog.classes.table.js
vendored
Normal file
54
dist/beautylog.classes.table.js
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = require("./beautylog.plugins");
|
||||
var tableHelpers = {
|
||||
makeRow: function (cellCounterArg, colorArg) {
|
||||
if (cellCounterArg === void 0) { cellCounterArg = 2; }
|
||||
if (colorArg === void 0) { colorArg = "cyan"; }
|
||||
var rowArray = [];
|
||||
for (var i = 0; i < (cellCounterArg); i++) {
|
||||
rowArray.push(String(i + 1).cyan);
|
||||
}
|
||||
return rowArray;
|
||||
}
|
||||
};
|
||||
var Table = (function () {
|
||||
function Table(tableTypeArg, tableHeadArrayArg) {
|
||||
if (tableHeadArrayArg === void 0) { tableHeadArrayArg = tableHelpers.makeRow(); }
|
||||
switch (tableTypeArg) {
|
||||
case "checks":
|
||||
this.tableHead = ['Check Item:'.cyan, 'Status:'.cyan];
|
||||
break;
|
||||
case "custom":
|
||||
this.tableHead = tableHeadArrayArg;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.rows = [];
|
||||
this.type = tableTypeArg;
|
||||
}
|
||||
Table.prototype.push = function (row) {
|
||||
this.rows.push(row);
|
||||
};
|
||||
Table.prototype.print = function () {
|
||||
var table = new plugins.cliTable({
|
||||
head: this.tableHead
|
||||
});
|
||||
for (var row in this.rows) {
|
||||
if (this.rows[row][1] == "success") {
|
||||
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
|
||||
}
|
||||
else if (this.rows[row][1] == "error") {
|
||||
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
|
||||
}
|
||||
table.push(this.rows[row]);
|
||||
}
|
||||
;
|
||||
console.log(table.toString());
|
||||
};
|
||||
return Table;
|
||||
}());
|
||||
exports.Table = Table;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5jbGFzc2VzLnRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFD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6c3RyaW5nW10gPSB0YWJsZUhlbHBlcnMubWFrZVJvdygpKSB7XHJcbiAgICAgICAgc3dpdGNoICh0YWJsZVR5cGVBcmcpIHtcclxuICAgICAgICAgICAgY2FzZSBcImNoZWNrc1wiOlxyXG4gICAgICAgICAgICAgICAgdGhpcy50YWJsZUhlYWQgPSBbJ0NoZWNrIEl0ZW06Jy5jeWFuLCdTdGF0dXM6Jy5jeWFuXTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiY3VzdG9tXCI6XHJcbiAgICAgICAgICAgICAgICB0aGlzLnRhYmxlSGVhZCA9IHRhYmxlSGVhZEFycmF5QXJnO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgdGhpcy5yb3dzID0gW107XHJcbiAgICAgICAgdGhpcy50eXBlID0gdGFibGVUeXBlQXJnO1xyXG4gICAgfVxyXG4gICAgcHVzaChyb3c6c3RyaW5nW10pe1xyXG4gICAgICAgIHRoaXMucm93cy5wdXNoKHJvdyk7XHJcbiAgICB9XHJcbiAgICBwcmludCgpIHtcclxuICAgICAgICBsZXQgdGFibGUgPSBuZXcgcGx1Z2lucy5jbGlUYWJsZSh7XHJcbiAgICAgICAgICAgIGhlYWQ6IHRoaXMudGFibGVIZWFkXHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgZm9yIChsZXQgcm93IGluIHRoaXMucm93cyl7XHJcbiAgICAgICAgICAgIGlmKHRoaXMucm93c1tyb3ddWzFdID09IFwic3VjY2Vzc1wiKXtcclxuICAgICAgICAgICAgICAgIHRoaXMucm93c1tyb3ddWzFdID0gJyAnLmJnR3JlZW4gKyAnICcgKyB0aGlzLnJvd3Nbcm93XVsxXTtcclxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLnJvd3Nbcm93XVsxXSA9PSBcImVycm9yXCIpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMucm93c1tyb3ddWzFdID0gJyAnLmJnUmVkICsgJyAnICsgdGhpcy5yb3dzW3Jvd11bMV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgdGFibGUucHVzaCh0aGlzLnJvd3Nbcm93XSk7XHJcbiAgICAgICAgfTtcclxuICAgICAgICBjb25zb2xlLmxvZyh0YWJsZS50b1N0cmluZygpKTtcclxuICAgIH1cclxufSJdfQ==
|
2
dist/beautylog.figlet.js
vendored
2
dist/beautylog.figlet.js
vendored
@ -37,4 +37,4 @@ exports.figletSync = function (textArg, optionsArg) {
|
||||
return true;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5maWdsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxxQkFBcUIsQ0FBQyxDQUFDO0FBQ2hELElBQUksY0FBYyxHQUFHO0lBQ2pCLElBQUksRUFBQyxXQUFXO0lBQ2hCLEtBQUssRUFBRSxPQUFPO0lBQ2QsRUFBRSxFQUFFLGNBQVcsQ0FBQztDQUNuQixDQUFDO0FBRVMsY0FBTSxHQUFHLFVBQVMsT0FBYyxFQUFDLFVBQVc7SUFDbkQsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUM3QixJQUFJLFlBQVksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxjQUFjLENBQUMsQ0FBQztJQUM1RCxJQUFJLE9BQU8sR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLE1BQU0sQ0FBQyxZQUFZLEVBQUMsVUFBVSxDQUFDLENBQUM7SUFDN0QsT0FBTyxDQUFDLE1BQU0sQ0FBQyxPQU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AgY29uc29sZS5kaXIoZXJyKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBjb25zb2xlLmxvZyhkYXRhW29wdGlvbnMuY29sb3JdKTtcbiAgICAgICAgb3B0aW9ucy5jYigpO1xuICAgICAgICBkb25lLnJlc29sdmUoKTtcbiAgICB9KTtcbiAgICByZXR1cm4gZG9uZS5wcm9taXNlO1xufTtcblxuZXhwb3J0IHZhciBmaWdsZXRTeW5jID0gZnVuY3Rpb24odGV4dEFyZzpzdHJpbmcsb3B0aW9uc0FyZz8pe1xuICAgIHZhciBtZXJnZU9wdGlvbnMgPSBwbHVnaW5zLmxvZGFzaC5jbG9uZURlZXAoZGVmYXVsdE9wdGlvbnMpO1xuICAgIHZhciBvcHRpb25zID0gcGx1Z2lucy5sb2Rhc2guYXNzaWduKG1lcmdlT3B0aW9ucyxvcHRpb25zQXJnKTtcbiAgICBjb25zb2xlLmxvZyhwbHVnaW5zLmZpZ2xldC50ZXh0U3luYyh0ZXh0QXJnLHtcbiAgICAgICAgZm9udDogb3B0aW9ucy5mb250LFxuICAgICAgICBob3Jpem9udGFsTGF5b3V0OiAnZGVmYXVsdCcsXG4gICAgICAgIHZlcnRpY2FsTGF5b3V0OiAnZGVmYXVsdCdcbiAgICB9KVtvcHRpb25zLmNvbG9yXSk7XG4gICAgcmV0dXJuIHRydWU7XG59O1xuIl19
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5maWdsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1QyxJQUFPLE9BQU8sV0FBVyxxQkFBcUIsQ0FBQyxDQUFDO0FBQ2hELElBQUksY0FBYyxHQUFHO0lBQ2pCLElBQUksRUFBQyxXQUFXO0lBQ2hCLEtBQUssRUFBRSxPQUFPO0lBQ2QsRUFBRSxFQUFFLGNBQVcsQ0FBQztDQ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lvdXQ6ICdkZWZhdWx0JyxcclxuICAgICAgICB2ZXJ0aWNhbExheW91dDogJ2RlZmF1bHQnXHJcbiAgICB9KVtvcHRpb25zLmNvbG9yXSk7XHJcbiAgICByZXR1cm4gdHJ1ZTtcclxufTtcclxuIl19
|
||||
|
2
dist/beautylog.log.helpers.js
vendored
2
dist/beautylog.log.helpers.js
vendored
File diff suppressed because one or more lines are too long
2
dist/beautylog.log.js
vendored
2
dist/beautylog.log.js
vendored
@ -52,4 +52,4 @@ exports.dir = function (logText) {
|
||||
return beautylog_log_helpers_1.log(logText, 'dir');
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5sb2cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDOztBQUU1QyxzQ0FBa0IseUJBQXlCLENBQUMsQ0FBQTtBQUM1QyxzQ0FBa0IseUJBQXlCLENBQUM7QUFBcEMsMENBQW9DO0FBRTVDOzs7O0dBSUc7QUFDUSxZQUFJLEdBQUcsVUFBVSxPQUFPO0lBQy9CLE1BQU0sQ0FBQywyQkFBRyxDQUFDLE9BQU8sRUFBRSxNQUFNLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUM7QUFFRjs7OztHQUlHO0FBQ1EsVUFBRSxHQUFHLFVBQVUsT0FBTztJQUM3QixNQUFNLENBQUMsMkJBQUcsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDOUIsQ0FBQyxDQUFDO0FBRUY7Ozs7R0FJRztBQUNRLGVBQU8sR0FBRyxVQUFVLE9BQU87SUFDbEMsTUFBTSxDQUFDLDJCQUFHLENBQUMsT0FBTyxFQUFFLFNBQVMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQztBQUVGOzs7O0dBSUc7QUFDUSxZQUFJLEdBQUcsVUFBVSxPQUFPO0lBQy9CLE1BQU0sQ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m4gPSBmdW5jdGlvbiAobG9nVGV4dCkge1xyXG4gICAgcmV0dXJuIGxvZyhsb2dUZXh0LCAnd2FybicpO1xyXG59O1xyXG5cclxuLyoqXHJcbiAqIGxvZ3MgYW4gZXJyb3IgdG8gY29uc29sZVxyXG4gKiBAcGFyYW0gbG9nVGV4dFxyXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn1cclxuICovXHJcbmV4cG9ydCBsZXQgZXJyb3IgPSBmdW5jdGlvbiAobG9nVGV4dCkge1xyXG4gICAgcmV0dXJuIGxvZyhsb2dUZXh0LCAnZXJyb3InKTtcclxufTtcclxuXHJcbi8qKlxyXG4gKiBsb2dzIGFuIGRpcmVjdG9yeSB0byBjb25zb2xlXHJcbiAqIEBwYXJhbSBsb2dUZXh0XHJcbiAqIEByZXR1cm5zIHtib29sZWFufVxyXG4gKi9cclxuZXhwb3J0IGxldCBkaXIgPSBmdW5jdGlvbiAobG9nVGV4dCkge1xyXG4gICAgcmV0dXJuIGxvZyhsb2dUZXh0LCAnZGlyJyk7XHJcbn07Il19
|
||||
|
5
dist/beautylog.plugins.js
vendored
5
dist/beautylog.plugins.js
vendored
@ -10,9 +10,10 @@ if (plugins.smartenv.getEnv().isNode) {
|
||||
cliTable: require("cli-table2"),
|
||||
colors: require("colors"),
|
||||
clc: require("cli-color"),
|
||||
figlet: require("figlet")
|
||||
figlet: require("figlet"),
|
||||
ora: require("ora")
|
||||
});
|
||||
}
|
||||
module.exports = plugins;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFNUMsSUFBSSxPQUFPLEdBQU87SUFDZCxNQUFNLEVBQUUsT0FBTyxDQUFDLFFBQVEsQ0FBQztJQUN6QixRQUFRLEVBQUUsT0FBTyxDQUFDLFVBQVUsQ0F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XHJcbnZhciBwbHVnaW5zOmFueSA9IHtcclxuICAgIGxvZGFzaDogcmVxdWlyZShcImxvZGFzaFwiKSxcclxuICAgIHNtYXJ0ZW52OiByZXF1aXJlKFwic21hcnRlbnZcIiksXHJcbiAgICBxOiByZXF1aXJlKFwicVwiKVxyXG59O1xyXG5pZiAocGx1Z2lucy5zbWFydGVudi5nZXRFbnYoKS5pc05vZGUpe1xyXG4gICAgcGx1Z2lucyA9IHBsdWdpbnMubG9kYXNoLmFzc2lnbihwbHVnaW5zLHtcclxuICAgICAgICBjbGlUYWJsZTogIHJlcXVpcmUoXCJjbGktdGFibGUyXCIpLFxyXG4gICAgICAgIGNvbG9yczogcmVxdWlyZShcImNvbG9yc1wiKSxcclxuICAgICAgICBjbGM6IHJlcXVpcmUoXCJjbGktY29sb3JcIiksXHJcbiAgICAgICAgZmlnbGV0OiByZXF1aXJlKFwiZmlnbGV0XCIpLFxyXG4gICAgICAgIG9yYTogcmVxdWlyZShcIm9yYVwiKVxyXG4gICAgfSk7XHJcbn1cclxuZXhwb3J0ID0gcGx1Z2luczsiXX0=
|
||||
|
4
dist/beautylog.table.d.ts
vendored
4
dist/beautylog.table.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
import classes = require("./beautylog.classes");
|
||||
export declare let table: {
|
||||
new: (typeArg: string, tableHeadArrayArg?: any) => classes.ConsoleTable;
|
||||
};
|
11
dist/beautylog.table.js
vendored
11
dist/beautylog.table.js
vendored
@ -1,11 +0,0 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var classes = require("./beautylog.classes");
|
||||
exports.table = {
|
||||
new: function (typeArg, tableHeadArrayArg) {
|
||||
var newConsoleTable = new classes.ConsoleTable(typeArg, tableHeadArrayArg);
|
||||
return newConsoleTable;
|
||||
}
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy50YWJsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLHFCQUFxQixDQUFDLENBQUM7QUFFckMsYUFBSyxHQUFHO0lBQ2YsR0FBRyxFQUFFLFVBQVMsT0FBYyxFQUFDLGlCQUFrQjtRQUMzQyxJQUFJLGVBQWUsR0FBRyxJQUFJLE9BQU8sQ0FBQyxZQUFZLENBQUMsT0FBTyxFQUFDLGlCQUFpQixDQUFDLENBQUM7UUFDMUUsTUFBTSxDQUFDLGVBQWUsQ0FBQztJQUMzQixDQUFDO0NBQ0osQ0FBQyIsImZpbGUiOiJiZWF1dHlsb2cudGFibGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG5pbXBvcnQgY2xhc3NlcyA9IHJlcXVpcmUoXCIuL2JlYXV0eWxvZy5jbGFzc2VzXCIpO1xuXG5leHBvcnQgbGV0IHRhYmxlID0ge1xuICAgIG5ldzogZnVuY3Rpb24odHlwZUFyZzpzdHJpbmcsdGFibGVIZWFkQXJyYXlBcmc/KSB7XG4gICAgICAgIHZhciBuZXdDb25zb2xlVGFibGUgPSBuZXcgY2xhc3Nlcy5Db25zb2xlVGFibGUodHlwZUFyZyx0YWJsZUhlYWRBcnJheUFyZyk7XG4gICAgICAgIHJldHVybiBuZXdDb25zb2xlVGFibGU7XG4gICAgfVxufTsiXX0=
|
20
dist/index.d.ts
vendored
20
dist/index.d.ts
vendored
@ -1,13 +1,13 @@
|
||||
import * as classes from "./beautylog.classes";
|
||||
export declare let log: (logText?: string, logType?: string) => void;
|
||||
export declare let info: (logText: any) => void;
|
||||
export declare let ok: (logText: any) => void;
|
||||
export declare let success: (logText: any) => void;
|
||||
export declare let warn: (logText: any) => void;
|
||||
export declare let error: (logText: any) => void;
|
||||
import { Ora } from "./beautylog.classes.ora";
|
||||
import { Table } from "./beautylog.classes.table";
|
||||
export declare let dir: (logText: any) => void;
|
||||
export declare let error: (logText: any) => void;
|
||||
export declare let figlet: (textArg: string, optionsArg?: any) => any;
|
||||
export declare let figletSync: (textArg: string, optionsArg?: any) => boolean;
|
||||
export declare let table: {
|
||||
new: (typeArg: string, tableHeadArrayArg?: any) => classes.ConsoleTable;
|
||||
};
|
||||
export declare let info: (logText: any) => void;
|
||||
export declare let log: (logText?: string, logType?: string) => void;
|
||||
export declare let ok: (logText: any) => void;
|
||||
export declare let ora: (textArg: string, colorArg: string) => Ora;
|
||||
export declare let success: (logText: any) => void;
|
||||
export declare let table: (tableTypeArg: string, tableHeadArrayArg?: string[]) => Table;
|
||||
export declare let warn: (logText: any) => void;
|
||||
|
19
dist/index.js
vendored
19
dist/index.js
vendored
@ -1,17 +1,18 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
"use strict";
|
||||
var classes = require("./beautylog.classes");
|
||||
var BeautylogLog = require("./beautylog.log");
|
||||
var BeautylogFiglet = require("./beautylog.figlet");
|
||||
var BeautylogTable = require("./beautylog.table");
|
||||
exports.log = BeautylogLog.log;
|
||||
exports.info = BeautylogLog.info;
|
||||
exports.ok = BeautylogLog.ok;
|
||||
exports.success = BeautylogLog.success;
|
||||
exports.warn = BeautylogLog.warn;
|
||||
exports.error = BeautylogLog.error;
|
||||
exports.dir = BeautylogLog.dir;
|
||||
exports.error = BeautylogLog.error;
|
||||
exports.figlet = BeautylogFiglet.figlet;
|
||||
exports.figletSync = BeautylogFiglet.figletSync;
|
||||
exports.table = BeautylogTable.table;
|
||||
exports.info = BeautylogLog.info;
|
||||
exports.log = BeautylogLog.log;
|
||||
exports.ok = BeautylogLog.ok;
|
||||
exports.ora = classes.ora;
|
||||
exports.success = BeautylogLog.success;
|
||||
exports.table = classes.table;
|
||||
exports.warn = BeautylogLog.warn;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4Ln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xyXG5leHBvcnQgbGV0IGVycm9yID0gIEJlYXV0eWxvZ0xvZy5lcnJvcjtcclxuZXhwb3J0IGxldCBmaWdsZXQgPSAgQmVhdXR5bG9nRmlnbGV0LmZpZ2xldDtcclxuZXhwb3J0IGxldCBmaWdsZXRTeW5jID0gIEJlYXV0eWxvZ0ZpZ2xldC5maWdsZXRTeW5jO1xyXG5leHBvcnQgbGV0IGluZm8gPSAgQmVhdXR5bG9nTG9nLmluZm87XHJcbmV4cG9ydCBsZXQgbG9nID0gIEJlYXV0eWxvZ0xvZy5sb2c7XHJcbmV4cG9ydCBsZXQgb2sgPSAgQmVhdXR5bG9nTG9nLm9rO1xyXG5leHBvcnQgbGV0IG9yYSA9IGNsYXNzZXMub3JhO1xyXG5leHBvcnQgbGV0IHN1Y2Nlc3MgPSAgQmVhdXR5bG9nTG9nLnN1Y2Nlc3M7XHJcbmV4cG9ydCBsZXQgdGFibGUgPSAgY2xhc3Nlcy50YWJsZTtcclxuZXhwb3J0IGxldCB3YXJuID0gIEJlYXV0eWxvZ0xvZy53YXJuO1xyXG4iXX0=
|
||||
|
@ -36,6 +36,7 @@
|
||||
"colors": "1.1.2",
|
||||
"figlet": "^1.1.2",
|
||||
"lodash": "^4.11.1",
|
||||
"ora": "^0.2.1",
|
||||
"q": "^1.4.1",
|
||||
"smartenv": "^1.2.2"
|
||||
},
|
||||
|
2
test/test.d.ts
vendored
2
test/test.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
declare var smartenv: any;
|
||||
declare var beautylog: any;
|
49
test/test.js
49
test/test.js
File diff suppressed because one or more lines are too long
48
test/test.ts
48
test/test.ts
@ -1,6 +1,5 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
var smartenv = require("smartenv");
|
||||
var beautylog = require('../dist/index.js');
|
||||
import beautylog = require('../dist/index.js');
|
||||
|
||||
describe("beautylog",function(){
|
||||
describe(".log(message,logtype)",function(){
|
||||
@ -27,6 +26,16 @@ describe("beautylog",function(){
|
||||
beautylog.error('beautylog.error(), with normal logText, without logType');
|
||||
});
|
||||
});
|
||||
describe(".figlet",function(){
|
||||
it("should print nice fonts to console in yellow",function(done){
|
||||
beautylog.figlet("Async!",{font:"Star Wars",color:"yellow"}).then(done);
|
||||
})
|
||||
});
|
||||
describe(".figletSync",function(){
|
||||
it("should print nice fonts to console in yellow",function(){
|
||||
beautylog.figletSync("Sync!",{font:"Star Wars",color:"blue"});
|
||||
})
|
||||
});
|
||||
describe(".info(message)",function(){
|
||||
it("should display a purple info message",function(){
|
||||
beautylog.info('beautylog.dir(), with normal logText, without logType');
|
||||
@ -37,6 +46,27 @@ describe("beautylog",function(){
|
||||
beautylog.ok('beautylog.ok(), with normal logText, without logType');
|
||||
});
|
||||
});
|
||||
describe(".ora(text,color)",function(){
|
||||
it("should display, update, and end a message",function(done){
|
||||
this.timeout(10000);
|
||||
let testOra = beautylog.ora("This is a test text","green");
|
||||
setTimeout(function(){
|
||||
testOra.text("updated text!");
|
||||
setTimeout(function(){
|
||||
testOra.endOk("Allright, ora works!");
|
||||
done();
|
||||
},2000);
|
||||
},2000)
|
||||
});
|
||||
it("should display an error message when ended with error",function(done){
|
||||
this.timeout(10000);
|
||||
let testOra = beautylog.ora("This is another test text","green");
|
||||
setTimeout(function(){
|
||||
testOra.endError("Allright, ora displays an error!");
|
||||
done();
|
||||
},2000)
|
||||
});
|
||||
});
|
||||
describe(".success(message)",function(){
|
||||
it("should display an orange warn message",function(){
|
||||
beautylog.success('beautylog.success(), with normal logText, without logType');
|
||||
@ -50,28 +80,18 @@ describe("beautylog",function(){
|
||||
describe(".table",function(){
|
||||
it("should print a nice table",function(){
|
||||
(function(){
|
||||
var testTable1 = beautylog.table.new("checks");
|
||||
var testTable1 = beautylog.table("checks");
|
||||
testTable1.push(['check1','success']);
|
||||
testTable1.push(['check2','error']);
|
||||
testTable1.push(['check3','error']);
|
||||
testTable1.print();
|
||||
|
||||
var testTable2 = beautylog.table.new("custom",["Column1".red,"Column2".blue,"Column3".cyan]);
|
||||
var testTable2 = beautylog.table("custom",["Column1".red,"Column2".blue,"Column3".cyan]);
|
||||
testTable2.push(["Hey","this","works"]);
|
||||
testTable2.print();
|
||||
})();
|
||||
});
|
||||
});
|
||||
describe(".figlet",function(){
|
||||
it("should print nice fonts to console in yellow",function(done){
|
||||
beautylog.figlet("Async!",{font:"Star Wars",color:"yellow"}).then(done);
|
||||
})
|
||||
});
|
||||
describe(".figletSync",function(){
|
||||
it("should print nice fonts to console in yellow",function(){
|
||||
beautylog.figletSync("Sync!",{font:"Star Wars",color:"blue"});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
31
ts/beautylog.classes.ora.ts
Normal file
31
ts/beautylog.classes.ora.ts
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import * as plugins from "./beautylog.plugins";
|
||||
import * as log from "./beautylog.log";
|
||||
|
||||
export class Ora {
|
||||
private _oraObject;
|
||||
state:string;
|
||||
constructor(textArg:string,colorArg:string){
|
||||
this._oraObject = plugins.ora({
|
||||
spinner:"dots",
|
||||
text:textArg,
|
||||
color:colorArg
|
||||
});
|
||||
this._oraObject.start();
|
||||
}
|
||||
text(textArg){
|
||||
this._oraObject.text = textArg;
|
||||
};
|
||||
end(){
|
||||
this._oraObject.stop();
|
||||
this._oraObject.clear();
|
||||
}
|
||||
endOk(textArg){
|
||||
this.end();
|
||||
log.ok(textArg);
|
||||
};
|
||||
endError(textArg){
|
||||
this.end();
|
||||
log.error(textArg);
|
||||
};
|
||||
}
|
49
ts/beautylog.classes.table.ts
Normal file
49
ts/beautylog.classes.table.ts
Normal file
@ -0,0 +1,49 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import * as plugins from "./beautylog.plugins";
|
||||
|
||||
let tableHelpers = {
|
||||
makeRow: function(cellCounterArg:number = 2,colorArg:string = "cyan"){
|
||||
let rowArray = [];
|
||||
for (let i = 0; i < (cellCounterArg); i++) {
|
||||
rowArray.push(String(i + 1).cyan);
|
||||
}
|
||||
return rowArray;
|
||||
}
|
||||
};
|
||||
|
||||
export class Table {
|
||||
tableHead:string[];
|
||||
rows;
|
||||
type:string;
|
||||
constructor(tableTypeArg:string,tableHeadArrayArg:string[] = tableHelpers.makeRow()) {
|
||||
switch (tableTypeArg) {
|
||||
case "checks":
|
||||
this.tableHead = ['Check Item:'.cyan,'Status:'.cyan];
|
||||
break;
|
||||
case "custom":
|
||||
this.tableHead = tableHeadArrayArg;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.rows = [];
|
||||
this.type = tableTypeArg;
|
||||
}
|
||||
push(row:string[]){
|
||||
this.rows.push(row);
|
||||
}
|
||||
print() {
|
||||
let table = new plugins.cliTable({
|
||||
head: this.tableHead
|
||||
});
|
||||
for (let row in this.rows){
|
||||
if(this.rows[row][1] == "success"){
|
||||
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
|
||||
} else if (this.rows[row][1] == "error") {
|
||||
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
|
||||
}
|
||||
table.push(this.rows[row]);
|
||||
};
|
||||
console.log(table.toString());
|
||||
}
|
||||
}
|
@ -1,49 +1,12 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import plugins = require("./beautylog.plugins");
|
||||
|
||||
var tableHelpers = {
|
||||
makeRow: function(cellCounterArg:number = 2,colorArg:string = "cyan"){
|
||||
var rowArray = [];
|
||||
for (var i = 0; i < (cellCounterArg); i++) {
|
||||
rowArray.push(String(i + 1).cyan);
|
||||
}
|
||||
return rowArray;
|
||||
}
|
||||
};
|
||||
import {Table} from "./beautylog.classes.table";
|
||||
import {Ora} from "./beautylog.classes.ora";
|
||||
|
||||
export class ConsoleTable {
|
||||
tableHead:string[];
|
||||
rows;
|
||||
type:string;
|
||||
constructor(tableTypeArg:string,tableHeadArrayArg:string[] = tableHelpers.makeRow()) {
|
||||
switch (tableTypeArg) {
|
||||
case "checks":
|
||||
this.tableHead = ['Check Item:'.cyan,'Status:'.cyan];
|
||||
break;
|
||||
case "custom":
|
||||
this.tableHead = tableHeadArrayArg;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.rows = [];
|
||||
this.type = tableTypeArg;
|
||||
}
|
||||
push(row:string[]){
|
||||
this.rows.push(row);
|
||||
}
|
||||
print() {
|
||||
var table = new plugins.cliTable({
|
||||
head: this.tableHead
|
||||
});
|
||||
for (var row in this.rows){
|
||||
if(this.rows[row][1] == "success"){
|
||||
this.rows[row][1] = ' '.bgGreen + ' ' + this.rows[row][1];
|
||||
} else if (this.rows[row][1] == "error") {
|
||||
this.rows[row][1] = ' '.bgRed + ' ' + this.rows[row][1];
|
||||
}
|
||||
table.push(this.rows[row]);
|
||||
};
|
||||
console.log(table.toString());
|
||||
}
|
||||
export let table = function(tableTypeArg:string,tableHeadArrayArg?:string[]){
|
||||
return new Table(tableTypeArg,tableHeadArrayArg);
|
||||
}
|
||||
|
||||
export let ora = function(textArg:string,colorArg:string){
|
||||
return new Ora(textArg,colorArg);
|
||||
}
|
@ -10,7 +10,8 @@ if (plugins.smartenv.getEnv().isNode){
|
||||
cliTable: require("cli-table2"),
|
||||
colors: require("colors"),
|
||||
clc: require("cli-color"),
|
||||
figlet: require("figlet")
|
||||
figlet: require("figlet"),
|
||||
ora: require("ora")
|
||||
});
|
||||
}
|
||||
export = plugins;
|
@ -1,9 +0,0 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import classes = require("./beautylog.classes");
|
||||
|
||||
export let table = {
|
||||
new: function(typeArg:string,tableHeadArrayArg?) {
|
||||
var newConsoleTable = new classes.ConsoleTable(typeArg,tableHeadArrayArg);
|
||||
return newConsoleTable;
|
||||
}
|
||||
};
|
19
ts/index.ts
19
ts/index.ts
@ -4,15 +4,18 @@ import * as plugins from "./beautylog.plugins";
|
||||
import * as classes from "./beautylog.classes";
|
||||
import * as BeautylogLog from "./beautylog.log";
|
||||
import * as BeautylogFiglet from "./beautylog.figlet"
|
||||
import * as BeautylogTable from "./beautylog.table";
|
||||
|
||||
export let log = BeautylogLog.log;
|
||||
export let info = BeautylogLog.info;
|
||||
export let ok = BeautylogLog.ok;
|
||||
export let success = BeautylogLog.success;
|
||||
export let warn = BeautylogLog.warn;
|
||||
export let error = BeautylogLog.error;
|
||||
import {Ora} from "./beautylog.classes.ora";
|
||||
import {Table} from "./beautylog.classes.table";
|
||||
|
||||
export let dir = BeautylogLog.dir;
|
||||
export let error = BeautylogLog.error;
|
||||
export let figlet = BeautylogFiglet.figlet;
|
||||
export let figletSync = BeautylogFiglet.figletSync;
|
||||
export let table = BeautylogTable.table
|
||||
export let info = BeautylogLog.info;
|
||||
export let log = BeautylogLog.log;
|
||||
export let ok = BeautylogLog.ok;
|
||||
export let ora = classes.ora;
|
||||
export let success = BeautylogLog.success;
|
||||
export let table = classes.table;
|
||||
export let warn = BeautylogLog.warn;
|
||||
|
Loading…
Reference in New Issue
Block a user