An open API service indexing awesome lists of open source software.

https://github.com/brunolm/uri-sharp

Parse an URI and return an object. Similar to .NET Uri class.
https://github.com/brunolm/uri-sharp

Last synced: 3 months ago
JSON representation

Parse an URI and return an object. Similar to .NET Uri class.

Awesome Lists containing this project

README

        

# uri-sharp

Install

```
npm i -S uri-sharp
```

TypeScript definitions included.

## Example

```js
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',
});
```