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

widgster

v1.0.0

Published

jQuery plugin that provides an easy way to handle basic widget functions like collapsing, closing, ajax-refreshing & fullsreening

Readme

Widgster

Small jQuery plugin that provides an easy way to handle basic widget functions like collapsing, closing, ajax-refreshing & fullsreening.

Demo

Advanced Demo

Use

To apply all these features to your default widget you have to add appropriate links (or buttons) to it:

<section class="widget">
    <header>
        <h3>Header</h3>
        <div class="widget-controls">
            <a data-widgster="load" href="#">Reload</a>
            <a data-widgster="expand" href="#">Expand</a>
            <a data-widgster="collapse" href="#">Collapse</a>
            <a data-widgster="fullscreen" href="#">Fullscreen</a>
            <a data-widgster="restore" href="#">Restore</a>
            <a data-widgster="close" href="#">Close</a>
        </div>
    </header>
    <div class="widget-body">
        Body
    </div>
</section>

In the example above links are put into a .widget-controls but you can put them anywhere inside of widget.

Then widgster needs to be initialized via javascript:

$('.widget').widgster();

As you could guess data-widgster attribute defines widget action to be performed when link is clicked.

Actions

  • close - closes the widget;
  • collapse - collapses (minimizes) the widget. An element holding this data attribute will be hidden when widget gets expanded;
  • expand - expands the widget. An element holding this data attribute will be hidden when widget gets collapsed;
  • fullscreen - fullscreens the widget. An element holding this data attribute will be hidden when widget gets restored;
  • restore - restores the widget back to its position. An element holding this data attribute will be hidden when widget gets fullscreened;
  • load - reloads widget content from the url provided with data-widget-load attribute.

All actions may be called via js:

$('.widget').widgster('close');

Options

  • collapsed - if true collapses widget after page load;
  • fullscreened - if true fullscreens widget after page load;
  • bodySelector - widget body selector. Used for loading and collapsing. Default is .body;
  • load - an url to fetch widget body from. Default is undefined;
  • showLoader - whether to show a loader when ajax refresh performed. Default is true;
  • autoload - whether to automatically perform ajax refresh after page load. May be set to an integer value. If set, for example, to 2000 will refresh the widget every 2 seconds. Default is false;
  • closePrompt(callback) - a function to be called when closing. Closing is only performed when callback is called.

Widgster accepts an object with options:

$('.widget').widgster({
    collapsed: true
});

Events

Each action fires both before and after event. Events have the same names as actions. Before event may be canceled.

For example, to make refresh button spin:

$('.widget').on("load.widgster", function(){
    $(this).find('[data-widgster="load"] > i').addClass('fa-spin')
}).on("loaded.widgster", function(){
    $(this).find('[data-widgster="load"] > i').removeClass('fa-spin')
});