Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foridpathan/react-url-slugify
https://github.com/foridpathan/react-url-slugify
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/foridpathan/react-url-slugify
- Owner: foridpathan
- License: mit
- Created: 2022-10-20T10:43:37.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-20T11:36:28.000Z (over 2 years ago)
- Last Synced: 2025-01-31T13:37:57.863Z (8 days ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-url-slugify
![Build status](https://github.com/foridpathan/react-url-slugify/workflows/tests/badge.svg)
[![Dependencies](https://github.com/foridpathan/react-url-slugify)](https://github.com/foridpathan/react-url-slugify)Generate slug using React URL Slugify with Unicode supported.
## Usage
### `slugify(node[, options])`
- `node` String, Number, Fragment, Array of nodes
- `options` Object (optional)
- `delimiter` String (default is `'-'`)
- `prefix` String (default is `''`)
- `keyword` String (default is `false`)
- `number` String (default is `false`)
## Examples```tsx
import slugify from 'react-url-slugify';slugify('something I want to test');
// -> "something-i-want-to-test"slugify(Yes it works like that too);
// -> "yes-it-works-like-that-too"slugify(
<>
and
with
fragments or arrays
>
);
// -> "and-with-fragments-or-arrays"slugify(
আমার সোনার বাংলা আমি তোমায় ভালোবাসি
, { delimiter: '_' });
// -> আমার_সোনার_বাংলা_আমি_তোমায়_ভালোবাসি
// -> user-content_creme_brulee_receipe
```