Convert sentences, titles and special characters to a url/filename/id-appropiate and readable slug.
npm install @kainiedziela/slugize --save
import { slugize } from '@kainiedziela/sunday';
const slug = slugize(string);
slugize(string)
returns a string that had replaced special characters with latin alternatives, replaced spaces with dashes, removed periods, replaced non-alphanumerical characters with dashes, condensed consecutive dashes, lowercased and with the begging and end trimmed (so that the string doesn't start or end with a dash).
Tests are performed with Jest.
npm run test
This project is under the MIT license.