# @types/slug

> TypeScript definitions for slug

Latest version **5.0.9** (published 2024-08-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/slug
pnpm add @types/slug
yarn add @types/slug
bun add @types/slug
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 5.0.9 |
| Published | 2024-08-13 |
| First published | 2016-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51444 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/slug
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slug
- npm.io page: https://npm.io/package/@types/slug

## Recent versions

- 5.0.9 (latest) — 2024-08-13
- 5.0.8 (ts4.6) — 2024-03-05
- 5.0.7 (ts4.5) — 2023-11-07
- 5.0.4 (ts4.4) — 2023-08-15
- 5.0.3 (ts4.1) — 2021-12-03
- 5.0.2 (ts3.6) — 2021-07-08
- 5.0.0 (ts3.5) — 2021-05-24
- 0.9.1 (ts2.8) — 2019-02-13
- 5.0.6 — 2023-10-18
- 5.0.5 — 2023-09-25
- 5.0.1 — 2021-07-06
- 0.9.0 — 2016-12-29

## README

# Installation
> `npm install --save @types/slug`

# Summary
This package contains type definitions for slug (https://github.com/trott/node-slug).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slug.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/slug/index.d.ts)
````ts
export = slug;
export as namespace slug;

declare function slug(string: string, replacement: string): string;
declare function slug(string: string, opts?: slug.Options): string;

declare namespace slug {
    const charmap: CharMap;
    const defaults: {
        charmap: CharMap;
        mode: string;
        modes: {
            pretty: Mode;
            rfc3986: Mode;
        };
        multicharmap: CharMap;
        fallback: boolean;
    };
    const multicharmap: CharMap;

    function extend(entry: CharMap): void;
    function reset(): void;
    function setLocale(locale: string): void;

    interface Mode {
        charmap?: CharMap | null | undefined;
        lower?: boolean | null | undefined;
        multicharmap?: CharMap | null | undefined;
        remove?: RegExp | null | undefined;
        replacement?: string | null | undefined;
        symbols?: boolean | null | undefined;
        trim?: boolean | null | undefined;
        fallback?: boolean | null | undefined;
    }

    type Options = {
        locale?: string | undefined;
        mode?: "pretty" | "rfc3986" | null | undefined;
    } & Partial<Mode>;

    type CharMap = Record<string, string>;
}

````

### Additional Details
 * Last updated: Tue, 13 Aug 2024 17:36:14 GMT
 * Dependencies: none

# Credits
These definitions were written by [Daniel Clausmeyer](https://github.com/danielclausmeyer).

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