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

koa-camino

v0.0.2

Published

router for koa

Downloads

9

Readme

koa-camino

NPM version Build status Test coverage Dependency Status License

Koa router

Installation

$ npm install name

Seting up a router

var koa = require('koa'),
    Camino = require('koa-camino').Camino,
    Step = require('koa-camino').Step;
var app = koa();
var router = new Camino();

/* Configure router */

app.use(router.route);

Configre using steps

A Step can contain : A segment (of the url path)

var seg = new Step({segment: 'seg'});

A parameter : corresponding to a some aritrary string in the url path

var seg = new Step({parameter: 'param'});

A HTTP method and an action to be processed

var step = new Step({method: 'GET', action: function*(next){}});

A composition of the last three

var step = new Step({segment: 'seg', parameter: 'param', method: 'GET', action: function*(next){}});

If a step contains a segment and a parameter, it corresponds to a path containing the segment first and then the parameter

Link steps to build an arboresence corresponding to the routes :

parentStep.append(step);

Returns the parent step to allow to chain 'append' calls

Configure the router with the step root of the arboresence

router.addStep(users);

'addStep' calls are chainabe

Configure using routes

Using a more classical way, without arborescence...

router.addRoute('POST /users/:id/get', function*(next){});

'addRoute' calls are chainabe

License

MIT