1.0.0 • Published 6 years ago

carwash-data v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Carwash

Clean up data by removing any non-ASCII characters and decoding non UTF-8 text.

This is a one line module for the common task of cleaning up data from, say, an HTTP request, where the data may be intentionally obfuscated.

Currently, I only remove non-ASCII characters and other corrupted characters. If you have another general use case, leave a pull request.

Usage

const carwash = require('carwash');
// dezalgoify, not the best example, but it will work
console.log(carwash("t͏̴̸͝ḩ̀͘͢ì̷͘͜͢ş̕͠͝ ̀͏̀i̸s͠ ̧̀c̛o̡͞͡r͏̢͢͞͏r̡͏͏̵u̸͜p̴̨̀͜t̷͝é̴d҉̀͠͠ ́͢͝͝t̴̵̡͟͠e͏͝x͠t̨̧̛͢͡ ͘͡ţ͟h̷̵̛̕͜á̴̷̢̧t̀҉̡͡ ̷̧͟b͏҉r͝͠ǫ̡́͞k҉̢҉̧è̵̛̕͞ ͞͏͡m̀͟͞ý̀̕ ̢̨t͏̧̢҉e͜͝r̸͡͡m̀͏i̢҉̀n̶̵̨͢͟ą̵̧͝ļ̛̀͡"))
// prints "this is corrupted text that broke my terminal"