m.noansi
m(icro)noansi is a lightweight es6+ library that removes ansi escape codes.
stream replacement
the module itself exports a transform stream that can be used according to its api.
const noansi = processstdin
string replacement
the noansi
method is used internally within the transform stream but can be used safely to replace string and buffers.
const noansi = // => '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 noansiecho "\u001b[4mfoobar\u001b[0m" | noansi # echo "foobar" which m.noansiecho "\u001b[4mfoobar\u001b[0m" | m.noansi # echo "foobar"