Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simplyhexagonal/simple-strings
Convenient functions to normalize strings with international special characters (diacritics)
https://github.com/simplyhexagonal/simple-strings
diacritics diacritics-removal javascript-library string-manipulation typescript-library url-safe
Last synced: 11 days ago
JSON representation
Convenient functions to normalize strings with international special characters (diacritics)
- Host: GitHub
- URL: https://github.com/simplyhexagonal/simple-strings
- Owner: simplyhexagonal
- Created: 2021-11-13T02:19:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-09T02:13:16.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T05:33:59.312Z (9 months ago)
- Topics: diacritics, diacritics-removal, javascript-library, string-manipulation, typescript-library, url-safe
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@simplyhexagonal/simple-strings
- Size: 83 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Simple Strings
![Tests](https://github.com/simplyhexagonal/simple-strings/workflows/tests/badge.svg)
[![Try simple-strings on RunKit](https://badge.runkitcdn.com/@simplyhexagonal/simple-strings.svg)](https://npm.runkit.com/@simplyhexagonal/simple-strings)Convenient functions to normalize strings with international special characters (diacritics).
Great for creating url-safe strings, i.e. normalize header titles into [url slugs](https://www.semrush.com/blog/what-is-a-url-slug/).
## Open source notice
This project is open to updates by its users, [I](https://github.com/jeanlescure) ensure that PRs are relevant to the community.
In other words, if you find a bug or want a new feature, please help us by becoming one of the
[contributors](#contributors-) ✌️ ! See the [contributing section](#contributing)## Like this module? ❤
Please consider:
- [Buying me a coffee](https://www.buymeacoffee.com/jeanlescure) ☕
- Supporting Simply Hexagonal on [Open Collective](https://opencollective.com/simplyhexagonal) 🏆
- Starring this repo on [Github](https://github.com/simplyhexagonal/simple-strings) 🌟## Install
```sh
pnpm i @simplyhexagonal/simple-strings# or
yarn add @simplyhexagonal/simple-strings# or
npm install @simplyhexagonal/simple-strings
```## Usage
```ts
import {
removeDiacritics,
makeUrlSafe,
simpleSearchTermIndex,
} from '@simplyhexagonal/simple-strings';console.log(
removeDiacritics('¿¡Árvíztűrő tükörfúrógép!?')
);// ¿¡Arvizturo tukorfurogep!?
console.log(
makeUrlSafe('¿¡Árvíztűrő tükörfúrógép!?')
);// arvizturo-tukorfurogep
console.log(
simpleSearchTermIndex('bee ¿¡Árvíztűrő -minus +"include, this" ')
);// arvizturo bee +"include this" -minus
```Browser
```html
const {
removeDiacritics,
makeUrlSafe,
simpleSearchTermIndex,
} = SimpleStrings;alert(
removeDiacritics('¿¡Árvíztűrő tükörfúrógép!?')
);// ¿¡Arvizturo tukorfurogep!?
alert(
makeUrlSafe('¿¡Árvíztűrő tükörfúrógép!?')
);// arvizturo-tukorfurogep
alert(
simpleSearchTermIndex('bee ¿¡Árvíztűrő -minus +"include, this" ')
);// arvizturo bee +"include this" -minus
```
## Contributing
Yes, thank you! This plugin is community-driven, most of its features are from different authors.
Please update the docs and tests and add your name to the `simple-strings.json` file.## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
## License
Copyright (c) 2021-Present [Simple Strings Contributors](https://github.com/simplyhexagonal/simple-strings/#contributors-).
Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).