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 🙏

© 2024 – Pkg Stats / Ryan Hefner

routebar

v0.2.1

Published

A visual component for navigating between panel cells containing user content.

Downloads

150

Readme

documentation

A visual component for navigating between panel cells containing user content.

  • NPM npm install routebar.
  • Bower bower install routebar.

Examples

Build

To compile RouteBar by yourself:

  1. Clone the repository

    git clone https://github.com/nekqy/routebar.git

  2. Go inside the RouteBar folder that you fetched and install Node dependencies. I use Node v.5.11 because of node v.6 show me "fs: re-evaluating native module sources is not supported".

    cd routebar && npm install

  3. Run npm run build to generate the JS and CSS files in the dist folder. Also it generates jsdoc in the docs/jsdoc folder.

    npm run build

  4. Run npm run test to run tests and generate coverage in the docs/coverage folder.

    npm run test

User Guide

Add an element with class 'rb-wrapper' to your page. 'data-id' or 'id' attribute contains name of adding panel.

$('body').html('' +
'<div style="position: fixed; left: 100px; top: 100px; width: 300px; height: 300px;">' +
'<div id="rb1" class="rb-wrapper"></div>' +
'</div>');

Create an instance of the content model (screen).

var screen = new rb.Screen('<div style="width: 100%; height: 100%; background: #6af;">some markup</div>');

Run the panel initialization.

The default content model is not specified, so by default the first created model will be taken. It will be added to the panel as the start model.

rb.start();

The panel is already initialized inside the callback function and you can additionally configure it.

rb.start(function() {...});

For example, 'maxHistoryLength' option configured. All options you can found here.

var f = function(){
    rb.Instances.rb1.configure({maxHistoryLength: 5});
}
rb.start(f);

Make the connections between the models and then you can navigate between these models in the panel.

var screen2 = new rb.Screen('<div style="width: 100%; height: 100%; background: #fa6;">some markup</div>');
screen.pushChild(screen2);

You can also configure start model for the panel, when calling panel initialization.

rb.start({ rb1: screen2 }, f);

License

MIT

About

RouteBar is developed by Andrey Shipin.

Bugs & contributing

Please report bugs via GitHub. Feel free to submit commit pull-request, even the tiniest contributions to the script or to the documentation are very welcome.