This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

proxy-string-parser
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

proxy-string-parser

Deprecated

Use native URL objects instead: https://developer.mozilla.org/en-US/docs/Web/API/URL.

Example:

const url1 = new URL('https://username:password@localhost:3000')
const url2 = new URL('https://localhost:3000')

console.log(url1.protocol, url1.username, url1.password, url1.hostname, url1.port)
console.log(url2.protocol, url2.hostname, url2.port)

Introduction

Parsing strings of the following formats:

protocol://username:password@host:port
protocol://host:port
username:password@host:port
host:port

To the Proxy object:

interface Proxy {
  host: string
  port: number
  auth?: {
    username: string
    password: string
  }
  protocol?: string
}

TypeDoc documentation is available on wiki.

Install

npm install proxy-string-parser

Usage

import proxyStringParser from 'proxy-string-parser'

const proxy = proxyStringParser('protocol://username:password@host:80')
console.log(proxy)

Readme

Keywords

Package Sidebar

Install

npm i proxy-string-parser

Weekly Downloads

106

Version

3.0.2

License

MIT

Unpacked Size

4.69 kB

Total Files

8

Last publish

Collaborators

  • vladislav-puzyrev
  • vladpuz