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

urlifyr

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

urlifyr

The simplest way to get an URL ready string.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

URILIFYR

The simplest way to get an URL ready string.

npm-version

Usage:


const urlifyr = require('urlifyr');
// or import urlifyr from 'urlifyr';

console.log(urlifyr('Hello World!'));
// outputs: hello-world

Usage with options


const urlifyr = require('urlifyr');
// or import urlifyr from 'urlifyr';

const cfg = {
  accept: '-',
  whiteSpace: '-',
  sz: true,
  special: '',
  lowerCase: true,
  trim: true,
}

console.log(urlifyr('Hello World!', cfg));
// outputs: hello-world

Supported options

OptionTypeDefaultRemark
acceptString-Additional characters to be accepted.
whiteSpaceString-The replacement for white spaces.
specialStringEMPTYThe replacement for not accepted characters.
lowerCaseBooleantrueWhen true forces the output to be lower-case.
trimBooleantrueWhen true removes duplicated replacements.
szBooleantrueWhen true replaces the German character Eszet with sz instead of ss.

Testing


$ yarn
$ yarn test

Contributions

Contributions are welcome. 🙇‍♂️

This package is made on my spare time. If you find something wrong or think there is something that can be improved, please feel free to submit a pull-requests with your contribution and I will review it and get back to you ASAP.

Thank you! 🙏

Keywords

url

FAQs

Package last updated on 09 May 2022

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