@smflow/seo-slug
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Generate SEO friendly slug with @smflow/seo-slug

seo-slug is a utility package to generate human readable and SEO friendly slug for blog post, eCommerce site and more.

This is a blog title -> this-is-a-blog-title12345

Try this online

Installation

To use is you need to install it, run this command in your terminal to install it:

npm install @smflow/seo-slug

Using

This is a simple package which exports a function called genSlug to generate the slug. So import the function

import { genSlug } from "@smflow/seo-slug"

generate the slug by calling genSlug function

const slug = genSlug("This is a blog title to generate slug");
console.log(slug); // this-is-a-blog-title-to-generate-slug1234

Options

  • text The text for converting slug. Ex genSlug("Text to convert");
  • len This len for generated slug length. Ex genSlug("Text to convert", 7); -> text-to

Package Sidebar

Install

npm i @smflow/seo-slug

Weekly Downloads

3

Version

0.1.0

License

MIT

Unpacked Size

7.48 kB

Total Files

13

Last publish

Collaborators

  • smflow