Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Suzan-Dev/slugifi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slugifi

version downloads license

Slugifi is small package for creating a slug from a string.

Alert

I forgot my npm account password and can't login. so, I can't release a new version to fix a TypeScript issue. TypeScript users should copy declare module 'slugifi' and put it in a file named index.d.ts inside node_modules/slugifi folder. And this package is no longer maintained.

Release Notes (v1.0.7)

You can now remove special characters from string by enabling specialChars property from the options.

Installation

Npm :

$ npm install slugifi

Yarn :

$ yarn add slugifi

Pnpm :

$ pnpm add slugifi

Usage

ES6 :

import slugifi from 'slugifi';

slugifi('Random text'); // Outputs: random-text

CommonJS :

const slugifi = require('slugifi');

slugifi('Random text'); // Outputs: random-text

Options

slugifi('some text', {
  separator: '_', // defaults to '-'
  capitalize: true, // defaults to false
  specialChars: false, // defaults to true
});

License

MIT