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

shoeshine

v0.3.0

Published

Widget framework

Downloads

20

Readme

Shoeshine

Widget framework

Wiki

Reference

Npm package

Shoeshine serves as the basis of building a modular, and event-driven view-controller layer for front end applications based on troop for OOP, sntls for data structures, and evan for universal events.

For a set of common widgets (labels, buttons, dropdowns, forms) based on shoeshine, look into candystore.

The Widget class implements a life cycle, plus incorporates a number of traits that augment its behavior:

  • evan.Evented so that widget instances may trigger and capture events on themselves
  • sntls.Documented so that widget classes may have class names assigned, and instances unique instance IDs
  • sntls.Managed so that widget instances may be stored in and retrieved from a global registry
  • shoeshine.Progenitor so that widget instances may be arranged in a parent-children relation
  • shoeshine.Renderable so that widgets may be rendered into the DOM

In order to implement your own widget classes, subclass shoeshine.Widget. Make sure to supply a class name to .extend(), as Widget overrides troop.Base.extend() to make it more widget-specific. The class name will end up on the new widget class as static property (.className), as well as a CSS class name on the markup generated for its instances.

var MyWidget = shoeshine.Widget.extend('MyWidget')
    .addPublic({
        contentTemplate: '<div class="child-container"></div>'.toMarkupTemplate()
    })
    .addMethods({
        init: function () {
            // initialize instance properties, add non-volatile child widgets
            // eg. this one will end up in the specified container in the markup
            OtherWidget.create()
                .setContainerCssClass('child-container')
                .addToParent(this);
        },

        afterAdd: function () {
            base.afterAdd.call(this);
            // (re-)initialize state, subscribe to events
        },

        afterRemove: function () {
            base.afterRemove.call(this);
            // clean up state, unsubscribe from events
        },

        afterRender: function () {
            base.afterRender.call(this);
            // start animations, subscribe to DOM events
        }
    });

To use the widget, simply set it as a root widget, or add it as a child to a widget already existing in the hierarchy.

MyWidget.create().setRootWidget();

or,

MyWidget.create().addToParent(parentWidget);

Sample code

To see shoeshine in action, check out Hills.