Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

urlhash

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlhash

A simple library for reading and writing parameters to the URL hash.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by36.46%
Maintainers
1
Weekly downloads
 
Created
Source

urlhash

A simple library for reading and writing parameters to the URL hash.

Installation

You can install with npm install urlhash and include with var urlHash = require('urlhash').

For basic use in the browser, you can simply include urlHash.js and use urlHash().getUrlHashParameter(param) as below.

Usage

urlHash.getUrlHashParameter(param)

returns the value of the named url hash parameter, so bar from example.com#foo=bar

urlHash.getUrlHashParameters()

returns all url hash parameters in an object, so {foo: 'bar', bibim: 'bap'} from example.com#foo=bar&bibim=bap

urlHash.setUrlHashParameter(param, value)

sets the value of the named url hash parameter, so example.com#foo=bar from setUrlHashParameter('foo', 'bar')

urlHash.setUrlHashParameters(params)

sets all url hash parameters in a passed object, so example.com#foo=bar&bibim=bap from {foo: 'bar', bibim: 'bap'}

FAQs

Package last updated on 18 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc