Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bustle/slugify

Package Overview
Dependencies
Maintainers
22
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bustle/slugify

Slug all our things into slugs

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by466.67%
Maintainers
22
Weekly downloads
 
Created
Source

bustle slugify

Build Status

This is how you slug our things.

[1:04 PM]  zeejab the truth is within you reconbot
[1:04 PM]  reconbot so users is id first, articles and posts is id last
[1:05 PM]  steve articles is also id first
[1:06 PM]  zeejab everything new is id last, what steve said

This module just uses the slugify module from npm and adds some minor bustle-specific adjustments.

Api

Everything new should be id last, use the function for your named item. This module will be updated as we transition all routes.

slug(string) -> slug

Slug any string

assert.equal(slug('a generic string'), 'a-generic-string')

slugUser(user:{id!, name}) -> slug

assert.equal(slugUser({ id: 1, name: 'Penny Dog' }), 'penny-dog-1')
assert.equal(slugUser({ id: 2 }), '2')

slugPost(post:{id!, title}) -> slug

assert.equal(slugPost({ id: 1, title: 'My Great Post!' }), 'my-great-post-1')
assert.equal(slugPost({ id: 1, title: 'This and That!' }), 'this-that-1')
assert.equal(slugPost({ id: 2 }), '2')

slugArticle(article {id!, title})} -> slug

The only data type where the slug is id first.

assert.equal(slugArticle({ id: 1, title: 'My Great Post!' }), '1-my-great-post')
assert.equal(slugArticle({ id: 1, title: 'This and That!' }), '1-this-that')
assert.equal(slugArticle({ id: 2 }), '2')

Keywords

FAQs

Package last updated on 06 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc