Skip to content

Printly.js is the remake of console object in JavaScript and much better then console object and Printly.js has colours support on console messages

License

Notifications You must be signed in to change notification settings

ItzYourBread/printly.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeQL Repo Dependents npm version NPM Download

Printly.js ⚡️

What is Printly.js?

Printly.js is the rewrite of console objects in JavaScript and much better then console object and Printly.js has colours support on console messages.

Supported on?

Printly.js has TypeScript and JavaScript supoort.

There are 10 printly objects

  • 1 printly(); for printing a console message.
  • 2 printly.error(); outputs an error message to the Web console.
  • 3 printly.warn(); outputs a warning message to the Web console.
  • 4 printly.data(); utilize small spaces to not only function as additional storage, but to also show off some of your home decor and personality.
  • 5 printly.clear(); clears the console if the console allows it.
  • 6 printly.count(); logs the number of times that this particular call to count() has been called.
  • 7 printly.dir(); displays an interactive list of the properties of the specified JavaScript object.
  • 8 printly.time(); starts a timer you can use to track how long an operation takes.
  • 9 printly.timeEnd(); stops a timer that was previously started by calling console.
  • 10 printly.timeout(); it's basically setTimeout but easy

Example ✨

Here is a example with printly objects.

const { printly } = require("printly.js");


printly("Hello Printly.js!");

Here is a example with colours and some background colours.

// you can use colour or color if you want!
const { printly, colour } = require("printly.js");


printly(colour.yellow("Hello Printly.js with colour!"));

printly(colour.bgCyan(colour.red("Hello background colour"));

And here is a example with printly.timeout.

const { printly, colour } = require("printly.js");


printly(colour.yellow("Hello Printly.js"));


printly(colour.bgCyan(colour.red("Hello background colour"));



// by default is printly(); on first argument
printly.timeout(("Hello printly.js after 4 seconds"), 4000);
// example with colour
printly.timeout(colour.cyan("Hello printly.js after 4 seconds"), 4000);

And here is the millisecond converter.

const { printly, ms } = require("printly.js");


ms('1d')      // 86400000
ms('10h')     // 36000000
ms('2h')      // 7200000
ms('1m')      // 60000
ms('5s')      // 5000
ms('100')     // 100
ms(100)       // 100

ms(60000)             // "1 minute"
ms(2 * 60000)         // "2 minutes"

printly.timeout(("Hello Printly.js"), ms('10 hours'));    // "10 hours"

Colors

ForegroundBackground
blackbgBlack
redbgRed
greenbgGreen
yellowbgYellow
bluebgBlue
magentabgMagenta
cyanbgCyan
whitebgWhite
Bright variants
ForegroundBackground
blackBrightbgBlackBright
redBrightbgRedBright
greenBrightbgGreenBright
yellowBrightbgYellowBright
blueBrightbgBlueBright
magentaBrightbgMagentaBright
cyanBrightbgCyanBright
whiteBrightbgWhiteBright

Not supported on Windows and some terminals. However if used in not supported environment, the closest color from basic (16 colors) palette is chosen.

Have a great day!

thats it hope it will help JavaScript and TypeScript developers!

About

Printly.js is the remake of console object in JavaScript and much better then console object and Printly.js has colours support on console messages

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published