0.6.3-alpha.0 • Published 9 years ago

myro v0.6.3-alpha.0

Weekly downloads
108
License
BSD-3-Clause
Repository
github
Last release
9 years ago

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({
    '/': {
        name: 'index'
    },

    '/users': {
        name: 'users',
        routes: {
            '/:name': {
                name: 'user'
            }
        }
    },

    '/about': {
        name: 'about'
    }
})

// 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.

0.6.3-alpha.0

9 years ago

0.6.2

10 years ago

0.6.1

10 years ago

0.6.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago