New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

console-play

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

console-play

ConsolePlay is a library that provides a way to output fancy and styled text in the browser console using Figlet fonts and custom style options.

  • 0.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

ConsolePlay: A Fancy Console Output Library

ConsolePlay is a library that provides a way to output fancy and styled text in the browser console using Figlet fonts and custom style options.

Quick Start

Install:

npm install console-play

Simple usage:

import { consolePlay } from "console-play";

consolePlay({
    text: "Hello, World!",
    options: {
        styleOptions: {
            color: "red",
        },
    },
});

In console:

Features

  • Output text using Figlet fonts (currently only Standard, but more Figlet fonts will be supported in the future).
  • Custom styling options for the console output
  • Dark mode support

API

consolePlay

PropertyTypeRequiredDefaultDescription
textstringYesN/AThe text to be output in the console.
optionsConsolePlayPropsNoN/AAn object containing configuration options for the console output.

Option

PropertyTypeRequiredDefaultDescription
consoleType"log", "info", "warn", "error"No"log"The type of console output (e.g., log, error, warn, etc.).
wrapUnitstringNoN/AA string representing the character(s) to wrap around the text. this prop is alpha version. so it may not work.
styleOptionsStyleOptionsYesN/AAn object containing the style options for the console output.
styleDebugbooleanNofalseA boolean flag to enable/disable style debugging.if true then console.log CSS style will be applied

Style Options

Style options is unfinished. So, it may not work except color and backGroundColor.

PropertyTypeRequiredDefaultDescription
imageUrlstringYesN/AURL of the image to be displayed as a background image. if this prop set, then you also need to set padding to allocate place for image
colorHasThemeStyleNoN/AText color. Can be a single color or an object with light and dark properties (can automatically switch between dark or light mode depending on the user's environment).
backgroundColorHasThemeStyleNoN/ABackground color. Can be a single color or an object with light and dark properties (can automatically switch between dark or light mode depending on the user's environment).
display"inline-block" | "block" | "flex" | "grid"NoN/ACSS display value.
paddingFourDirectionStyleNoN/APadding around the text. Can be a single number or an object with top, right, left, and bottom properties.
marginFourDirectionStyleNoN/AMargin around the text. Can be a single number or an object with top, right, left, and bottom properties.
boxShadowstringNoN/ACSS box-shadow value. such as box-shadow: 12px 12px 2px 1px rgba(0, 0, 255, .2);

The HasThemeStyle type is defined as follows:

type HasThemeStyle =
  | string
  | {
      light: string;
      dark: string;
    };

The FourDirectionStyle type is defined as follows:

type FourDirectionStyle =
  | number
  | {
      top?: number;
      right?: number;
      left?: number;
      bottom?: number;
    };

For more information on HasThemeStyle and FourDirectionStyle, please refer to the original code provided.

License

MIT © skyt-a

Keywords

FAQs

Package last updated on 09 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc