Slugify Sring
Slugify a string for use in a URL.
yarn add slugify-string
Usage
; const title = 'How to Publish & Update a Package';;// -> 'how-to-publish-and-update-a-package'
Custom whitelist
You can pass a custom whitelist to ensure certain characters are not transformed. In the following example .
s are kept.
; const title = 'React v16.3.0: New lifecycles and context API';;// -> 'react-v16.3.0-new-lifecycles-and-context-api'