1.1.0 • Published 3 years ago

github-slugger-typescript v1.1.0

Weekly downloads
76
License
MIT
Repository
-
Last release
3 years ago

github-slugger-typescript

This project is a small Typescript fork of the github-slugger Javascript library from Dan Flettre.

The original library offers more options (maintainCase, reset()) that I don't need.

This project was bootstrapped with TSDX.

Install

npm install github-slugger-typescript

Usage

Keeping track of the previously slugged strings:

import { GithubSlugger } from 'github-slugger-typescript';

const slugger = new GithubSlugger();
slugger.slug("foo");        // foo
slugger.slug("Foo Bar");    // foo-bar
slugger.slug("foo");        // foo-1
slugger.slug("foo");        // foo-2

Useage without keeping track of previously slugged strings:

import { slug } from 'github-slugger-typescript';

slug("foo");        // foo
slug("Foo Bar");    // foo-bar
slug("foo");        // foo

License

MIT

1.1.0

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago