Skip to content

rpunkfu/url-buddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-buddy

Build Status codecov.io npm version Twitter Follow

forthebadge forthebadge

Install

λ yarn add url-buddy

Usage

import urlBuddy from 'url-buddy'

const parsedUrl = urlBuddy('https://github.com:32199/users/iggy#foo?bar=baz#qux')

parsedUrl.hash     // 'foo'
parsedUrl.host     // 'github.com:32199'
parsedUrl.hostname // 'github.com'
parsedUrl.pathname // '/users/iggy'
parsedUrl.port     // '32199'
parsedUrl.protocol // 'https'
parsedUrl.query    // { bar: 'baz', qux: true }
parsedUrl.url      // 'https://github.com:32199/users/iggy#foo?bar=baz#qux'
parsedUrl.valid    // true

License

MIT © rpunkfu