unfurl

0.1.0 • Public • Published

Unfurl.js npm Version Build Status Coverage Status

Extract the query string and hash of a URL.

Usage

unfurl('https://github.com/?foo&bar=42&baz=Hello#World');
/* =>
 * {
 *   query: {
 *     foo: true,
 *     bar: 42,
 *     baz: 'Hello'
 *   },
 *   hash: 'World'
 * }
 */

Values extracted (for both the query and hash) will be cast to a primitive type where possible. (See Stereotype.js.)

More usage examples are in the tests.

API

unfurl(url)

Returns an object containing the query and hash components of the given url string.

Installation

Install via npm:

$ npm i --save unfurl

License

MIT license

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    11
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    11

Package Sidebar

Install

npm i unfurl

Weekly Downloads

11

Version

0.1.0

License

MIT

Last publish

Collaborators

  • yuanqing