Skip to content

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

License

Notifications You must be signed in to change notification settings

awesomeorganization/hyperlink

Repository files navigation

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:[email protected]: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',
})

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published