Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 29, 2024 via pnpm

slugify 1.6.6

Slugifies a String
Package summary
Share
0
issues
1
license
1
MIT
Package created
5 Feb 2013
Version published
26 Mar 2023
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
slugify@1.6.6
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of slugify 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does slugify do?

The slugify npm package is a handy utility tool in JavaScript ES2015 that is used to convert strings into URL-friendly slugs. With slugify, you can convert a string like "Some String" into a hyphen-separated, URL-safe string e.g. "some-string". The module is free from dependencies, and compatible with both browser and AMD module loaders. Notably, the module also features a coercion function that translates foreign symbols into their English equivalent.

How do you use slugify?

The usage of slugify is incredibly straightforward. First, ensure that the package installed in your system through npm. If you don't have it, you can use npm install slugify to add it to your project. Then require it into your file using var slugify = require('slugify'). Once this has been done, you can then convert any string to a URL-friendly format by calling the slugify function and passing in the string as an argument. Here's a quick example:

var slugify = require('slugify');
console.log(slugify('Some String')); // Output: some-string

If you prefer a character other than a hyphen as the separator, you can specify it as the second argument:

var slugify = require('slugify');
console.log(slugify('Some String', '_')); // Output: some_string

You can also leverage various options such as replacement character, removal of certain patterns, case conversion among others, like so:

slugify('Some String', {
  replacement: '_',    
  remove: /[*+~.()'"!:@]/g,    
  lower: true,              
  strict: true,            
  locale: 'en',        
  trim: true        
});

Where are the slugify docs?

You can get more information on how to use slugify, its options, and further details about the package in the official GitHub repository (https://github.com/simov/slugify). The repo contains comprehensive documentation on the package usage, including additional package options and methods such as how to remove certain characters from the slug, or how to extend the charMap with custom symbols. Always make sure to refer to this docs page for an up-to-date guide on the correct usage of slugify and its features.