Giter VIP home page Giter VIP logo

urlifyr's Introduction

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

Option Type Default Remark
accept String - Additional characters to be accepted.
whiteSpace String - The replacement for white spaces.
special String EMPTY The replacement for not accepted characters.
lowerCase Boolean true When true forces the output to be lower-case.
trim Boolean true When true removes duplicated replacements.
sz Boolean true When 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! ๐Ÿ™

Credits

This project is a fork from Urlifyjs by Daniel Emod Kovacs.

The original project seems not to be mainteined anymore, since it was last updated 6 years ago (as of May 10th, 2022).

urlifyr's People

Contributors

rogeriotaques avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.