Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

achim-slug

1.0.4 • Public • Published

How to use

This package designed to help you to create simple slug, this tool converting your article title into readable slug and the number before your slug is get from minutes and seconds of new Date().

Install

>> npm i -S achim-slug

Example

at your Controllers

const newSlug = require('achim-slug');

var createData = (req, res) => {
  var myslug = newSlug(`${req.body.title}`)
  Thread.create({
    title: req.body.title,
    konten: req.body.konten,
    slug: myslug,
    author: req.body.author
  })
  .then(result => res.send(result))
  .catch(err => res.send(err))
}

Keywords

install

npm i achim-slug

Downloadsweekly downloads

3

version

1.0.4

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability