JSPM

strip-ansi-stream

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3275
  • Score
    100M100P100Q124715F
  • License MIT

Strip ANSI escape codes

Package Exports

  • strip-ansi-stream

Readme

strip-ansi-stream

Strip ANSI escape codes

Install

$ npm install strip-ansi-stream

Usage

import stripAnsiStream from 'strip-ansi-stream';

const stream = stripAnsiStream();

stream.on('data', data => {
    console.log(data);
    //=> 'Unicorn'
    //=> 'bar'
})

stream.write('\u001B[4mUnicorn\u001B[0m');
stream.end('\u001B[0;33;49;3;9;4mbar\u001B[0m');

API

stripAnsiStream()

Returns a Transform stream that strips ANSI escape codes.

  • strip-ansi - Non-streaming version of this module
  • has-ansi - Check if a string has ANSI escape codes
  • ansi-regex - Regular expression for matching ANSI escape codes
  • chalk - Terminal string styling done right