npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

stylesh

v1.0.6

Published

Stylesh is a powerful and easy-to-use JavaScript and TypeScript library that enables developers to style text and add various decorative elements to console output. With Stylesh, you can apply colors to text and backgrounds, create dashed, double, solid,

Downloads

34

Readme

STYLESH

Description

Stylesh is a powerful and easy-to-use JavaScript and TypeScript library that enables developers to style text and add various decorative elements to console output. With Stylesh, you can apply colors to text and backgrounds, create dashed, double, solid, or custom borders, and even customize the border colors from a palette of 141 available colors. This library simplifies the process of enhancing console output for JavaScript and TypeScript developers, making debugging and logging more visually appealing and informative.

Logo

Examples

Installation

Installation is done using the npm install command:

$ npm install stylesh

Features

  • Text Styling: Change the color of the text to highlight important messages or errors.
  • Background Styling: Set background colors to emphasize specific sections of the output.
  • Border Styles: Add dashed, double, solid, or custom borders to console output.
  • Border Color Customization: Choose from 141 available colors to customize border colors.
  • Rounded Corners: Apply rounded corners to the borders for a polished look.
  • Easy to Use: Simple and intuitive API, allowing developers to style console output with minimal code.
  • Compatible: Works seamlessly with both JavaScript and TypeScript projects.

Usage

First, import the stylesh library into your project:

// Import the stylesh library
require("stylesh");
//or
import("stylesh");

Text color

1.single color: You can use Any of the 141 available colors, use color names

console.log("Important Message".color("green"));

2.multi colors:

Examples

  • red
  • yellow
  • green
  • blue
  • pink
  • orange
  • brown
  • purple
  • cyan
console.log("Important Message".multiColors("red");

Background color

1.single color: You can use Any of the 141 available colors, use color names

console.log("Important Message".bg("green"));

2.multi colors:

Examples

  • red
  • yellow
  • green
  • blue
  • pink
  • orange
  • brown
  • purple
  • cyan
console.log("Important Message".multiBg("red");

Border Styles

Examples

Solid Border

console.log("Error Message".color("red").createSolidBorder("red"));

Dashed Border

console.log("Hello".color("blue").createDashedBorder("blue"));

Rounded Corners

console.log("Hello".createRoundedBorder("red", "r"));

Double Border

console.log("Error Message".color("red").createDoubleBorder("red"));

Dotted Border

console.log("Error Message".color("red").createDottedBorder("red"));

Custom Border

console.log("Hello".color("aqua").createCustomBorder("=", "top", "red"));

Multiline Messages

console.log(
  "Important Information<>Additional Details<>Note: This is a multi-line message"
    .color("white")
    .createDottedBorder("green", "r")
);

Note

When specifying multiple lines, separate each line with <>

Customization

Border functions take two arguments: border color and text alignment direction.

  • Border Color: Any of the 141 available colors, use color names.
  • Text Alignment Direction: Use 'c' for center (default), 'l' for left, or 'r' for right alignment.

Examples

console.log(
  "Default dashed border with center alignment.".createDashedBorder("purple")
);
console.log(
  "Solid border in orange with left alignment.".createSolidBorder("orange", "l")
);
console.log(
  "Rounded border in tomato color with right alignment.".createRoundedBorder(
    "tomato",
    "r"
  )
);

the example result

Custom Border

  • Symbol: The character used to create the border.
  • Border Position: Use 'all', 'top', 'bottom', 'left', or 'right' to specify the position
  • Border Color: Any of the 141 available colors, use color names.

Examples

console.log(
  "Custom green border at the bottom.".createCustomBorder(
    "#",
    "bottom",
    "green"
  )
);
console.log(
  "Custom blue border on the left.".createCustomBorder("*", "left", "blue")
);
console.log(
  "Custom orange border on the right.".createCustomBorder(
    "@",
    "right",
    "orange"
  )
);

Abailable colors :

ConsoleStyler supports a variety of colors, including "red", "green", "blue", and many more. You can choose from 141 available colors to customize your console output.

Colors