enfluent-url
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Description

This package provides an URL parser based on the async-option package. The classes are immutable and caching their stringified representations.

Examples

Url.parse('https://usr:psw@example.net:1234/path/to/file?a=b&c=d#fragment')
    .onBoth(console.log)

// Output:
// Url {
//   _escaped: null,
//   _unescaped: 'https://usr:psw@example.net:1234/path/to/file?a=b&c=d#fragment',
//   protocol: 'https',
//   canHaveAuthority: true,
//   userInfo: UrlUserInfo {
//     name: 'usr',
//     _escaped: null,
//     _unescaped: 'usr:psw',
//     password: 'psw'
//   },
//   endpoint: Endpoint {
//     address: DnsAddress {
//       chunks: [Array],
//       _escaped: null,
//       _unescaped: 'example.net'
//     },
//     _escaped: null,
//     _unescaped: null,
//     port: 1234
//   },
//   path: UrlPath {
//     segments: [ 'path', 'to', 'file' ],
//     _escaped: null,
//     _unescaped: '/path/to/file'
//   },
//   query: UrlQuery {
//     data: { a: 'b', c: 'd' },
//     _escaped: null,
//     _unescaped: 'a=b&c=d',
//     _isEmpty: null
//   },
//   fragment: 'fragment'
// }

Readme

Keywords

Package Sidebar

Install

npm i enfluent-url

Weekly Downloads

0

Version

1.0.0

License

none

Unpacked Size

51.6 kB

Total Files

22

Last publish

Collaborators

  • retueze