1.0.2 • Published 3 years ago

jslugify v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

What is this?

Slugify object and Return String, Yeah, You can make slugify using more than one value.

Installation

npm i jslugify --save

Then...

...

const {slugify} = require("jslugify")

//make slugify using one variable

let obj = {}

obj.productname =req.body.productname

slugify(obj) //return product-name

//Make slugify using two variable

let obj = {}

obj.firstname = req.body.firstname

obj.lastname = req.body.lastname

slugify(obj) //return firstname-lastname

//Both Options:

slugify(obj, lowercase="false", replacement="_") //jubair_pulak

...

Options

jslufigy supports 2 options, both of which are optional:

  • lowercase - __ By default it is true. But you can turn this into false, just set lowercase = false

  • replacement - __You can customize "-" this option to any other character through replacement parameter