New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@lbzg/url-parse

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lbzg/url-parse

Js url parsing library.

latest
Source
npmnpm
Version
4.0.2
Version published
Maintainers
1
Created
Source

Javascript library for parsing URLs.
w/ type declarations

Installation & Usage

npm i @lbzg/url-parse
const { purl } = require('@lbzg/url-parse')

const p1 = purl('https://igor@xyz.com:3337/part1/asdf/bubble.html?name=qwe#overview')

# p1.scheme = 'https',
# p1.authority = 'igor@xyz.com:3337',
# p1.user = 'igor',
# p1.host = 'xyz.com',
# p1.port = '3337',
# p1.path = '/part1/asdf/bubble.html',
# p1.pathArray = [ 'part1', 'asdf', 'bubble.html' ],
# p1.query = 'name=qwe',
# p1.queryObject = { name: 'qwe' },
# p1.fragment = 'overview'

const p2 = purl('/part1/asdf/bubble.html?name=qwe')

# p2.scheme = '',
# p2.authority = '',
# p2.user = '',
# p2.host = '',
# p2.port = '',
# p2.path = '/part1/asdf/bubble.html',
# p2.pathArray = [ 'part1', 'asdf', 'bubble.html' ],
# p2.query = 'name=qwe',
# p2.queryObject = { name: 'qwe' },
# p2.fragment = ''

Prototype

purl(url) - returns parsed object

parsed object properties:
scheme, authority, user, host, port, path, pathArray, query, queryObject, fragment

References

lbzg/validate

Keywords

parse

FAQs

Package last updated on 24 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts