uri-sharp
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

uri-sharp

Install

npm i -S uri-sharp

TypeScript definitions included.

Example

import parseUri from 'uri-sharp';
 
const uriText = 'http://www.codingwise.com/blog/?search=csharp#hash=net&ok=1';
const uri = parseUri(uriText);
 
assert.deepEqual(uri, {
  absolutePath: '/blog/',
  absoluteUri: uriText,
  authority: 'www.codingwise.com',
  hash: {
    hash: 'net',
    ok: '1',
  },
  hashString: '#hash=net&ok=1',
  host: 'www.codingwise.com',
  hostNameType: 'dns',
  isDefaultPort: true,
  originalString: uriText,
  pathAndQuery: '/blog/?search=csharp',
  port: 80,
  query: {
    search: 'csharp',
  },
  queryString: '?search=csharp',
  scheme: 'http',
});

Readme

Keywords

none

Package Sidebar

Install

npm i uri-sharp

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • brunolm