1.0.2 • Published 3 years ago

@dmmdjs/dpaint v1.0.2

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

Dpaint

Table of Contents

About

Dpaint is an easy to use tool that enables support to terminal color.

  • Zero Dependencies
  • Detailed JsDoc
  • Easy to Use
  • Near Optimized

Installation

Ensure you have the correct version of Node.js and npm installed:

Recommended:

  • Node: v16.4.0
  • npm: v7.18.1

Minimum:

  • Node: v14.17.1
  • npm: v7.18.1

Open a terminal with Node.js installed

npm i @dmmdjs/dpaint@latest --save

Usage

Importing:

const dpaint = require("@dmmdjs/dpaint");

Basic Usage:

// Colors
console.log(dpaint.red("Hello world")); // "Hello world" in red
console.log(dpaint.green("Hello everyone", true)); // "Hello everyone" with green background
console.log(dpaint.rgb("Blue", 0, 0, 255)); // "Blue" in blue
console.log(dpaint.hex("White", "#FFFFFF", true)); // "White" with white background

// Styles
console.log(dpaint.bold("Boldness")); // "Boldness" in bold
console.log(dpaint.italic("Italic")); // "Italic" in italic

// Extras
console.log(dpaint.rgb("VSC Red", ...dpaint.preset("vsc", "red"))); // "VSC Red" in red with visual studio code display
console.log(dpaint.orange("Oranges and Apples")); // "Oranges and Apples" in orange
console.log(dpaint.trueRed("Actual RED")); // "Actual RED" in red

Full Examples:

function redGradient() {
    let string = "";
    for(let i = 0; i < 255; i++) string += dpaint.rgb(" ", i, 0, 0, true);
    return string;
};

console.log(redGradient()); // Prints out a red gradient
function log(time, user, message) {
    return `(${dpaint.red(time)}) | ${dpaint.yellow(user)}: ${dpaint.green(message)}`;
};

console.log(log("15:13", "System", "Hello world")); // "(15:13) | System: Hello world"

Alternative Options

Credits & Contact

Credits:

  • iiPython
    • Bug finding & supporting

Contact Information

Notice

  • README Format: @dmmdjs README v3
  • License: MIT

Last Updated: Sep 18, 2021