JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 30
  • Score
    100M100P100Q58866F
  • License MIT

window.location.hash parser and make life easier

Package Exports

  • hashget

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hashget) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hashget

window.location.hash parser and make life easier

Installation

Install via npm

npm install hashget

Install via yarn

yarn add hashget
 import {HashGet} from 'hashget'
 window.location.hash = "#empty&test=100"

 var locHash = new HashGet();

 var count = locHash.getCount()
 console.log(count) // 2

 var has = locHash.has('test')
 console.log(has) // true

 var has = locHash.has('empty')
 console.log(has) // true

 var value = locHash.getValue('test')
 console.log(value) // 100

 var value = locHash.getValue('empty')
 console.log(value) // undefined
 

Development & Testing

Since we did not want to mess with bundlers for such small library, Comment this line in index.js in order to run test

//export {HashGet}

Chrome only

npm run test

or

yarn test

All browsers including IE and Safari

npm run test:all

or

yarn test:all

We ❤️ NPM and Yarn