sindresorhus / slugify

Slugify a string
MIT License
2.56k stars 81 forks source link

Truncate string input? #51

Closed Catsvilles closed 4 years ago

Catsvilles commented 4 years ago

Is it possible to truncate the output of the "slugified" string if it's way too long? Thanks!

sindresorhus commented 4 years ago

Why does the package need to handle that? You can just slugifiedString.slice(0, maxLength).

Catsvilles commented 4 years ago

@sindresorhus Thanks for the reply, you are right, I should just truncate it myself separately. I guess, I just got used to previous stack/package where it was done automatically. But ofc there is no need for this package to do it too. Cheers! :)