This package has been deprecated

Author message:

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

@lbzg/url-parse
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

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

Package Sidebar

Install

npm i @lbzg/url-parse

Weekly Downloads

2

Version

4.0.2

License

ISC

Unpacked Size

93 kB

Total Files

7

Last publish

Collaborators

  • lbzg