0.0.1 • Published 6 years ago

@atto/parse-uri v0.0.1

Weekly downloads
4
License
-
Repository
github
Last release
6 years ago

Parses URIs.

Running

const parseUri = require('parse-uri'); // npm install @atto/parse-uri

const path = 'hello/there?opt=1#sectionA';

console.log(parseUri(path));
console.log(parseUri('https://example.org/'+path));

prints

{ origin: null,
  pathname: '/hello/there',
  search: '?opt=1',
  hash: '#sectionA' }
{ origin: 'https://example.org',
  pathname: '/hello/there',
  search: '?opt=1',
  hash: '#sectionA' }