stringar
v1.0.1
Published
A simple library to manipulate and sanitize strings from HTML tags and escape special characters.
Maintainers
Readme
Stringar
A simple and light library to manipulate and sanitize strings from HTML tags and escape special characters.
Features
- XSS Sanitize
- URL Verify
- Mail verify
- String validation
Installation
Install Stringar with npm
npm install stringar
Usage
import { isEmail, sanitize, isUrl } from 'stringar'
let input = "[email protected]"
isEmail(input) // True!
let xss = "<p>hecker</p>"
sanitize(xss) // "hecker"
let url = "http://localhost:3000"
isUrl(url) // True!
Validation
import { isString, isEmpty, maxLenght } from 'stringar'
let string = "hello world"
isString(string) // True!
let input = ""
isEmpty(input) // True!
let text = "I'm so cool"
maxLenght(text, 10) // True!
let another_example = "This is a very long string..."
maxLenght(another_example, 5) // False!
Contributing
Contributions are always welcome!
