2016-05-02 00:23:40 +00:00
|
|
|
"use strict";
|
2016-05-23 07:10:30 +00:00
|
|
|
require("typings-global");
|
2016-07-23 17:47:23 +00:00
|
|
|
const plugins = require("./beautylog.plugins");
|
2016-05-02 00:23:40 +00:00
|
|
|
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;
|
|
|
|
};
|
2016-07-23 17:47:23 +00:00
|
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVhdXR5bG9nLmZpZ2xldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2JlYXV0eWxvZy5maWdsZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU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