</>PackageGraphPackageGraph

anser

npmv2.3.5TypeScript

A low level parser for ANSI sequences.

Safe to adopt

Yes — anser scores well across adoption, maintenance, weight, supply chain, and licensing. 10.4M downloads per week and 3 known dependents. Last published 268 days ago. 7 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    10.4M downloads per week and 3 known dependents.

  • BMaintenance: grade B, Good.

    Last published 268 days ago. 7 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 39 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding anser to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

39 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
No constraint declared
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the anser README.

const Anser = require("anser");

const txt = "\u001b[38;5;196mHello\u001b[39m \u001b[48;5;226mWorld\u001b[49m";

console.log(Anser.ansiToHtml(txt));
// <span style="color:rgb(255, 0, 0)">Hello</span> <span style="background-color:rgb(255, 255, 0)">World</span>

console.log(Anser.ansiToHtml(txt, { use_classes: true }));
// <span class="ansi-palette-196-fg">Hello</span> <span class="ansi-palette-226-bg">World</span>

console.log(Anser.ansiToJson(txt));
// [ { content: '',
//     fg: null,
//     bg: null,
Example truncated — see the full README.

anser vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
anserthis page10.4M3MIT8 months ago
color-convert299.6M1MIT1 day ago
dom-serializer94.3M2MIT1 day ago
html-escaper79.8M1MIT1 day ago
is-potential-custom-element-name41.4M2MIT1 day ago
supports-hyperlinks35.4M1MIT1 day ago

Dependencies

Declared by anser v2.3.5. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (4)

jshint ^2.13.6jslint ^0.12.1mocha ^11.1.0should *

Used by

Popular packages that depend on anser.

Relationship graph

Dependencies (left) and dependents (right) of anser.

Frequently installed together

Release history

5 releases in the last two years, typically about 74 days apart.

Recent versions of anser
VersionPublishedSizeLicense
2.3.5latest8 months ago39 KBMIT
2.3.48 months ago39 KBMIT
2.3.39 months ago43 KBMIT
2.3.21 year ago55 KBMIT
2.3.11 year ago55 KBMIT
2.3.01 year ago55 KBMIT
2.2.01 year ago57 KBMIT
2.1.14 years ago48 KBMIT
2.1.04 years ago50 KBMIT
2.0.25 years ago49 KBMIT
2.0.15 years ago47 KBMIT
2.0.06 years ago47 KBMIT
1.4.106 years ago45 KBMIT
1.4.97 years ago39 KBMIT
1.4.87 years ago43 KBMIT

Overview

anser is an npm package that a low level parser for ANSI sequences. It is extremely widely used, with about 10.4M downloads per week and 3 known dependents in the graph. The latest version is 2.3.5, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need a low level parser for ANSI sequences and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (10.4M weekly downloads).
  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use anser?

Yes — anser scores well across adoption, maintenance, weight, supply chain, and licensing. 10.4M downloads per week and 3 known dependents. Last published 268 days ago. 7 releases in the last 2 years.

How do I install anser?

Run `npm install anser` to add anser to your npm project.

What license is anser released under?

anser is distributed under the MIT license.

How popular is anser?

anser has approximately 10,382,749 downloads per week and 3 known dependent packages.

Is anser still maintained?

The most recent release of anser (v2.3.5) was published 8 months ago.

Does anser run install scripts?

No. anser does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.