npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

conglomerate-history

v2.0.3

Published

cross-browser history management

Downloads

4

Readme

NPM version Build Status

conglomerate-history

cross-browser history management

Documentation

History

src/index.js:22-364

Extends EventEmitter

Handles cross-browser history management, based on either pushState and real URLs, or onhashchange and URL fragments. If the browser supports neither.

_updateHash

src/index.js:354-363

Update the hash location, either replacing the current entry, or adding a new one to the browser history.

Parameters

checkUrl

src/index.js:245-257

Checks the current URL to see if it has changed, and if it has, calls loadUrl, normalizing across the hidden iframe.

Parameters

decodeFragment

src/index.js:62-64

Unicode characters in location.pathname are percent encoded so they're decoded for comparison. %25 should not be decoded since it may be part of an encoded parameter.

Parameters

Returns string decoded fragment

getFragment

src/index.js:108-118

Get the cross-browser normalized URL fragment from the path or hash.

Parameters

Returns string normalized url fragment

getHash

src/index.js:84-87

Gets the true hash value. Cannot use location.hash dir in Firefox where location.hash will always be decoded.

Parameters

  • window object the global window or History instance

Returns string

getPath

src/index.js:95-100

Get the pathname and search params, without the root.

Returns string pathname and search params

getSearch

src/index.js:72-75

In IE6, the hash fragment and search params are incorrect if the fragment contains ?.

Returns string

loadUrl

src/index.js:266-278

Attempt to load the current URL fragment. If a route succeeds with a match, fires 'change' event.

Parameters

matchRoot

src/index.js:48-52

Does the pathname match the root?

Returns boolean

navigate

src/index.js:293-344

Save a fragment into the hash history, or replace the URL state if the 'replace' option is passed. You are responsible for properly URL-encoding the fragment in advance.

The options object can contain trigger: true if you wish to have the route callback be fired (not usually desirable), or replace: true, if you wish to modify the current URL without adding an entry to the history.

Parameters

start

src/index.js:127-201

Start the hash change handling, returning true if the current URL matches an existing route, and false otherwise.

Parameters

stop

src/index.js:208-231

Disable Backbone.history, perhaps temporarily. Not useful in a real app, but possibly useful for unit testing Routers.

License

conglomerate-history is released under the terms of the BSD-3-Clause license.

This software includes or is derivative of works distributed under the licenses listed below. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses.

  • Backbone is released under the terms of the MIT license.

Thanks

Thanks to Jeremy Ashkenas and the rest of the Backbone.js authors.