https://github.com/simonleclere/js-string-cleaner
A simple npm module to replace special characters in a string with unicode letters.
https://github.com/simonleclere/js-string-cleaner
Last synced: 6 months ago
JSON representation
A simple npm module to replace special characters in a string with unicode letters.
- Host: GitHub
- URL: https://github.com/simonleclere/js-string-cleaner
- Owner: SimonLeclere
- Created: 2020-12-04T19:54:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-30T18:09:43.000Z (almost 3 years ago)
- Last Synced: 2024-12-15T10:12:17.910Z (6 months ago)
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/js-string-cleaner
- Size: 95.7 KB
- Stars: 15
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Welcome to js-string-cleaner 👋
> A simple npm module to replace special characters in a string with unicode letters.
### 🏠 [Homepage](https://github.com/SimonLeclere/Js-String-Cleaner#readme)
## Install
```sh
npm i js-string-cleaner
```## Usage
The module has only one function that takes as parameter a string and an optionnal object. By default, each character will simply be replaced by its corresponding letter, which can lead to mixtures of lower and upper case letters. If a character is not recognized, it is left as it is. To get a formatted string, with only the first letter of each word in uppercase or only the first character of the sentence in uppercase, use parameters `capitalizeAllWords` or `capitalizeFirstLetter`.
```js
const clean = require('js-string-cleaner');const txt = 'sιмση ℓεcℓεяε#5765';
clean(txt); // simon leclere#5765
clean(txt, { capitalizeFirstLetter: true }); // Simon leclere#5765
clean(txt, { capitalizeAllWords: true }); // Simon Leclere#5765
```## Author
👤 **Simon Leclère**
* Github: [@SimonLeclere](https://github.com/SimonLeclere)
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/SimonLeclere/Js-String-Cleaner/issues).
PS: If you want to add new characters, don't hesitate to make a pull request or to contact me on Discord : `sιмση ℓεcℓεяε#5765`.## Build it yourself
```
npm run test
npm run format
npm run lint
npm run build
```## Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2020 [Simon Leclère](https://github.com/SimonLeclere).
This project is [ISC](https://github.com/SimonLeclere/Js-String-Cleaner/blob/master/LICENSE) licensed.***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_