# @garystorey/slugify

> A small utility to remove/replace whitepace from a string

Latest version **1.0.3** (published 2022-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @garystorey/slugify
pnpm add @garystorey/slugify
yarn add @garystorey/slugify
bun add @garystorey/slugify
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-07-08 |
| First published | 2021-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gary Storey |
| Maintainers | garystorey |
| Keywords | rollup, vitest, typescript, slugify, slug, whitespace-remove |

## Links

- npm: https://www.npmjs.com/package/@garystorey/slugify
- Repository: https://github.com/garystorey/slugify
- Homepage: https://github.com/garystorey/slugify#readme.md
- Issues: https://github.com/garystorey/slugify/issues
- npm.io page: https://npm.io/package/@garystorey/slugify

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-07-08
- 1.0.2 — 2021-05-15
- 1.0.1 — 2021-05-15
- 1.0.0 — 2021-05-15

## README

# slugify

A small dependency-free utility to remove whitespace from a string.

![Version](https://img.shields.io/github/package-json/v/garystorey/slugify)
![Size](https://img.shields.io/bundlephobia/min/@garystorey/slugify)
![License](https://img.shields.io/npm/l/@garystorey/slugify)

![Leywords](https://img.shields.io/github/package-json/keywords/garystorey/slugify)

## Installation

You can install either with `npm` or `yarn`:

```js
npm install @garystorey/slugify

yarn add @garystorey/slugify
```
## Parameters

| Parameter Type | Required | Description
--------|----------|---
| string| **Yes**| The string to strip whitespace
| _string_| _No_ | _Replacement character_

<br/>

## Usage

`slugify` has one required `string` parameter.

```js
import slugify from '@garystorey/slugify';
const slug = slugify('My Title');
console.log(slug);
// "mytitle"
```

Optionally, a replacement character can be provided as a second argument:


```js
import slugify from '@garystorey/slugify';
const slug = slugify('My Title','_');
console.log(slug);
// "my_title"
```

`slugify` is written in TypeScript.

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