Skip to content

README documents unreleased ansis-based color support while npm latest still uses @colors/colors #357

@zachsents

Description

@zachsents

The README on master documents ansis-based styling behavior, but the current npm release still ships the older @colors/colors implementation.

This is confusing because npm latest is still 0.6.5, while master appears to be prepared as 0.7.0.

What I observed:

  • master/package.json says version: 0.7.0 and depends on ansis@3.10.0.
  • master/src/cell.js uses require("ansis").
  • npm cli-table3@0.6.5 depends on string-width and has optional dependency @colors/colors@1.5.0.
  • npm cli-table3@0.6.5/src/cell.js uses require("@colors/colors/safe").

This matters for color-control behavior. The README/source imply current ansis behavior, but installed package behavior differs. For example, with npm 0.6.5, table styling still emits ANSI color codes under NO_COLOR=1:

process.env.NO_COLOR = "1"
const Table = require("cli-table3")

const table = new Table({
  head: ["Name"],
  style: { head: ["yellow"], border: ["grey"] },
})

table.push(["Example"])
console.log(table.toString())

Expected from current README/source: no color output, because ansis supports NO_COLOR.

Actual with npm 0.6.5: ANSI color codes are still emitted because @colors/colors is used.

Could you either:

  1. publish the ansis-based 0.7.0, or
  2. update README/docs to clearly indicate ansis behavior is unreleased / only on master?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions