import { slug } from "https://deno.land/x/ter@0.15.46/deps/slug.ts";
Converts a string into a valid slug
Examples
console.log(slug("some string")); // some-string
console.log(slug("some string", "_")); // some_string
console.log(slug("I ♥ UNICODE")); // I-love-UNICODE
console.log(slug("I ♥ UNICODE"), { lower: true }); // i-love-unicode
console.log(slug("some string")); // some-string console.log(slug("some string", "_")); // some_string console.log(slug("I ♥ UNICODE")); // I-love-UNICODE console.log(slug("I ♥ UNICODE"), { lower: true }); // i-love-unicode
slug("some ƒÚÑķÝ and ☢ string", {
replacement: "-",
remove: undefined,
lower: true,
strict: false,
locale: "vi",
trim: true,
extends: { "☢": "nuclear" },
}); // some-fUNkY-and-nuclear-string
slug("some ƒÚÑķÝ and ☢ string", { replacement: "-", remove: undefined, lower: true, strict: false, locale: "vi", trim: true, extends: { "☢": "nuclear" }, }); // some-fUNkY-and-nuclear-string