Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

slugify-url

1.2.0 • Public • Published

Converts urls to simplified strings

Build Status

Synopsis

slugify-url maps urls to a sanitized string that can be used as a filename and serves as a good mnemonic of the original url even though it is not reversible

Description

  • It skips the protocol and user/password if provided part from the URL (http:// or https:// or ://:@ )
  • It maps slashes to !
  • Unless a unixOnly option is given it maps all windows invalid chars to !
  • It collapses multiple !'s to a single !
  • It omits ending !'s
  • It truncates the URL to 100 chars
  • It includes an optional options argument that allows the user to override the behavior
    • slashchar char used to replace slashes - default !
    • maxlength default 100
    • skipprotocol default true
    • skipuserpass default true

For example

Installation

npm install slugify-url

install

npm i slugify-url

Downloadsweekly downloads

211

version

1.2.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability