now bundles typings

This commit is contained in:
LosslessBot 2016-05-02 02:23:40 +02:00
parent e80a20be70
commit 128a81150e
30 changed files with 461 additions and 385 deletions

View File

@ -1,5 +0,0 @@
export declare let log: (message: any) => void;
export declare let info: (message: any) => void;
export declare let ok: (message: any) => void;
export declare let success: (message: any) => void;
export declare let warn: (message: any) => void;

View File

@ -1,19 +0,0 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
exports.log = function (message) {
console.log('%c Log: %c ' + message, "background:#42A5F5;color:#ffffff", "color:#42A5F5;");
};
exports.info = function (message) {
console.log('%c Info: %c ' + message, 'background:#EC407A;color:#ffffff;', 'color:#EC407A;');
};
exports.ok = function (message) {
console.log('%c OK: %c ' + message, "background:#000000;color:#8BC34A;", "color:#000000;");
};
exports.success = function (message) {
console.log('%c Success: %c ' + message, "background:#8BC34A;color:#ffffff;", "color:#8BC34A;");
};
exports.warn = function (message) {
console.log('%c Warn: %c ' + message, "background:#000000;color:#FB8C00;", "color:#000000;");
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5icm93c2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFakMsV0FBRyxHQUFHLFVBQVMsT0FBTztJQUM3QixPQUFPLENBQUMsR0FBRyxDQUFDLGFBQWEsR0FBRyxPQUFPLEVBQUMsa0NBQWtDLEVBQUMsZ0JBQWdCLENBQUMsQ0FBQztBQUM3RixDQUFDLENBQUM7QUFDUyxZQUFJLEdBQUcsVUFBUyxPQUFPO0lBQzlCLE9BQU8sQ0FBQyxHQUFHLENBQUMsY0FBYyxHQUFHLE9BQU8sRUFBQyxtQ0FBbUMsRUFBQyxnQkFBZ0IsQ0FBQyxDQUFDO0FBQy9GLENBQUMsQ0FBQztBQUNTLFVBQUUsR0FBRyxVQUFTLE9BQU87SUFDNUIsT0FBTyxDQUFDLEdBQUcsQ0FBQyxZQU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I6IzAwMDAwMDtcIik7XG59O1xuZXhwb3J0IGxldCBzdWNjZXNzID0gZnVuY3Rpb24obWVzc2FnZSl7XG4gICAgY29uc29sZS5sb2coJyVjIFN1Y2Nlc3M6ICVjICcgKyBtZXNzYWdlLFwiYmFja2dyb3VuZDojOEJDMzRBO2NvbG9yOiNmZmZmZmY7XCIsXCJjb2xvcjojOEJDMzRBO1wiKTtcbn07XG5leHBvcnQgbGV0IHdhcm4gPSBmdW5jdGlvbihtZXNzYWdlKXtcbiAgICBjb25zb2xlLmxvZygnJWMgV2FybjogJWMgJyArIG1lc3NhZ2UsXCJiYWNrZ3JvdW5kOiMwMDAwMDA7Y29sb3I6I0ZCOEMwMDtcIixcImNvbG9yOiMwMDAwMDA7XCIpO1xufTsiXX0=

40
dist/beautylog.figlet.js vendored Normal file
View File

@ -0,0 +1,40 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./beautylog.plugins");
var defaultOptions = {
font: "Star Wars",
color: "green",
cb: function () { }
};
exports.figlet = function (textArg, optionsArg) {
var done = plugins.q.defer();
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions, optionsArg);
plugins.figlet(textArg, {
font: options.font,
horizontalLayout: 'default',
verticalLayout: 'default'
}, function (err, data) {
if (err) {
console.log('Something went wrong...');
console.dir(err);
return;
}
console.log(data[options.color]);
options.cb();
done.resolve();
});
return done.promise;
};
exports.figletSync = function (textArg, optionsArg) {
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions, optionsArg);
console.log(plugins.figlet.textSync(textArg, {
font: options.font,
horizontalLayout: 'default',
verticalLayout: 'default'
})[options.color]);
return true;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5maWdsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1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ldC50ZXh0U3luYyh0ZXh0QXJnLHtcbiAgICAgICAgZm9udDogb3B0aW9ucy5mb250LFxuICAgICAgICBob3Jpem9udGFsTGF5b3V0OiAnZGVmYXVsdCcsXG4gICAgICAgIHZlcnRpY2FsTGF5b3V0OiAnZGVmYXVsdCdcbiAgICB9KVtvcHRpb25zLmNvbG9yXSk7XG4gICAgcmV0dXJuIHRydWU7XG59O1xuIl19

37
dist/beautylog.log.d.ts vendored Normal file
View File

@ -0,0 +1,37 @@
export { log } from "./beautylog.log.helpers";
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
export declare let info: (logText: any) => void;
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
export declare let ok: (logText: any) => void;
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
export declare let success: (logText: any) => void;
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
export declare let warn: (logText: any) => void;
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
export declare let error: (logText: any) => void;
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
export declare let dir: (logText: any) => void;

7
dist/beautylog.log.helpers.d.ts vendored Normal file
View File

@ -0,0 +1,7 @@
/**
*
* @param logText
* @param logType
* @returns {boolean}
*/
export declare let log: (logText?: string, logType?: string) => void;

106
dist/beautylog.log.helpers.js vendored Normal file

File diff suppressed because one or more lines are too long

55
dist/beautylog.log.js vendored Normal file
View File

@ -0,0 +1,55 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
var beautylog_log_helpers_1 = require("./beautylog.log.helpers");
var beautylog_log_helpers_2 = require("./beautylog.log.helpers");
exports.log = beautylog_log_helpers_2.log;
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
exports.info = function (logText) {
return beautylog_log_helpers_1.log(logText, 'info');
};
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
exports.ok = function (logText) {
return beautylog_log_helpers_1.log(logText, 'ok');
};
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.success = function (logText) {
return beautylog_log_helpers_1.log(logText, 'success');
};
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.warn = function (logText) {
return beautylog_log_helpers_1.log(logText, 'warn');
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
exports.error = function (logText) {
return beautylog_log_helpers_1.log(logText, 'error');
};
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
exports.dir = function (logText) {
return beautylog_log_helpers_1.log(logText, 'dir');
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5sb2cudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDOztBQUU1QyxzQ0FBa0IseUJBQXlCLENBQUMsQ0FBQTtBQUM1QyxzQ0FBa0IseUJBQXlCLENBQUM7QUFBcEMsMENBQW9DO0FBRTVDOzs7O0dBSUc7QUFDUSxZQUFJLEdBQUcsVUFBVSxPQUFPO0lBQy9CLE1BQU0sQ0FBQywyQkFBRyxDQUFDLE9BQU8sRUFBRSxNQUFNLENBQUMsQ0FBQztBQUNoQyxDQUFDLENBQUM7QUFFRjs7OztHQUlHO0FBQ1EsVUFBRSxHQUFHLFVBQVUsT0FBTztJQUM3QixNQUFNLENBQUMsMkJBQUcsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDOUIsQ0FBQyxDQUFDO0FBRUY7Ozs7R0FJRztBQUNRLGVBQU8sR0FBRyxVQUFVLE9BQU87SUFDbEMsTUFBTSxDQUFDLDJCQUFHLENBQUMsT0FBTyxFQUFFLFNBQVMsQ0FBQyxDQUFDO0FBQ25DLENBQUMsQ0FBQztBQUVGOzs7O0dBSUc7QUFDUSxZQUFJLEdBQUcsVUFBVSxPQUFPO0lBQy9CLE1BQU0sQ0FBQywyQkFBRyxDQUFDLE9BQU8sRUFBRSxNQUFNLENBQU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bSBsb2dUZXh0IHN0cmluZyB0byBsb2cgYXMgZXJyb3JcbiAqIEByZXR1cm5zIHtib29sZWFufVxuICovXG5leHBvcnQgbGV0IHN1Y2Nlc3MgPSBmdW5jdGlvbiAobG9nVGV4dCkge1xuICAgIHJldHVybiBsb2cobG9nVGV4dCwgJ3N1Y2Nlc3MnKTtcbn07XG5cbi8qKlxuICogbG9ncyBhICd3YXJuOicgbWVzc2FnZSB0byBjb25zb2xlXG4gKiBAcGFyYW0gbG9nVGV4dCBzdHJpbmcgdG8gbG9nIGFzIGVycm9yXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn1cbiAqL1xuZXhwb3J0IGxldCB3YXJuID0gZnVuY3Rpb24gKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICd3YXJuJyk7XG59O1xuXG4vKipcbiAqIGxvZ3MgYW4gZXJyb3IgdG8gY29uc29sZVxuICogQHBhcmFtIGxvZ1RleHRcbiAqIEByZXR1cm5zIHtib29sZWFufVxuICovXG5leHBvcnQgbGV0IGVycm9yID0gZnVuY3Rpb24gKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICdlcnJvcicpO1xufTtcblxuLyoqXG4gKiBsb2dzIGFuIGRpcmVjdG9yeSB0byBjb25zb2xlXG4gKiBAcGFyYW0gbG9nVGV4dFxuICogQHJldHVybnMge2Jvb2xlYW59XG4gKi9cbmV4cG9ydCBsZXQgZGlyID0gZnVuY3Rpb24gKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICdkaXInKTtcbn07Il19

View File

@ -1,40 +0,0 @@
export import log = require("./beautylog.node.log");
export import table = require("./beautylog.node.table");
export declare let figlet: (textArg: string, optionsArg?: any) => any;
export declare let figletSync: (textArg: string, optionsArg?: any) => boolean;
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
export declare let dir: (logText: any) => boolean;
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
export declare let error: (logText: any) => boolean;
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
export declare let info: (logText: any) => boolean;
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
export declare let ok: (logText: any) => boolean;
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
export declare let success: (logText: any) => boolean;
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
export declare let warn: (logText: any) => boolean;

View File

@ -1,40 +0,0 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var plugins = require("./beautylog.plugins");
var defaultOptions = {
font: "Star Wars",
color: "green",
cb: function () { }
};
exports.figlet = function (textArg, optionsArg) {
var done = plugins.q.defer();
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions, optionsArg);
plugins.figlet(textArg, {
font: options.font,
horizontalLayout: 'default',
verticalLayout: 'default'
}, function (err, data) {
if (err) {
console.log('Something went wrong...');
console.dir(err);
return;
}
console.log(data[options.color]);
options.cb();
done.resolve();
});
return done.promise;
};
exports.figletSync = function (textArg, optionsArg) {
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions, optionsArg);
console.log(plugins.figlet.textSync(textArg, {
font: options.font,
horizontalLayout: 'default',
verticalLayout: 'default'
})[options.color]);
return true;
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLmZpZ2xldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsNENBQTRDO0FBQzVDLElBQU8sT0FBTyxXQUFXLHFCQUFxQixDQUFDLENBQUM7QUFDaEQsSUFBSSxjQUFjLEdBQUc7SUFDakIsSUFBSSxFQUFDLFdBQVc7SUFDaEIsS0FBSyxFQUFFLE9BQU87SUFDZCxFQUFFLEVBQUUsY0FBVyxDQUFDO0NBQ25CLENBQUM7QUFDUyxjQ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

View File

@ -1,58 +0,0 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
exports.log = require("./beautylog.node.log");
exports.table = require("./beautylog.node.table");
//handle figlet
var figletModule = require("./beautylog.node.figlet");
exports.figlet = figletModule.figlet;
exports.figletSync = figletModule.figletSync;
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
exports.dir = function (logText) {
return exports.log(logText, 'dir');
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
exports.error = function (logText) {
return exports.log(logText, 'error');
};
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
exports.info = function (logText) {
return exports.log(logText, 'info');
};
/**
* logs an 'OK!' message to console
* @param logText
* @returns {boolean}
*/
exports.ok = function (logText) {
return exports.log(logText, 'ok');
};
/**
* logs a success to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.success = function (logText) {
return exports.log(logText, 'success');
};
/**
* logs a 'warn:' message to console
* @param logText string to log as error
* @returns {boolean}
*/
exports.warn = function (logText) {
return exports.log(logText, 'warn');
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFOUIsV0FBRyxXQUFXLHNCQUFzQixDQUFDLENBQUM7QUFDdEMsYUFBSyxXQUFXLHdCQUF3QixDQUFDLENBQUM7QUFFeEQsZUFBZTtBQUNmLElBQU8sWUFBWSxXQUFXLHlCQUF5QixDQUFDLENBQUM7QUFDOUMsY0FBTSxHQUFHLFlBQVksQ0FBQyxNQUFNLENBQUM7QUFDN0Isa0JBQVUsR0FBRyxZQUFZLENBQUMsVUFBVSxDQUFDO0FBQ2hEOzs7O0dBSUc7QUFDUSxXQUFHLEdBQUcsVUFBUyxPQUFPO0lBQzdCLE1BQU0sQ0FBQyxXQUFHLENBQUMsT0FBTyxFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQy9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c3MgdG8gY29uc29sZVxuICogQHBhcmFtIGxvZ1RleHQgc3RyaW5nIHRvIGxvZyBhcyBlcnJvclxuICogQHJldHVybnMge2Jvb2xlYW59XG4gKi9cbmV4cG9ydCBsZXQgc3VjY2VzcyA9IGZ1bmN0aW9uKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICdzdWNjZXNzJyk7XG59O1xuXG4vKipcbiAqIGxvZ3MgYSAnd2FybjonIG1lc3NhZ2UgdG8gY29uc29sZVxuICogQHBhcmFtIGxvZ1RleHQgc3RyaW5nIHRvIGxvZyBhcyBlcnJvclxuICogQHJldHVybnMge2Jvb2xlYW59XG4gKi9cbmV4cG9ydCBsZXQgd2FybiA9IGZ1bmN0aW9uKGxvZ1RleHQpIHtcbiAgICByZXR1cm4gbG9nKGxvZ1RleHQsICd3YXJuJyk7XG59OyJdfQ==

View File

@ -1,8 +0,0 @@
/**
*
* @param logText
* @param logType
* @returns {boolean}
*/
declare var logFunction: (logText?: string, logType?: string) => boolean;
export = logFunction;

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
declare var beautylogOsTable: any;
export = beautylogOsTable;

View File

@ -1,11 +0,0 @@
"use strict";
/// <reference path="./typings/main.d.ts" />
var classes = require("./beautylog.classes");
var beautylogOsTable = {};
beautylogOsTable.new = function (typeArg, tableHeadArrayArg) {
var newConsoleTable = new classes.ConsoleTable(typeArg, tableHeadArrayArg);
return newConsoleTable;
};
module.exports = beautylogOsTable;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5ub2RlLnRhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxPQUFPLFdBQVcscUJBQXFCLENBQUMsQ0FBQztBQUVoRCxJQUFJLGdCQUFnQixHQUFPLEVBQUUsQ0FBQztBQUU5QixnQkFBZ0IsQ0FBQyxHQUFHLEdBQUcsVUFBUyxPQUFjLEVBQUMsaUJBQWtCO0lBQzdELElBQUksZUFBZSxHQUFHLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxPQUFPLEVBQUMsaUJBQWlCLENBQUMsQ0FBQztJQUMxRSxNQUFNLENBQUMsZUFBZSxDQUFDO0FBQzNCLENBQUMsQ0FBQztBQUNGLGlCQUFTLGdCQUFnQixDQUFDIiwiZmlsZSI6ImJlYXV0eWxvZy5ub2RlLnRhYmxlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IGNsYXNzZXMgPSByZXF1aXJlKFwiLi9iZWF1dHlsb2cuY2xhc3Nlc1wiKTtcblxudmFyIGJlYXV0eWxvZ09zVGFibGU6YW55ID0ge307XG5cbmJlYXV0eWxvZ09zVGFibGUubmV3ID0gZnVuY3Rpb24odHlwZUFyZzpzdHJpbmcsdGFibGVIZWFkQXJyYXlBcmc/KSB7XG4gICAgdmFyIG5ld0NvbnNvbGVUYWJsZSA9IG5ldyBjbGFzc2VzLkNvbnNvbGVUYWJsZSh0eXBlQXJnLHRhYmxlSGVhZEFycmF5QXJnKTtcbiAgICByZXR1cm4gbmV3Q29uc29sZVRhYmxlO1xufTtcbmV4cG9ydCA9IGJlYXV0eWxvZ09zVGFibGU7Il19

View File

View File

@ -1,3 +0,0 @@
/// <reference path="./typings/main.d.ts" />
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJlYXV0eWxvZy5wcm9taXNlY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNENBQTRDIiwiZmlsZSI6ImJlYXV0eWxvZy5wcm9taXNlY2hhaW4uanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLy8gPHJlZmVyZW5jZSBwYXRoPVwiLi90eXBpbmdzL21haW4uZC50c1wiIC8+XG4iXX0=

4
dist/beautylog.table.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
import classes = require("./beautylog.classes");
export declare let table: {
new: (typeArg: string, tableHeadArrayArg?: any) => classes.ConsoleTable;
};

11
dist/beautylog.table.js vendored Normal file
View File

@ -0,0 +1,11 @@
"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=

16
dist/index.d.ts vendored
View File

@ -1,2 +1,16 @@
declare let beautylog: any;
import * as classes from "./beautylog.classes";
declare let beautylog: {
log: (logText?: string, logType?: string) => void;
info: (logText: any) => void;
ok: (logText: any) => void;
success: (logText: any) => void;
warn: (logText: any) => void;
error: (logText: any) => void;
dir: (logText: any) => void;
figlet: (textArg: string, optionsArg?: any) => any;
figletSync: (textArg: string, optionsArg?: any) => boolean;
table: {
new: (typeArg: string, tableHeadArrayArg?: any) => classes.ConsoleTable;
};
};
export = beautylog;

32
dist/index.js vendored
View File

@ -1,20 +1,20 @@
/// <reference path="./typings/main.d.ts" />
"use strict";
var plugins = require("./beautylog.plugins");
var BeautylogNode = require("./beautylog.node");
var BeautylogBrowser = require("./beautylog.browser");
var beautylog;
switch (plugins.smartenv.getEnv().runtimeEnv) {
case "node":
beautylog = BeautylogNode;
break;
case "browser":
beautylog = BeautylogBrowser;
break;
default:
console.log("something is strange about the platform in which you try to use beautylog");
break;
}
var BeautylogLog = require("./beautylog.log");
var BeautylogFiglet = require("./beautylog.figlet");
var BeautylogTable = require("./beautylog.table");
var beautylog = {
log: BeautylogLog.log,
info: BeautylogLog.info,
ok: BeautylogLog.ok,
success: BeautylogLog.success,
warn: BeautylogLog.warn,
error: BeautylogLog.error,
dir: BeautylogLog.dir,
figlet: BeautylogFiglet.figlet,
figletSync: BeautylogFiglet.figletSync,
table: BeautylogTable.table
};
module.exports = beautylog;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDRDQUE0Qzs7QUFFNUMsSUFBWSxPQUFPLFdBQU0scUJBQXFCLENBQUMs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V0eWxvZyA9IEJlYXV0eWxvZ05vZGU7XG4gICAgICAgIGJyZWFrO1xuICAgIGNhc2UgXCJicm93c2VyXCI6XG4gICAgICAgIGJlYXV0eWxvZyA9IEJlYXV0eWxvZ0Jyb3dzZXI7XG4gICAgICAgIGJyZWFrO1xuICAgIGRlZmF1bHQ6XG4gICAgICAgIGNvbnNvbGUubG9nKFwic29tZXRoaW5nIGlzIHN0cmFuZ2UgYWJvdXQgdGhlIHBsYXRmb3JtIGluIHdoaWNoIHlvdSB0cnkgdG8gdXNlIGJlYXV0eWxvZ1wiKTtcbiAgICAgICAgYnJlYWs7XG59Ki9cblxuZXhwb3J0ID0gYmVhdXR5bG9nO1xuIl19

View File

@ -1,17 +0,0 @@
/// <reference path="./typings/main.d.ts" />
export let log = function(message){
console.log('%c Log: %c ' + message,"background:#42A5F5;color:#ffffff","color:#42A5F5;");
};
export let info = function(message){
console.log('%c Info: %c ' + message,'background:#EC407A;color:#ffffff;','color:#EC407A;');
};
export let ok = function(message){
console.log('%c OK: %c ' + message,"background:#000000;color:#8BC34A;","color:#000000;");
};
export let success = function(message){
console.log('%c Success: %c ' + message,"background:#8BC34A;color:#ffffff;","color:#8BC34A;");
};
export let warn = function(message){
console.log('%c Warn: %c ' + message,"background:#000000;color:#FB8C00;","color:#000000;");
};

View File

@ -5,6 +5,7 @@ var defaultOptions = {
color: "green",
cb: function(){}
};
export var figlet = function(textArg:string,optionsArg?){
var done = plugins.q.defer();
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
@ -25,6 +26,7 @@ export var figlet = function(textArg:string,optionsArg?){
});
return done.promise;
};
export var figletSync = function(textArg:string,optionsArg?){
var mergeOptions = plugins.lodash.cloneDeep(defaultOptions);
var options = plugins.lodash.assign(mergeOptions,optionsArg);

114
ts/beautylog.log.helpers.ts Normal file
View File

@ -0,0 +1,114 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./beautylog.plugins");
var localBl = {
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
infoPrefix: plugins.clc.bgXterm(198).xterm(231).bold(' INFO ') + ' ',
normalPrefix: ' Log: '.bgCyan.white.bold + ' ',
okPrefix: ' '.bgGreen + ' OK! '.bgBlack.green.bold + ' ',
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
};
/**
*
* @param logText
* @param logType
* @returns {boolean}
*/
export let log = function(logText:string = 'empty log', logType:string = 'normal') {
switch(plugins.smartenv.getEnv().runtimeEnv) {
case "node":
logNode(logText,logType);
break;
case "browser":
logBrowser(logText,logType);
break;
default:
console.log("something is strange about the platform in which you try to use beautylog");
break;
}
};
let logNode = function(logText:string,logType:string){
try {
switch (logType) {
case 'dir':
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
break;
case 'error':
logText = localBl.errorPrefix + logText.red.bold;
break;
case 'info':
logText = localBl.infoPrefix + plugins.clc.xterm(198)(logText);
break;
case 'normal':
logText = localBl.normalPrefix + logText.cyan.bold;
break;
case 'ok':
logText = localBl.okPrefix + logText.bold;
break;
case 'success':
logText = localBl.successPrefix + logText.green.bold;
break;
case 'warn':
logText = localBl.warnPrefix + logText.bold;
break;
case 'log':
logText = localBl.normalPrefix + logText.blue.bold;
break;
default:
logText.blue.bold;
console.log(('unknown logType for "' + logText + '"').red.bold);
break;
}
console.log(logText);
return true;
}
catch (error) {
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
return false;
}
}
let logBrowser = function(logText,logType){
switch (logType) {
case 'dir':
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
break;
case 'error':
logText = localBl.errorPrefix + logText.red.bold;
break;
case 'info':
console.log('%c Info: %c ' + logText,'background:#EC407A;color:#ffffff;','color:#EC407A;');
break;
case 'normal':
logText = localBl.normalPrefix + logText.cyan.bold;
break;
case 'ok':
console.log('%c OK: %c ' + logText,"background:#000000;color:#8BC34A;","color:#000000;");
break;
case 'success':
console.log('%c Success: %c ' + logText,"background:#8BC34A;color:#ffffff;","color:#8BC34A;");
break;
case 'warn':
console.log('%c Warn: %c ' + logText,"background:#000000;color:#FB8C00;","color:#000000;");
break;
case 'log':
console.log('%c Log: %c ' + logText,"background:#42A5F5;color:#ffffff","color:#42A5F5;");
break;
default:
console.log('unknown logType for "' + logText + '"');
break;
}
};

View File

@ -1,37 +1,14 @@
/// <reference path="./typings/main.d.ts" />
export import log = require("./beautylog.node.log");
export import table = require("./beautylog.node.table");
//handle figlet
import figletModule = require("./beautylog.node.figlet");
export let figlet = figletModule.figlet;
export let figletSync = figletModule.figletSync;
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
export let dir = function(logText) {
return log(logText, 'dir');
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
export let error = function(logText) {
return log(logText, 'error');
};
import {log} from "./beautylog.log.helpers";
export {log} from "./beautylog.log.helpers";
/**
* logs an info to console
* @param logText
* @returns {boolean}
*/
export let info = function(logText) {
export let info = function (logText) {
return log(logText, 'info');
};
@ -40,7 +17,7 @@ export let info = function(logText) {
* @param logText
* @returns {boolean}
*/
export let ok = function(logText) {
export let ok = function (logText) {
return log(logText, 'ok');
};
@ -49,7 +26,7 @@ export let ok = function(logText) {
* @param logText string to log as error
* @returns {boolean}
*/
export let success = function(logText) {
export let success = function (logText) {
return log(logText, 'success');
};
@ -58,6 +35,24 @@ export let success = function(logText) {
* @param logText string to log as error
* @returns {boolean}
*/
export let warn = function(logText) {
export let warn = function (logText) {
return log(logText, 'warn');
};
/**
* logs an error to console
* @param logText
* @returns {boolean}
*/
export let error = function (logText) {
return log(logText, 'error');
};
/**
* logs an directory to console
* @param logText
* @returns {boolean}
*/
export let dir = function (logText) {
return log(logText, 'dir');
};

View File

@ -1,59 +0,0 @@
/// <reference path="./typings/main.d.ts" />
import plugins = require("./beautylog.plugins");
var localBl = {
dirPrefix: plugins.clc.bgXterm(39).xterm(231).bold(' DIR ') + ' ',
errorPrefix: ' Error: '.bgRed.white.bold + ' ',
infoPrefix: plugins.clc.bgXterm(198).xterm(231).bold(' INFO ') + ' ',
normalPrefix: ' Log: '.bgCyan.white.bold + ' ',
okPrefix: ' '.bgGreen + ' OK! '.bgBlack.green.bold + ' ',
successPrefix: ' Success: '.bgGreen.white.bold + ' ',
warnPrefix: ' '.bgYellow + ' Warn: '.bgBlack.yellow.bold + ' '
};
/**
*
* @param logText
* @param logType
* @returns {boolean}
*/
var logFunction = function(logText:string = 'empty log', logType:string = 'normal') {
try {
switch (logType) {
case 'dir':
logText = localBl.dirPrefix + plugins.clc.xterm(26)(logText);
break;
case 'error':
logText = localBl.errorPrefix + logText.red.bold;
break;
case 'info':
logText = localBl.infoPrefix + plugins.clc.xterm(198)(logText);
break;
case 'normal':
logText = localBl.normalPrefix + logText.cyan.bold;
break;
case 'ok':
logText = localBl.okPrefix + logText.bold;
break;
case 'success':
logText = localBl.successPrefix + logText.green.bold;
break;
case 'warn':
logText = localBl.warnPrefix + logText.bold;
break;
case 'log':
default:
logText.blue.bold;
console.log(('unknown logType for "' + logText + '"').red.bold);
break;
}
console.log(logText);
return true;
}
catch (error) {
console.log(localBl.errorPrefix + 'You seem to have tried logging something strange'.red.bold + error);
return false;
}
};
export = logFunction;

View File

@ -1,10 +0,0 @@
/// <reference path="./typings/main.d.ts" />
import classes = require("./beautylog.classes");
var beautylogOsTable:any = {};
beautylogOsTable.new = function(typeArg:string,tableHeadArrayArg?) {
var newConsoleTable = new classes.ConsoleTable(typeArg,tableHeadArrayArg);
return newConsoleTable;
};
export = beautylogOsTable;

View File

@ -1 +0,0 @@
/// <reference path="./typings/main.d.ts" />

9
ts/beautylog.table.ts Normal file
View File

@ -0,0 +1,9 @@
/// <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;
}
};

View File

@ -1,11 +1,27 @@
/// <reference path="./typings/main.d.ts" />
import * as plugins from "./beautylog.plugins";
import * as BeautylogNode from "./beautylog.node";
import * as BeautylogBrowser from "./beautylog.browser";
import * as classes from "./beautylog.classes";
import * as BeautylogLog from "./beautylog.log";
import * as BeautylogFiglet from "./beautylog.figlet"
import * as BeautylogTable from "./beautylog.table";
let beautylog;
switch(plugins.smartenv.getEnv().runtimeEnv) {
let beautylog = {
log: BeautylogLog.log,
info: BeautylogLog.info,
ok: BeautylogLog.ok,
success: BeautylogLog.success,
warn: BeautylogLog.warn,
error: BeautylogLog.error,
dir: BeautylogLog.dir,
figlet: BeautylogFiglet.figlet,
figletSync: BeautylogFiglet.figletSync,
table: BeautylogTable.table
};
/*switch(plugins.smartenv.getEnv().runtimeEnv) {
case "node":
beautylog = BeautylogNode;
break;
@ -15,6 +31,6 @@ switch(plugins.smartenv.getEnv().runtimeEnv) {
default:
console.log("something is strange about the platform in which you try to use beautylog");
break;
}
}*/
export = beautylog;