Socket
Socket
Sign inDemoInstall

wayfarer

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wayfarer - npm Package Compare versions

Comparing version 2.0.0 to 2.1.1

2

index.js

@@ -44,3 +44,3 @@

return match.node.cb()
return match.node.cb(match ? match.param : {})
}

@@ -47,0 +47,0 @@

{
"name": "wayfarer",
"version": "2.0.0",
"version": "2.1.1",
"description": "A simple router built for minimalism and speed",

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

@@ -38,5 +38,4 @@ # wayfarer

#### .on(path, cb)
Register a new path. Partial paths are supported through the `/:` operator.
Wayfarer uses a trie structure to match routes, so the order in which routes are
registered does not matter.
Register a new path. Wayfarer uses a trie to match routes, so the order in
which routes are registered does not matter.
```js

@@ -47,2 +46,9 @@ router.on('/', () => console.log('do stuff'))

Partial paths are supported through the `/:` operator, and the callback
provides a param object. With a route like `/:user` if you navigated to
`/somename`, you'd get a param object like this: `{ user: 'somename' }`.
```js
router.on('/:user', (param) => console.log('do user stuff', param.user))
```
#### .match(path)

@@ -49,0 +55,0 @@ Match a path against the saved paths in the router. If a match is

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