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 πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

@charmland/lipgloss

v2.0.0-beta.3-0e280f3

Published

Style definitions for nice terminal layouts πŸ‘„

Readme

LipGloss.js

The lipgloss that you know and love, now in JavaScript.

[!WARNING] LipGloss.js is stll experimental.

Installation

npm i @charmland/lipgloss

Example

const { Table, TableData, Style, Color, List, Tree, Leaf, Bullet, RoundedEnumerator } = require("@charmland/lipgloss");

var s = new Style().foreground(Color("240")).render;
console.log(
  new Table()
    .wrap(false)
    .headers("Drink", "Description")
    .row("Bubble Tea", s("Milky"))
    .row("Milk Tea", s("Also milky"))
    .row("Actual milk", s("Milky as well"))
    .render(),
);

// TableData example - for more complex data management
const employeeData = new TableData(
  ["Employee ID", "Name", "Department"],
  ["001", "John Doe", "Engineering"],
  ["002", "Jane Smith", "Marketing"],
  ["003", "Mike Johnson", "Sales"]
);

console.log(
  new Table()
    .data(employeeData)
    .styleFunc((row, col) => {
      if (row === -1) {
        return new Style().foreground(Color("99")).bold(true);
      }
      return new Style().padding(0, 1);
    })
    .render()
);

// List example
const groceries = new List("Bananas", "Barley", "Cashews", "Milk")
  .enumerator(Bullet)
  .itemStyle(new Style().foreground(Color("255")));

console.log(groceries.render());

// Tree example with Leaf nodes
const makeupTree = new Tree()
  .root("⁜ Makeup")
  .child(
    "Glossier",
    "Fenty Beauty",
    new Tree().child(
      new Leaf("Gloss Bomb Universal Lip Luminizer"),
      new Leaf("Hot Cheeks Velour Blushlighter")
    ),
    new Leaf("Nyx"),
    new Leaf("Mac"),
    "Milk"
  )
  .enumerator(RoundedEnumerator)
  .enumeratorStyle(new Style().foreground(Color("63")).marginRight(1))
  .rootStyle(new Style().foreground(Color("35")))
  .itemStyle(new Style().foreground(Color("212")));

console.log(makeupTree.render());

TableData

The TableData class provides a more structured way to manage table data compared to using individual rows. It's particularly useful when you need to:

  • Build tables dynamically
  • Access individual cells programmatically
  • Manage large datasets
  • Separate data logic from presentation

Basic Usage

const { Table, TableData, Style, Color } = require("@charmland/lipgloss");

// Create TableData with initial rows
const data = new TableData(
  ["Name", "Age", "City"],
  ["Alice", "25", "New York"],
  ["Bob", "30", "San Francisco"]
);

// Or build it incrementally
const data2 = new TableData()
  .append(["Product", "Price"])
  .append(["Laptop", "$999"])
  .append(["Mouse", "$25"]);

// Use with Table
const table = new Table()
  .data(data)
  .styleFunc((row, col) => {
    if (row === -1) return new Style().bold(true); // Header
    return new Style().padding(0, 1);
  })
  .render();

TableData Methods

  • new TableData(...rows) - Create with optional initial rows
  • .append(row) - Add a single row (array of strings)
  • .rows(...rows) - Add multiple rows at once
  • .at(row, col) - Get value at specific position
  • .rowCount() - Get number of rows
  • .columnCount() - Get number of columns

See examples/table-data.js for more comprehensive examples.

Environment Variables

You can control debug output using environment variables:

  • LIPGLOSS_DEBUG=true - Enable all lipgloss debug output
  • DEBUG=lipgloss - Enable lipgloss debug output (standard debug pattern)
  • DEBUG=* - Enable all debug output

Example:

node your-script.js

Compability

Lipgloss in JavaScript it's experimental and a lot of existing functionalities are not still ported to JavaScript.

Size (100%)

| Function | Status | | --- | --- | | Width | βœ… | | Height | βœ… | | Size | βœ… |

Color (100%)

| Function | Status | | --- | --- | | Color | βœ… | | NoColor | βœ… | | Complete | βœ… | | LightDark | βœ… | | RGBA | βœ… |

Borders (100%)

| Function | Status | | --- | --- | | NormalBorder | βœ… | | RoundedBorder | βœ… | | BlockBorder | βœ… | | OuterHalfBlockBorder | βœ… | | InnerHalfBlockBorder | βœ… | | ThickBorder | βœ… | | DoubleBorder | βœ… | | HiddenBorder | βœ… | | MarkdownBorder | βœ… | | ASCIIBorder | βœ… |

Style (97.62%)

