npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fission-router

v0.0.6

Published

A declarative layer on top of react-router with some other nice-to-haves

Readme

fission-router NPM version Downloads Support us Build Status Coveralls Status

Information

Usage

Install

npm install fission-router --save

Example

var Router = require('fission-router');

var appRouter = Router({
  // Route = /
  splash: {
    path: '/',
    view: SomeReactComponent
  },
  // Route = /login
  login: {
    path: 'login',
    view: SomeReactComponent
  },
  // Route = /home
  home: {
    path: 'home',
    view: SomeReactComponent,

    // Route = /home, this is activated when no other children are
    defaultChild: {
      view: SomeReactComponent
    },

    // Route = /home/asdf, this is activated when there is a child path segment
    // but no children were activated
    childNotFound: {
      view: SomeReactComponent
    },
    children: {
      // Route = /home/statistics, this is a subview of home
      stats: {
        path: 'statistics',
        view: SomeReactComponent
      },
      // Route = /home/job/123, this is a subview of home
      job: {
        path: 'job/:jobId',
        view: SomeReactComponent
      }
    }
  }
});

appRouter.start(document.body);

Differences

react-router is great but I don't like JSX and wanted a simpler API. This module provides a small wrapper that gives you the ability to provide an object with your route info instead of using JSX, renames a few things, and moves some stuff around.

Documentation

You should read the react-router documentation to get a full understanding of how this all works. This documentation is a very basic API overview of stuff that was changed.

Router(config[, options])

This returns a react router object, but with no .run. You can expect the same methods (transitionTo, replaceWith, etc.) that exist in react-router to exist on this object too.

Config format

The key of this object should be a unique name to describe the route.

  • path
    • Optional string describing the path needed to activate the route
    • Path is relative to the parent path
  • view
    • Required component function that you want rendered when the route is activated
  • default
    • If this is the default view or not. Useful when you have a set of children, where one is activated by default. If unspecified this value will be false.
  • children
    • optional object of child routes

If a route has no options that need to be specified then you can also just give the function like so:

children: {
  home: HomeView
}

which is just sugar for

children: {
  home: {
    view: HomeView
  }
}
Possible options

Router#start(renderNode)

Starts listening to changes and renders active view to the given renderNode. renderNode must be a valid HTML element.

var router = Router({
  // ... some route config
});
router.start(document.body);

Router#stop()

Stops listening for changes from the location implementation.

This will start, render, then stop the router.

var router = Router({
  // ... some route config
});
router.start(document.body);
router.stop();

Router.Link

This is wrapped in a createFactory for your sanity.

Pointer to react-router.Link

Router.ChildView

If you have a child route that is active, this is a component that represents that. This is wrapped in a createFactory for your sanity.

Pointer to react-router.RouteHandler

Router Locations

These are all location implementations from react-router

Router.locations.History

Uses HTML5 History API to provide location information. Pointer to react-router.HistoryLocation.

Router.locations.Hash

Uses URL Hashbangs to provide location information. Pointer to react-router.HashLocation.

Router.locations.Refresh

Uses full page refreshes. This is a fallback for when you don't want to use hashbangs (ugly) but you can't use the History implementation (browser support), you can use this. Pointer to react-router.RefreshLocation.

View Mixins

Router.mixins.State

Pointer to react-router.State.

Provides some utilities for getting the current state of the router from the view it is mixed into.

Router.mixins.Navigation

Pointer to react-router.Navigation.

Provides some utilities for linking to, triggering, and sending data to other routes to the view it is mixed into.

Server-side rendering

Is supported. Docs coming soon.

LICENSE

(MIT License)

Copyright (c) 2015 Fractal [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.