Skip to content
universal bidirectional microrouter
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
examples/react
src
test
.gitignore
.npmignore
.travis.yml
LICENSE
README.md
karma.conf.js
package.json
webpack.config.js

README.md

myro

Build Status

myro is a universal bidirectional micro-router.

It works with pure data and is only concerned with route matching. No assumptions are made on how to handle or dispatch a route match. Implementation of that logic is left to the user.

Getting Started

Installation

npm install myro --save

Example

import myro from 'myro'

const route = myro({
    '/users': {
        name: 'users',
        routes: {
            '/:name': {
                name: 'user'
            }
        }
    },

    '/about': {
        name: 'about'
    },

    '/': {
        name: 'index'
    },
})

// match routes...
route('/users/foo')) // {name: "users.user", params: {name: "foo"}, route: fn}
route('/about')) //  {name: "about", params: {}, ... }


// retrieve the path
route.users.user({name: 'foo'}) // "/users/foo"
route.about() // "/about"

Documentation

  • Introduction
  • Myro Examples (Coming Soon)
  • Myro React Examples (Coming Soon)

License

Copyright © 2016 Stefan Oestreicher and contributors.

Distributed under the terms of the BSD-3-Clause license.

You can’t perform that action at this time.