https://github.com/shuding/sluga
Slugify a string. The minimal version.
https://github.com/shuding/sluga
Last synced: 8 months ago
JSON representation
Slugify a string. The minimal version.
- Host: GitHub
- URL: https://github.com/shuding/sluga
- Owner: shuding
- License: mit
- Fork: true (eseQ/slugify)
- Created: 2020-09-23T15:35:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-29T08:57:58.000Z (over 3 years ago)
- Last Synced: 2024-10-14T00:36:29.683Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 36
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-list - sluga
README
# sluga
> Slugify a string
A fork of @sindresorhus/slugify, with ES5 support added and extra options removed.
## Install
```
$ npm install sluga
```
## Usage
```js
const slugify = require('sluga');
slugify('I ♥ Dogs');
//=> 'i-dogs'
slugify(' Déjà Vu! ');
//=> 'deja-vu'
slugify('fooBar 123 $#%');
//=> 'foo-bar-123'
slugify('я люблю единорогов');
//=> 'ya-lyublyu-edinorogov'
```
## API
### slugify(string)
#### string
Type: `string`
String to slugify.