Skip to content

ajoslin/url-parse-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-parse-auth Build Status

Parse the password and user out of a url. Do in one step what would take two steps and a string.split with require('url').

Install

$ npm install --save url-parse-auth

Usage

var urlParseAuth = require('url-parse-auth')

urlParseAuth('https://user:pass@baz.com')
//=> {user: 'user', pass: 'pass'}

API

urlParsePassword(url) -> {user, password}

Both user and password will be undefined if the url has no auth section.

License

MIT © Andrew Joslin

About

Parse the password and user out of a url. Do in one step what would take two steps and a string.split with require('url').

Resources

License

Stars

Watchers

Forks

Packages

No packages published