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

slugg

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slugg

Make strings url safe (with no dependencies)

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14K
increased by54.87%
Maintainers
1
Weekly downloads
 
Created
Source

Slugg

Make strings url-safe.

  • Comprehensive tests
  • No dependencies
  • Not in coffee-script (lol)
  • Coerces foreign symbols to their english equivalent
  • Doesn't try to do anything fancy with symbols (just removes them)
npm install slugg

Usage:

slug(string, [separator])

var slug = require('slugg')

slug('My fantastic blog post')
//-> 'my-fantastic-blog-post'

slug('Today I found £5')
//-> 'today-i-found-5'

slug('I ♥ you')
//-> 'i-you'

If you want a separator other than '-', pass it in as the second argument:

slug('Kevin Spacey', ' ')
//-> 'kevin spacey'

Keywords

FAQs

Package last updated on 03 Dec 2012

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