anser
npmv2.3.5TypeScriptA 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
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,anser vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| anserthis page | 10.4M | 3 | MIT | 8 months ago |
| color-convert | 299.6M | 1 | MIT | 1 day ago |
| dom-serializer | 94.3M | 2 | MIT | 1 day ago |
| html-escaper | 79.8M | 1 | MIT | 1 day ago |
| is-potential-custom-element-name | 41.4M | 2 | MIT | 1 day ago |
| supports-hyperlinks | 35.4M | 1 | MIT | 1 day ago |
Dependencies
Declared by anser v2.3.5. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (4)
Used by
Popular packages that depend on anser.
Relationship graph
Dependencies (left) and dependents (right) of anser.
Frequently installed together
The Expo SDK
React package for working with the DOM.
React is a JavaScript library for building user interfaces.
Error overlay for universal Expo apps.
A framework for building native apps using React
TypeScript definitions for react
Parses every stack trace into a nicely formatted array of hashes.
Stringify any JavaScript value.
A window.fetch polyfill.
Provides system information that remains constant throughout the lifetime of your app.
A WebView specifically designed for Expo DOM components
the complete solution for node.js command-line programs
Release history
5 releases in the last two years, typically about 74 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.3.5latest | 8 months ago | 39 KB | MIT |
| 2.3.4 | 8 months ago | 39 KB | MIT |
| 2.3.3 | 9 months ago | 43 KB | MIT |
| 2.3.2 | 1 year ago | 55 KB | MIT |
| 2.3.1 | 1 year ago | 55 KB | MIT |
| 2.3.0 | 1 year ago | 55 KB | MIT |
| 2.2.0 | 1 year ago | 57 KB | MIT |
| 2.1.1 | 4 years ago | 48 KB | MIT |
| 2.1.0 | 4 years ago | 50 KB | MIT |
| 2.0.2 | 5 years ago | 49 KB | MIT |
| 2.0.1 | 5 years ago | 47 KB | MIT |
| 2.0.0 | 6 years ago | 47 KB | MIT |
| 1.4.10 | 6 years ago | 45 KB | MIT |
| 1.4.9 | 7 years ago | 39 KB | MIT |
| 1.4.8 | 7 years ago | 43 KB | MIT |
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
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.