Socket
Socket
Sign inDemoInstall

string-sanitizer

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    string-sanitizer

An intuitive & tiny string sanitizer to remove any special characters or convert strings to create filename or url 🎉🎉


Version published
Weekly downloads
2.2K
decreased by-32.55%
Maintainers
1
Install size
8.99 kB
Created
Weekly downloads
 

Readme

Source

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); // abcdefgh

Other Use Cases

var string = require("string-sanitizer");

string.sanitize("a.bc@d efg#h"); // abcdefgh
string.sanitize.keepSpace("a.bc@d efg#h"); // abcd efgh
string.sanitize.keepUnicode("a.bc@d efg#hক"); // abcd efghক
string.sanitize.addFullstop("a.bc@d efg#h"); // abcd.efgh
string.sanitize.addUnderscore("a.bc@d efg#h"); // abcd_efgh
string.sanitize.addDash("a.bc@d efg#h"); // abcd-efgh
string.sanitize.removeNumber("@abcd efgh123"); // abcdefgh
string.sanitize.keepNumber("@abcd efgh123"); // abcdefgh123
string.addFullstop("abcd efgh"); // abcd.efgh
string.addUnderscore("@abcd efgh"); // @abcd_efgh
string.addDash("@abcd efgh"); // @abcd-efgh
string.removeSpace("@abcd efgh"); // @abcdefgh

Show Me the Code

string-sanitizer

Typescript compatitibility

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

Keywords

FAQs

Last updated on 22 Oct 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc