@develephant/corona-html5-node-kit
Version:
Build Corona HTML5 plugins using NodeJS, NPM, and modern JavaScript.
53 lines (48 loc) • 1.2 kB
JavaScript
//-----------------------------------------------------------------------------
// Corona HTML5 Node Kit - Plugin Builder
// (c)2018 C. Byerley (develephant)
//-----------------------------------------------------------------------------
const path = require('path')
const clr = require('colors/safe')
clr.setTheme({
ok: ['bold', 'green'],
log: 'cyan',
info: ['bold', 'blue'],
warn: ['bold', 'yellow'],
err: ['bold', 'red'],
title: ['bold', 'red', 'bgBlack'],
fun: 'rainbow'
})
//styling
function dashes(amt=80) {
console.log(clr.dim('-'.repeat(amt)))
}
//colors direct
module.exports.clr = clr
//pretty print
module.exports.pp = {
ok: function(str) {
console.log(clr.ok(`\xBB ${str}`))
},
info: function(str) {
console.log(clr.info(`\xBB ${str}`))
},
warn: function(str) {
console.log(clr.warn(`\xBB ${str}`))
},
err: function(str) {
console.log(clr.err(`\xBB ${str}`))
},
log: function(str) {
console.log(clr.log(`\xBB ${str}`))
},
title: function() {
console.log(clr.title('\xBB Welcome to Corona HTML5 Node Kit \xAB'))
},
fun: function(str) {
console.log(clr.fun(str))
},
dashes: function(amt) {
dashes(amt)
}
}