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

uriname

0.1.1 • Public • Published

URI Name Build Status

URI Name is a simple package that will take a generic string and produce a string that is safe to use as a URI component.

Usage

$ npm install uriname
var uriname = require('uriname')
 
//normal title
var title = 'My Fancy Title'
var uri = uriname(title)
console.log(uri) //my-fancy-title
 
//user input
var title = 'Something 0=&*(&) reaLLy c*(*)()l'
var uri = uriname(title)
console.log(uri) //something-0-really-c-l
 
//process multiples easily
var titles = ['Something Neat','Really Nice']
var uris = uriname(titles)
console.log(uris) ['something-neat','really-nice']
 
//enjoy!

Changelog

0.1.1

  • Initial release

0.1.0

  • Initial release

install

npm i uriname

Downloadsweekly downloads

26

version

0.1.1

license

none

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability