{"_id":"@brettz9/ansi-to-html","name":"@brettz9/ansi-to-html","dist-tags":{"latest":"0.6.11"},"versions":{"0.6.11":{"name":"@brettz9/ansi-to-html","version":"0.6.11","description":"Convert ansi escaped text streams to html.","main":"lib/ansi_to_html.js","engines":{"node":"*"},"scripts":{"build":"babel src --out-dir lib","lint":"eslint src test","test":"npm run build && mocha --reporter tap"},"repository":{"type":"git","url":"git+https://github.com/brettz9/ansi-to-html.git"},"homepage":"https://github.com/brettz9/ansi-to-html","bugs":{"url":"https://github.com/brettz9/ansi-to-html/issues"},"keywords":["ansi","html"],"author":{"name":"Rob Burns","email":"rburns@paiges.net","url":"http://rburns.paiges.net/"},"contributors":[{"name":"Dane Stuckel","email":"dane.stuckel@gmail.com"},{"name":"Michael","email":"michael@riesd.com"},{"name":"Thorsten Kohnhorst","email":"monsterkodi@gmx.net"},{"name":"Yoram Grahame","email":"yoz@yoz.com"},{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},{"name":"Paul Grime","email":"gitgrimbo@gmail.com"},{"name":"NeeEoo","url":"https://github.com/NeeEoo"},{"name":"Brett Zamir","url":"https://github.com/brettz9"}],"license":"MIT","devDependencies":{"@babel/cli":"^8.0.4","@babel/core":"^8.0.1","@babel/preset-env":"^8.0.2","chai":"~6.2.2","eslint":"^10.8.1","mocha":"^11.8.0"},"dependencies":{"entities":"^8.0.0"},"bin":{"ansi-to-html":"bin/ansi-to-html"},"babel":{"presets":["@babel/env"]},"gitHead":"7745797cc7a516e42d9d3fbd31fca3cb3a6bb2f3","_id":"@brettz9/ansi-to-html@0.6.11","_nodeVersion":"22.23.1","_npmVersion":"12.0.2","dist":{"integrity":"sha512-wL5CwFGNhhGOXooV7tT3Se+ihYvcSi2Ra3AY6h/Vjoie0qXTx+rvTSOAPDdFv3P6xJxNovmLtUhXKyZXi+KgAg==","shasum":"08e596b7f5816ded24621268ff65b7689d4708a3","tarball":"https://registry.npmjs.org/@brettz9/ansi-to-html/-/ansi-to-html-0.6.11.tgz","fileCount":30,"unpackedSize":530278,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF8T5642MXfQDdgXDulS3DYf/maJV3dbjOW/tmXcOQp1AiEAok1FXjtyb4RtB+LrD0JediUfvwyYlNCiNoq5c3ay+x8="}]},"_npmUser":{"name":"brettz9","email":"brettz9@yahoo.com"},"directories":{},"maintainers":[{"name":"brettz9","email":"brettz9@yahoo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ansi-to-html_0.6.11_1786195499526_0.1369095835759826"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-08T13:24:59.373Z","0.6.11":"2026-08-08T13:24:59.649Z","modified":"2026-08-08T13:24:59.838Z"},"maintainers":[{"name":"brettz9","email":"brettz9@yahoo.com"}],"description":"Convert ansi escaped text streams to html.","homepage":"https://github.com/brettz9/ansi-to-html","keywords":["ansi","html"],"repository":{"type":"git","url":"git+https://github.com/brettz9/ansi-to-html.git"},"contributors":[{"name":"Dane Stuckel","email":"dane.stuckel@gmail.com"},{"name":"Michael","email":"michael@riesd.com"},{"name":"Thorsten Kohnhorst","email":"monsterkodi@gmx.net"},{"name":"Yoram Grahame","email":"yoz@yoz.com"},{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},{"name":"Paul Grime","email":"gitgrimbo@gmail.com"},{"name":"NeeEoo","url":"https://github.com/NeeEoo"},{"name":"Brett Zamir","url":"https://github.com/brettz9"}],"author":{"name":"Rob Burns","email":"rburns@paiges.net","url":"http://rburns.paiges.net/"},"bugs":{"url":"https://github.com/brettz9/ansi-to-html/issues"},"license":"MIT","readme":"## Ansi to Html\n\n[![](https://img.shields.io/travis/brettz9/ansi-to-html.svg)](https://travis-ci.org/brettz9/ansi-to-html/branches)\n[![](https://img.shields.io/npm/v/@brettz9/ansi-to-html.svg)](https://www.npmjs.com/package/@brettz9/ansi-to-html)\n![](https://img.shields.io/npm/dm/@brettz9/ansi-to-html.svg)\n\n**This is a fork of [ansi-to-html](https://github.com/rburns/ansi-to-html)**\n\nThis was originally a port of the ansi to html converter from\n[bcat](https://github.com/rtomayko/bcat/blob/master/lib/bcat/ansi.rb) to\nJavaScript. It has since undergone quite a lot of modification.\n\nIt has a few additions:\n\n* The API has been altered to accept options in the constructor, and input in `toHtml()`.\n* ANSI codes for setting the foreground or background color to default are handled\n* the 'erase in line' escape code (`\\x1b[K`) is dropped from the output.\n\n## Installation\n\n```bash\nnpm install @brettz9/ansi-to-html\n```\n\n## Usage\n\n```javascript\nconst Convert = require('@brettz9/ansi-to-html');\nconst convert = new Convert();\n\nconsole.log(convert.toHtml('\\x1b[30mblack\\x1b[37mwhite'));\n\n/*\n    prints:\n    <a style=\"color:#000\">black<a style=\"color:#AAA\">white</a></a>\n*/\n```\n\n## Command line usage\n\nWhen using ansi-to-html from the command line the stream option is set to `true`.\nOther options can be provided. See `ansi-to-html -h` for more detail.\n\n### Process a file\n\n```bash\nansi-to-html the_filename\n```\n\n### From STDIN\n\n```bash\ngit log | ansi-to-html\n```\n\n## Options\n\nOptions can be be passed to the constructor to customize behaviour.\n\n**fg** `<CSS color values>`. The default foreground color used when reset color codes are encountered.\n\n**bg** `<CSS color values>`. The default background color used when reset color codes are encountered.\n\n**newline** `true` or `false`. Convert newline characters to `<br/>`.\n\n**space** `true` or `false`. Convert any two sequential spaces to ` &#xa0;` (a space followed by a non-breaking space). You will probably wish to use this with a fixed with font, e.g., `font-family: monospace;`.\n\n**escapeXML** `true` or `false`. Generate HTML/XML entities.\n\n**stream** `true` or `false`. Save style state across invocations of `toHtml()`.\n\n**colors** `Object`/`Array` (with values 0 - 255 containing CSS color values). Can override specific colors or the entire ANSI palette\n\n### Default options\n\n```javascript\n{\n    fg: '#FFF',\n    bg: '#000',\n    newline: false,\n    escapeXML: false,\n    stream: false\n}\n```\n\n## Development\n\nOnce you have the git repository cloned, install the dependencies:\n\n```bash\ncd ansi-to-html\nnpm install\n```\n\nLint\n\n```bash\nnpm run lint\n```\n\nBuild\n\n```bash\nnpm run build\n```\n\nTest\n\n```bash\nnpm test\n```\n","readmeFilename":"README.md","_rev":"1-0b2f60ce8d9d1bf8990f7268a4939b74"}