New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

pull-routes

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-routes

Match routes with a pull stream

latest
Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

pull routes

Handle routes with a pull stream. In the browser it will listen for click events that are local to the server and automatically pipe the urls to the router. In node or the browser, you can set the route by calling .push with a url string.

Under the hood it uses routes. See the docs for route matching info.

install

$ npm install pull-routes

example

var S = require('pull-stream')
var Router = require('pull-routes')
var router = Router()
var routeStream = router([
    ['/', function () {
        return 'root path'
    }],
    ['/foo/:i', function (params) {
        return 'foo path ' + params.i
    }]
])

S(
    routeStream,
    S.log()
)

routeStream.push('/')
routeStream.push('/foo/1')

/* 
{
  params: {},
  splats: [],
  route: '/',
  fn: [Function],
  next: [Function]
}
*/


/*
{
  params: { i: '1' },
  splats: [],
  route: '/foo/:i',
  fn: [Function],
  next: [Function]
}
*/

Keywords

routes

FAQs

Package last updated on 07 Dec 2016

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