@nathanfaucett/layer

0.0.4 • Public • Published

layer

A router layer for the browser and node.js

var Layer = require("@nathanfaucett/layer");


var parent = new Layer("/parent/:parent_id{[0-9]+}", null, true),
    child = new Layer("/child/:id{[0-9]+}(.:format{\\w+})", parent, true);

parent.match("/parent/1") === {
    parent_id: "1"
};
child.match("/parent/1/child/1") === {
    parent_id: "1",
    id: "1"
};

Readme

Keywords

Package Sidebar

Install

npm i @nathanfaucett/layer

Weekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

5.76 kB

Total Files

9

Last publish

Collaborators

  • nathanfaucett