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

slug

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slug - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

2

package.json
{ "name": "slug"
, "description": "slugifies even utf-8 chars!"
, "version": "0.4.2"
, "version": "0.5.0"
, "homepage": "https://github.com/dodo/node-slug"

@@ -5,0 +5,0 @@ , "author": "dodo (https://github.com/dodo)"

@@ -7,2 +7,3 @@ # [slug](https://github.com/dodo/node-slug)

- respecting [RFC 3986](https://tools.ietf.org/html/rfc3986)
- Comprehensive tests

@@ -20,14 +21,18 @@ - No dependencies (except the unicode table)

```bash
master//node-slug » node
> slug = require ('./slug')
> slug('i ♥ unicode')
'i-love-unicode'
> slug('i ♥ unicode', '_') # If you prefer something else then `-` as seperator
'i_love_unicode'
> slug.charmap['♥'] = 'freaking love' # change default charmap or use option {charmap:{…}} as 2. argument
> slug('I ♥ UNICODE').toLowerCase() # If you prefer lower case
'i-freaking-love-unicode'
> slug('unicode ♥ is ☢') # yes!
'unicode-love-is-radioactive'
```javascript
var slug = require('slug')
var print = console.log.bind(console, '>')
print(slug('i ♥ unicode'))
// > i-love-unicode
print(slug('unicode ♥ is ☢')) // yes!
// > unicode-love-is-radioactive
print(slug('i ♥ unicode', '_')) // If you prefer something else then `-` as seperator
// > i_love_unicode
slug.charmap['♥'] = 'freaking love' // change default charmap or use option {charmap:{…}} as 2. argument
print(slug('I ♥ UNICODE').toLowerCase()) // If you prefer lower case
// > i-freaking-love-unicode
```

@@ -34,0 +39,0 @@

@@ -36,3 +36,3 @@ (function (root) {

}
char = char.replace(/[^\w\s$\*\_\+~\.\(\)\'\"\!\-:@]/g, ''); // allowed
char = char.replace(/[^\w\s\-\.\_~]/g, ''); // allowed
result += char;

@@ -131,2 +131,2 @@ }

}(this));
}(this));

Sorry, the diff of this file is not supported yet

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