| Function | Status | | --- | --- | | Foreground | βœ… | | Background | βœ… | | Width | βœ… | | Height | βœ… | | Align | βœ… | | AlignHorizontal | βœ… | | AlignVertical | βœ… | | Padding | βœ… | | PaddingLeft | βœ… | | PaddingRight | βœ… | | PaddingTop | βœ… | | PaddingBottom | βœ… | | ColorWhitespace | βœ… | | Margin | βœ… | | MarginLeft | βœ… | | MarginRight | βœ… | | MarginTop | βœ… | | MarginBottom | βœ… | | MarginBackground | βœ… | | Border | βœ… | | BorderStyle | βœ… | | SetBorderRight | βœ… | | SetBorderLeft | βœ… | | SetBorderTop | βœ… | | SetBorderBottom | βœ… | | BorderForeground | βœ… | | BorderTopForeground | βœ… | | BorderRightForeground | βœ… | | BorderBottomForeground | βœ… | | BorderLeftForeground | βœ… | | BorderBackground | βœ… | | BorderTopBackground | βœ… | | BorderRightBackground | βœ… | | BorderBottomBackground | βœ… | | BorderLeftBackground | βœ… | | Inline | βœ… | | MaxWidth | βœ… | | MaxHeight | βœ… | | TabWidth | βœ… | | UnderlineSpaces | βœ… | | Underline | βœ… | | Reverse | βœ… | | SetString | βœ… | | Inherit | βœ… | | Faint | βœ… | | Italic | βœ… | | Strikethrough | βœ… | | StrikethroughSpaces | βœ… | | Transform | ⏳ |

Table (100%)

| Function | Status | | --- | --- | | table.New | βœ… | | table.Rows | βœ… | | table.Headers | βœ… | | table.Render | βœ… | | table.ClearRows | βœ… | | table.BorderTop | βœ… | | table.BorderBottom | βœ… | | table.BorderLeft | βœ… | | table.BorderRight | βœ… | | table.BorderHeader | βœ… | | table.BorderColumn | βœ… | | table.BorderRow | βœ… | | table.Width | βœ… | | table.Height | βœ… | | table.Offset | βœ… | | table.String | βœ… | | table.StyleFunc | βœ… | | table.Data | βœ… | | table.Border | βœ… | | table.BorderStyle | βœ… |

List (100%)

| Function | Status | | --- | --- | | Hidden | βœ… | | Hide | βœ… | | Offset | βœ… | | Value | βœ… | | String | βœ… | | Indenter | βœ… | | ItemStyle | βœ… | | ItemStyleFunc | βœ… | | EnumeratorStyle | βœ… | | EnumeratorStyleFunc | βœ… | | Item | βœ… | | Items | βœ… | | Enumerator | βœ… |

Tree (95%)

| Function | Status | | --- | --- | | tree.New | βœ… | | tree.Root | βœ… | | tree.Child | βœ… | | tree.Hidden | βœ… | | tree.Hide | βœ… | | tree.SetHidden | βœ… | | tree.Offset | βœ… | | tree.Value | βœ… | | tree.SetValue | βœ… | | tree.String | βœ… | | tree.Render | βœ… | | tree.EnumeratorStyle | βœ… | | tree.EnumeratorStyleFunc | βœ… | | tree.ItemStyle | βœ… | | tree.ItemStyleFunc | βœ… | | tree.RootStyle | βœ… | | tree.Enumerator | βœ… | | tree.Indenter | βœ… | | tree.DefaultEnumerator | βœ… | | tree.RoundedEnumerator | βœ… | | tree.DefaultIndenter | βœ… | | NewLeaf | βœ… | | Leaf.Value | βœ… | | Leaf.SetValue | βœ… | | Leaf.Hidden | βœ… | | Leaf.SetHidden | βœ… | | Leaf.String | βœ… | | Custom Enumerators | ⏳ | | Custom Indenters | ⏳ |

Join (100%)

| Function | Status | | --- | --- | | JoinHorizontal | βœ… | | JoinVertical | βœ… |

Position (100%)

| Function | Status | | --- | --- | | Center | βœ… | | Right | βœ… | | Bottom | βœ… | | Top | βœ… | | Left | βœ… | | Place | βœ… |

Query (50%)

| Function | Status | | --- | --- | | BackgroundColor | ⏳ | | HasDarkBackground | βœ… |

Align (0%)

| Function | Status | | --- | --- | | EnableLegacyWindowsANSI | ⏳ |

Contributing

We'd love to have you contribute! Please see the contributing guidelines for more information.

Testing

The JavaScript bindings include a comprehensive test suite:

# From bindings directory
npm test                      # Run all tests
npm run test:simple           # Basic table functionality
npm run test:comprehensive    # Complete TableData tests
npm run examples              # Showcase functionality

# Or from examples directory
cd examples && npm test

Tests are located in examples/tests/ and cover:

  • Basic table functionality
  • TableData operations
  • Style functions
  • Unicode handling (with known limitations)

See contributing.

Feedback

We’d love to hear your thoughts on this project. Feel free to drop us a note!

License

MIT


Part of Charm.

Charmηƒ­ηˆ±εΌ€ζΊ β€’ Charm loves open source