New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

slugify-string

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slugify-string

Slugify a string for use in a URL

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

Slugify Sring

Slugify a string for use in a URL.

yarn add slugify-string

Usage

import slugify from 'slugify-string';

const title = 'How to Publish & Update a Package';
slugify(title);
// -> 'how-to-publish-and-update-a-package'

Custom whitelist

You can pass a custom whitelist to ensure certain characters are not transformed. In the following example .s are kept.

import slugify from 'slugify-string';

const title = 'React v16.3.0: New lifecycles and context API';
slugify(title, /[^a-z0-9.]/g);
// -> 'react-v16.3.0-new-lifecycles-and-context-api'

FAQs

Package last updated on 10 Apr 2018

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