New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

inkr-core

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inkr-core

CLI colorizing tool for styled terminal output

latest
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source
Untitled design (4)

inkr-core

inkr-core is a zero-dependency, TypeScript-first library for richly stylized, colourized terminal output. Designed for clarity, flexibility, and performance.

Features

  • Advanced colour support: 16-colour, 256-colour (ANSI), and true RGB.
  • Foreground and background styling, including custom RGB arrays.
  • Text weights (bold, dim) and underline styles (single, double).
  • Intuitive, chainable API for style composition.
  • Automatic terminal colour detection.
  • Reusable, themeable style definitions.
  • Pure TypeScript with no external dependencies.

Installation

npm install inkr-core

Usage

import inkr from "inkr";

// Simple usage
console.log(inkr.style().colour("red").text("Red text"));

// Background and combined styles
console.log(
  inkr
    .style()
    .colour("white")
    .bgColour("blue")
    .weight("bold")
    .underline("single")
    .text("Styled text")
);

// RGB colours
console.log(inkr.style().colour([255, 128, 0]).text("Orange RGB text"));

Reusable Theme-Based Styles

const error = inkr.style().colour("red").weight("bold");
console.log(error.text("Error: Operation failed"));

// another way
const success = inkr
  .configure({
    colour: "green",
    weight: "bold",
  })
  .style();
console.log(success.text("Server is running on port:8000"));

Chained Outputs

console.log(
  inkr.style().colour("red").text("Error: ") +
    inkr.style().colour("yellow").text("Details here.")
);

API Summary

MethodFunction
style()Start a new style chain
colour(value)Set text colour (name or [r,g,b] array)
bgColour(value)Set background colour (name or [r,g,b] array)
weight(value)Set text weight: 'bold', 'dim', 'normal'
underline(value)Apply underline: 'single', 'double', 'none'
text(content)Apply styles to a string

inkr-core ensures beautiful output, adapts to your terminal, and keeps your CLI code elegant.

Supportibility

  • node >= 18
  • Compatible with terminal colours & Browser Developer Console(ANSI)

License: MIT

Keywords

terminal

FAQs

Package last updated on 07 Aug 2025

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