# uslug

> A permissive slug generator that works with unicode.

Latest version **1.0.4** (published 2016-03-08) · 0 weekly downloads

## Install

```sh
npm install uslug
pnpm add uslug
yarn add uslug
bun add uslug
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2016-03-08 |
| First published | 2012-02-01 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/uslug) |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 81 |
| Author | Jeremy Selier |
| Maintainers | jeremys |

## Links

- npm: https://www.npmjs.com/package/uslug
- Repository: https://github.com/jeremys/uslug
- Homepage: https://github.com/jeremys/uslug#readme
- Issues: http://github.com/jeremys/uslug/issues
- npm.io page: https://npm.io/package/uslug

## Dependencies (1)

- [unorm](https://npm.io/package/unorm.md) >= 1.0.0

## Recent versions

- 1.0.4 (latest) — 2016-03-08
- 1.0.3 — 2012-05-20
- 1.0.2 — 2012-02-01
- 1.0.1 — 2012-02-01
- 1.0.0 — 2012-02-01

## README

# Uslug.js

Permissive slug generator that works with unicode.
We keep only characters from the categories Letter, Number and Separator (see [Unicode Categories](http://www.unicode.org/versions/Unicode6.0.0/ch04.pdf))
and the common [CJK Unified Ideographs](http://www.unicode.org/versions/Unicode6.0.0/ch12.pdf) as defined in the version 6.0.0 of the Unicode specification.

Inspired by [unicode-slugify](https://github.com/mozilla/unicode-slugify).
Note that this slug generator is different from [node-slug](https://github.com/dodo/node-slug) which focus on translating unicode characters to english or latin equivalent.


## Quick Examples

    uslug('Быстрее и лучше!') // 'быстрее-и-лучше'
    uslug('汉语/漢語') // '汉语漢語'

    uslug('Y U NO', { lower: false })) // 'Y-U-NO'
    uslug('Y U NO', { spaces: true })) // 'y u no'
    uslug('Y-U|NO', { allowedChars: '|' })) // 'yu|no'


## Installation

    npm install uslug


## Options

### uslug(string, options)

Generate a slug for the string passed.

__Arguments__

* string - The string you want to slugify.
* options - An optional object that can contain:  
    * allowedChars: a String of chars that you want to be whitelisted. Default: '-_~'.  
    * lower: a Boolean to force to lower case the slug. Default: true.  
    * spaces: a Boolean to allow spaces. Default: false.  


## License

This project is distributed under the MIT License. See LICENSE file for more information.

---
_Source: https://npm.io/package/uslug · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
