String Sanitizer
An intuitive & tiny string sanitizer to remove any special characters or convert strings to create filename or url 🎉🎉
Use Case
Converting or sanitizing string is easier than ever with the help of this package. You can use this utility package to sanitize even foreign languages other than English. Under the hood, regex is heavily used in this library. You can convert your string to url or filename frindly string.
🎉🎉
Installation
You can download this package from here - string-sanitizer npm
npm i string-sanitizer
Yarn installation
yarn add string-sanitizer
Usage 👀👀👀
Just pass your string as the argument. The method will return a sanitized or converted string instantly.
var string = require("string-sanitizer");
let someString = "@abcde$f$gh";
string.sanitize(someString);
Other Use Cases
var string = require("string-sanitizer");
string.sanitize("a.bc@d efg#h");
string.sanitize.keepSpace("a.bc@d efg#h");
string.sanitize.keepUnicode("a.bc@d efg#hক");
string.sanitize.addFullstop("a.bc@d efg#h");
string.sanitize.addUnderscore("a.bc@d efg#h");
string.sanitize.addDash("a.bc@d efg#h");
string.sanitize.removeNumber("@abcd efgh123");
string.sanitize.keepNumber("@abcd efgh123");
string.addFullstop("abcd efgh");
string.addUnderscore("@abcd efgh");
string.addDash("@abcd efgh");
string.removeSpace("@abcd efgh");
Show Me the Code
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate. 🏃🏃
License
MIT