teksluggable
v1.0.1
Published
A lightweight package for generating slugs from strings.
Readme
teksluggable
About
A lightweight package for generating slugs from strings.
Install
Run the command
npm i teksluggableJS
Add the following code to your JS file:
import changeToSlug from "teksluggable";
changeToSlug(string, separator,fa);- string: represents the value you want to convert.
- separator: defines the delimiter (default is '-').
- fa: is a boolean; when true, it converts Persian and Arabic characters to English; otherwise, they remain as is.
Another function is provided to automatically convert the value of an input or textarea to a slug using the code below:
import {slugify} from "tkicon";
slugify(selector ,seperator ,fa)- selector: indicates how the input element should be targeted.
Note: The function is triggered by the focusout event, which occurs when you click outside the input field.
