Gathering detailed insights and metrics for slugify
Gathering detailed insights and metrics for slugify
Gathering detailed insights and metrics for slugify
Gathering detailed insights and metrics for slugify
@sindresorhus/slugify
Slugify a string
url-slug
Slug generator with less than 1 KB and no dependencies, RFC 3986 compliant
transliteration
Unicode to ACSII transliteration / slugify module for node.js, browser, Web Worker, ReactNative and CLI.
helper-slugify
Convert strings into URL slugs.
npm install slugify
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,664 Stars
212 Commits
132 Forks
8 Watchers
1 Branches
39 Contributors
Updated on Jul 13, 2025
Latest Version
1.6.6
Package Id
slugify@1.6.6
Unpacked Size
20.36 kB
Size
8.50 kB
File Count
6
NPM Version
6.14.17
Node Version
14.20.0
Published on
Mar 26, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
1var slugify = require('slugify') 2 3slugify('some string') // some-string 4 5// if you prefer something other than '-' as separator 6slugify('some string', '_') // some_string
1slugify('some string', { 2 replacement: '-', // replace spaces with replacement character, defaults to `-` 3 remove: undefined, // remove characters that match regex, defaults to `undefined` 4 lower: false, // convert to lower case, defaults to `false` 5 strict: false, // strip special characters except replacement, defaults to `false` 6 locale: 'vi', // language code of the locale to use 7 trim: true // trim leading and trailing replacement chars, defaults to `true` 8})
For example, to remove *+~.()'"!:@
from the result slug, you can use slugify('..', {remove: /[*+~.()'"!:@]/g})
.
remove
is a regular expression, it should be a
character class
and only a character class. It should also use the
global flag.
(For example: /[*+~.()'"!:@]/g
.) Otherwise, the remove
option might not
work as expected.remove
is a string, it should be a single character.
Otherwise, the remove
option might not work as expected.The main charmap.json
file contains all known characters and their transliteration. All new characters should be added there first. In case you stumble upon a character already set in charmap.json
, but not transliterated correctly according to your language, then you have to add those characters in locales.json
to override the already existing transliteration in charmap.json
, but for your locale only.
You can get the correct language code of your language from here.
Out of the box slugify
comes with support for a handful of Unicode symbols. For example the ☢
(radioactive) symbol is not defined in the charMap
and therefore it will be stripped by default:
1slugify('unicode ♥ is ☢') // unicode-love-is
However you can extend the supported symbols, or override the existing ones with your own:
1slugify.extend({'☢': 'radioactive'}) 2slugify('unicode ♥ is ☢') // unicode-love-is-radioactive
Keep in mind that the extend
method extends/overrides the default charMap
for the entire process. In case you need a fresh instance of the slugify's charMap
object you have to clean up the module cache first:
1delete require.cache[require.resolve('slugify')] 2var slugify = require('slugify')
charmap.json
npm test
index.js
and will sort the charmap.json
Originally this was a vanilla javascript port of node-slug.
Note that the original slug module has been ported to vanilla javascript too.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 13/23 approved changesets -- score normalized to 5
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More