This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

printly.js
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

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

Foreground Background
black bgBlack
red bgRed
green bgGreen
yellow bgYellow
blue bgBlue
magenta bgMagenta
cyan bgCyan
white bgWhite
Bright variants
Foreground Background
blackBright bgBlackBright
redBright bgRedBright
greenBright bgGreenBright
yellowBright bgYellowBright
blueBright bgBlueBright
magentaBright bgMagentaBright
cyanBright bgCyanBright
whiteBright bgWhiteBright

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!

Package Sidebar

Install

npm i printly.js

Weekly Downloads

0

Version

1.5.0

License

MIT

Unpacked Size

14.3 kB

Total Files

8

Last publish

Collaborators

  • notrealarif