Fork of github-slugger written in TS
yarn add @caldwell619/github-slugger
import { slugger } from '@caldwell619/github-slugger'
const slug = slugger('My Cool Post: 2000-08-02')
// my-cool-post-2000-08-02
By default, all characters will be lower cased. If you wish to maintain the casing, pass the second argument as true:
import { slugger } from '@caldwell619/github-slugger'
const slug = slugger('My Cool Post: 2000-08-02', true)
// 'My-Cool-Post-2000-08-02'