Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.33 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.33 KB

routee

NPM version Build Status Coverage percentage

The last router you'll ever need.

Installation

npm install routee

Usage

import {registerRoute, createURL, dispatch} from "routee";

const fooRoute = registerRoute('foo', ['id', 'name'], ({id, name}) => {
    // this is the route executor
});

// create an URL from a route and its parameters
createURL(route, {
    id: '1',
    name: 'Bob'
});

// dispatch a location
const dispatchedRoute = dispatch('foo/bar/id/1/name/lorem');

API

Read the documentation for more information.

Contributing

  • Fork the main repository
  • Code
  • Implement tests using tape
  • Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue

License

Apache-2.0 © Eric MORAND