m.noansi

1.1.0 • Public • Published

m.noansi

m(icro)noansi is a lightweight es6+ library that removes ansi escape codes.

travis dependencies linter coverage

node version minzip license

stream replacement

the module itself exports a transform stream that can be used according to its api.

const noansi = require('m.noansi')
 
process.stdin.pipe(noansi).pipe(process.stdout)

string replacement

the noansi method is used internally within the transform stream but can be used safely to replace string and buffers.

const {noansi} = require('m.noansi')
 
noansi('\u001b[4mfoobar\u001b[0m') // => 'foobar'

cli usage

when installed globally both m.noansi and noansi binaries are linked and can therefore be used:

npm --global install m.noansi
 
which noansi
echo "\u001b[4mfoobar\u001b[0m" | noansi # echo "foobar" 
 
which m.noansi
echo "\u001b[4mfoobar\u001b[0m" | m.noansi # echo "foobar" 

Package Sidebar

Install

npm i m.noansi

Weekly Downloads

11

Version

1.1.0

License

MIT

Unpacked Size

4.15 kB

Total Files

4

Last publish

Collaborators

  • ivoputzer