1.5.0 • Published 2 years ago

printly.js v1.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm.io

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

Bright variants

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!

1.5.0

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.4.4

2 years ago

1.4.2

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.2

2 years ago

1.3.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago