This package has been deprecated

Author message:

Moved to: @mapbox/link-to-location

link-to-location

0.1.0 • Public • Published

link-to-location

Convert a link (HTMLAnchorElement or URL) to an abbreviated Location object.

Usage

This module provides a single function which accepts either an HTMLAnchorElement or URL string and returns an object with three properties: pathname, hash, and seach.

Example Usage:

const linkToLocation = require('link-to-location');
 
linkToLocation('http://user:pw@foo.bar.baz/qux?quux=grault#fred');
/*
  {
    pathname: 'foo.bar.baz/qux',
    hash: '#fred',
    search: '?quux=grault'
  }
*/

Readme

Keywords

none

Package Sidebar

Install

npm i link-to-location

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators

  • johnfurrow