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

hash-brown-router

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-brown-router - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

2

index.js

@@ -8,4 +8,2 @@ var pathToRegexp = require('path-to-regexp-with-reversible-keys')

function noop() {}
module.exports = function Router(opts, hashLocation) {

@@ -12,0 +10,0 @@ var emitter = new EventEmitter()

2

package.json
{
"name": "hash-brown-router",
"version": "3.0.0",
"version": "3.0.1",
"description": "A client-side router that only cares about the bits after the #",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,2 +12,25 @@ # hash-brown-router

# Example
```js
var router = require('hash-brown-router')()
var mainElement = document.getElementById('main')
router.add('/', function() {
mainElement.innerHTML = 'Thank you for visiting my site! This is the home screen.'
})
router.add('/blog-post/:blogPostName', function (parameters) {
mainElement.innerHTML = getHtmlForBlogPost(parameters.blogPostName)
})
router.on('not found', function (path, querystringParameters) {
alert('Couldn\'t find that page, sorry! Redirecting you to the home screen.')
router.location.replace('/')
})
router.evaluateCurrent('/')
```
# API

@@ -14,0 +37,0 @@

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