JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q34006F
  • License MIT

[ESM] The hyperlink constuctor according to rfc1738, rfc1808, rfc2396, rfc3986 and whatwg. Works with Browser and Node.js

Package Exports

  • @awesomeorganization/hyperlink

Readme

hyperlink

💥 [ESM] The hyperlink constuctor according to rfc1738, rfc1808, rfc2396, rfc3986 and whatwg. Works with Browser and Node.js


npm npm npm npm npm npm


Example

import { hyperlink } from '@awesomeorganization/hyperlink'

// The following examples creates the same link
// http://user:pass@example.com:8080/blah?blah=blah#blah

hyperlink({
  auth: 'user:pass',
  hash: '#blah',
  host: 'example.com:8080',
  path: '/blah?blah=blah',
  protocol: 'http:',
})

hyperlink({
  hash: '#blah',
  hostname: 'example.com',
  password: 'pass',
  pathname: '/blah',
  port: '8080',
  protocol: 'http:',
  search: '?blah=blah',
  username: 'user',
})

hyperlink({
  hash: '#blah',
  hostname: 'example.com',
  password: 'pass',
  pathname: '/blah',
  port: '8080',
  protocol: 'http:',
  query: 'blah=blah',
  username: 'user',
})