slug-generator

Create URI slug in easy way. Supports serbian cyrilic and latin language.

Usage no npm install needed!

<script type="module">
  import slugGenerator from 'https://cdn.skypack.dev/slug-generator';
</script>

README

slug-generator

This is vanilla javascript port of node-slug so all credits goes to dodo and simov.

This script convert cyrilic to latin URI slug.

var slugify = require('slug-generator')

// add string to a function to create slug 
slugify('this is a string') // returns this-is-a-string

// if you want to change default separator(-) add 2nd parameter to function 
slugify('this is a string', '_') //returns this_is_a_string