0.0.4 • Published 10 years ago

aquaduck v0.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

aquaduck

What

Aquaduck aims to duplicate/replace the routing functionality in beeline but in a standalone module.

Why

Sometimes I want beeline's routing, but not all it's serving stuff.

Usage

var aquaduck = require('aquaduck');

At the moment aquaduck only supports one kind of route matching:

var routes = {
        'foo.com/`thing`/`stuff`': function(tokens){
            tokens.thing === 'majigger';
            tokens.stuff === 'whatsits';
        }
    };

var matchedRoute = aquaduck(routes, 'foo.com/majigger/whatsits');

matchedRoute will contain .value .tokens, and .route, so you can use it to run the function:

matchedRoute.value(matchedRoute.tokens);

Other beeline-like routing will be added in the future.

Why is aquaduct spelt incorrectly.

aquaduct is taken on npm, aquaduck is funny.

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago