@subasshrestha/unique-slug

1.0.1 • Public • Published

@subasshrestha/unique-slug

Generate a unique slug for a given string by appending random string at the end

const { slugify, slugifyWithoutRandomText } = require('@subasshrestha/unique-slug');

console.log(slugify("Text for slug"));
// "text-for-slug-aTyp-uYrt"

console.log(slugifyWithoutRandomText("Text for slug"));
// "text-for-slug"

slugify(str, n) → slug of str + (n-n) random string

default value of n is 4

Readme

Keywords

none

Package Sidebar

Install

npm i @subasshrestha/unique-slug

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

2.63 kB

Total Files

4

Last publish

Collaborators

  • subasshrestha