spray-print
Colorized print
spray-print is a library that makes your console prints more vibrant using chalk.
Installation
npm install spray-printyarn add spray-printOnce you've added spray print to your project, you have to require it in your file.
const print = require('spray-print');Usage
There are several types of printouts, and a custom one too:
print.println('Message');
print.warn('Warning');
print.error('Error');
print.success(':D');
print.custom('title','message');There is also an alternate styling choice that uses (!) instead of [!]:
print.cprint('Message');
print.cwarn('Warning');
print.cerror('Error');
print.csuccess(':D');Anything that works with console.log works here, so you can still display variables and join strings.
Standard Print

print.println('Message');
print.cprint('Message'); // Alternate StyleA standard print is signified by a blue ! character inside brackets.
Warning Print
print.warn('Warning');
print.cwarn('Warning'); // Alternate StyleA standard print is signified by a yellow ! character inside brackets.
Error Print
print.error('Error');
print.cerror('Error'); // Alternate StyleA standard print is signified by a red ! character inside brackets. It's advised you use this over console.error in nodejs commandline apps, as it stands out more.
Success Print
print.success('Success');
print.csuccess('Success'); // Alternate StyleA standard print is signified by a green ! character inside brackets. Should be used to show that a task completed successfully.
Custom Print
print.custom('Title','Text');A standard print is signified by blue text inside brackets. This text is derived from the first given argument, while the second is the content.
On version 1.0.0, using this command will throw an error.
Links
https://www.npmjs.com/package/spray-print - NPM Page
Last updated
Was this helpful?