url-extract-auth

1.0.0 • Public • Published

node-url-extract-auth

NPM Package Build Status Coverage Status Dependency Status

Example

var extractAuth = require("url-extract-auth");
extractAuth("https://user221:deletethis@www.npmjs.com");
//"https://npmjs.com"

Installation

npm i url-extract-auth

API Reference

extractAuth(url, [authObject]) ⇒ string

Extract auth string from URL. If provided, sets values to auth object.

Kind: Exported function
Params

  • url string
  • [authObject] Object

Example

var authObject = {};
extractAuth("ftp://user221:deletethis@192.168.1.5/files", authObject);
//"ftp://192.168.1.5/files"
authObject
//{ username: "user221", password: "deletethis" }

License

MPL 2.0

Readme

Keywords

Package Sidebar

Install

npm i url-extract-auth

Weekly Downloads

0

Version

1.0.0

License

MPL-2.0

Last publish

Collaborators

  • vonthar