Skip to content

ravvis/parse-location-hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-location-hash

Parse location hash/fragment to object.

Install

npm i parse-location-hash

Usage

import locationHashParser from "parse-location-hash";

// window.location.hash : "#access_token=testToken&token_type=bearer"
const hash = locationHashParser(window.location.hash);

// hash: { access_token: "testToken", token_type: "bearer" }
const { access_token } = hash;

localStorage.setItem("token", access_token);

About

Utility to parse location hash/fragment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published