Socket
Socket
Sign inDemoInstall

aquaduck

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    aquaduck

Aquaduck aims to duplicate/replace the routing functionality in beeline


Version published
Maintainers
1
Install size
3.11 kB
Created

Readme

Source

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.

FAQs

Last updated on 31 Mar 2014

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc