1.0.0 • Published 2 years ago

best-string v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Instalation

use this command to installation

npm install best-string

imports

import BestString from 'best-string' //or require

Usage

import BestString from "best-string";

const my_text = new BestString('Hello <script>alert("TEST")</script>').noScriptTag().build()
console.log(my_text) //Result:  'Hello'

const text = new BestString('Hi چطوری؟').noRtlCharacters().build();
console.log(text) //Result:  'Hi'

const user = 'Jack'
const message = new BestString('welcome {user}! your role is ROLE!,your nickname is {user}')
    .replaceGlobal('{user}', user)
    .replaceGlobal('ROLE', 'ADMIN')
    .build()
console.log(message) //Result: welcome Jack! your role is ADMIN!,your nickname is Jack

TODO

  • add Methods