ciallorize
Version:
Ciallorize your bundled js into ascii art.
18 lines (16 loc) • 932 B
JavaScript
const error_msg = require('./error_msg.js');
const ciallorize = error_msg.rainbowText('ciallorize')
module.exports = (code)=>{
if(typeof code !== 'string'){
console.log(` Failed to `+ciallorize+': Input must be a string.')
throw new Error('Input must be a string')
}else if(code.includes('\n')){
console.log(` Failed to `+ciallorize+': Input must be a single line, without `\\n`.')
console.log(' Consider to covert your code into bundle js with tools like Webpack or Babel.')
throw new Error('Input must be a single line, without `\\n`')
}else if(code.length<(5*1000)){
console.log(` Failed to `+ciallorize+': Input is too shot, must be at least 5000 characters.')
console.log(' Consider to covert your code into bundle js with tools like Webpack or Babel.')
throw new Error('Input is too shot, must be at least 5000 characters')
}
}