# sluglife

> Slugifies strings.

Latest version **1.0.1** (published 2020-12-01) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-12-01 |
| First published | 2017-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.9.0 |
| Dependencies | 3 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jarrod Connolly |
| Maintainers | jarrodconnolly |
| Keywords | slugify, slug, string, utf8, utf-8, unicode, url |

## Links

- npm: https://www.npmjs.com/package/sluglife
- Repository: https://github.com/jarrodconnolly/sluglife
- Homepage: https://github.com/jarrodconnolly/sluglife#readme
- Issues: https://github.com/jarrodconnolly/sluglife/issues
- npm.io page: https://npm.io/package/sluglife

## Dependencies (3)

- [unicode](https://npm.io/package/unicode.md) 12.1.0
- [lodash.defaults](https://npm.io/package/lodash.defaults.md) 4.2.0
- [transliteration](https://npm.io/package/transliteration.md) 2.2.0

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-12-01
- 0.9.8 — 2019-03-19
- 0.9.7 — 2018-07-25
- 0.9.6 — 2018-02-03
- 0.9.5 — 2018-02-02
- 0.1.0 — 2017-10-30

## README

![npm](https://img.shields.io/npm/v/sluglife)
![npm](https://img.shields.io/npm/dw/sluglife)
![NPM](https://img.shields.io/npm/l/sluglife)
![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow)

# sluglife (■_■¬)

slugifies string. Handles, unicode, multi-language characters, currency symbols, and more!

Make strings url-safe.

- respecting [RFC 3986](https://tools.ietf.org/html/rfc3986)
- Comprehensive tests
- Coerces foreign symbols to their english equivalent

```
npm install sluglife
```

## Examples

```javascript
var slug = require('sluglife')

slug('i ♥ unicode') === 'i-love-unicode';

slug('unicode ♥ is ☢') === 'unicode-love-is-radioactive';

slug('i ♥ unicode', {'replacement': '_'}) === 'i_love_unicode';

slug('I ♥ UNICODE', {'charMap': {'♥': 'freaking love'}}) === 'I-freaking-love-UNICODE';

slug('☏-Number', {lower: true}) === 'telephone-number';

slug('i <3 unicode') === 'i-love-unicode';
```

## Options

```javascript
slug('string', {
  replacement: '-',               // space separator replacement character
  replaceSymbols: true,           // replace unicode symbols or not
  remove: null,                   // regex to remove characters that match (see 'pretty' definition)
  lower: true,                    // lower case all letters in slug
  charmap: slug.charmap,          // replace special characters
  multicharmap: slug.multicharmap // replace multi-characters
});
```

## Defaults
There are two default setting groups.
The default mode is 'pretty'

```javascript
slug('Hello There World.', {'mode': 'rfc3986'}) === 'hello-there-world.';
slug('Hello There World.', {'mode': 'pretty'}) === 'Hello-There-World';
```
The default setting groups are defined below.
```javascript
slug.defaults.modes['rfc3986'] = {
  replacement: '-',
  replaceSymbols: true,
  remove: null,
  lower: true,
  charmap: slug.charmap,
  multicharmap: slug.multicharmap
};
 
slug.defaults.modes['pretty'] = {
  replacement: '-',
  replaceSymbols: true,
  remove: /[.]/g,
  lower: false,
  charmap: slug.charmap,
  multicharmap: slug.multicharmap
};
```

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