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

details.js

v1.4.0

Published

She ate a whole box of chocolates that night.

Readme

details.js

Built to leverage Handlebars templates and JSON datasets. Improved animations and scrolling performance with Velocity. Responsive aware

Coded with care and love.

Demos

Multiple panels on top Single panel between rows Single panel replacing grid

Getting Started

Install using bower, or download project archive.

$ bower install --save details.js

# dependencies
$ bower install --save handlebars
$ bower install --save velocity
$ bower install --save imagesloaded # use imagesloaded.pkgd.min.js

Usage

$(function() {
    var collection = $('.selector').details(
        // extend default settings
    );
});

Default Settings

{
    dataset: {},                // JSON dataset to be compiled by Handlebars
    fadein: true,               // fade in on imagesloaded callback
    fadeinSpeed: 800,           // fade in speed in milliseconds
    panel: {
        classes: "",            // additional CSS classes to be added to panel element
        position: "top",        // "top", "between rows" or "over grid"
        stacked: true,          // allow stacking of multiple panels (boolean)
        speed: 400,             // animation speed (int)
        delay: 100,             // open panel delay (int)
        easing: {
            open: "ease-out",   // animation easing "ease-in", "ease-out" or "linear"
            close: "ease-out"   // animation easing "ease-in", "ease-out" or "linear"
        },
    },
    scroll: {
        offset: 0,              // scroll top offset (int)
        speed: 600,             // scroll speed in milliseconds (int)
        easing: "ease-out"      // scroll easing "ease-in", "ease-out" or "linear"
    },
    onInit: $.noop,             // function() { do something };
    onOpen: $.noop,             // …
    onClose: $.noop,            // …
    onComplete: $.noop,         // …
    onStart: $.noop,            // …
    onEnd: $.noop               // …
}

HTML data-attributes

Add any of these data attributes to elements in your template. (Optional)

data-role="close"               <!-- close panel -->
data-role="previous"            <!-- previous -->
data-role="=next"               <!-- next -->

<!-- example -->
<a href="#" data-role="close">Close</a>

Callbacks and Public Methods

onInit

onInit: function() {}           // called after grid template has been compiled

onOpen

onOpen: function() {}           // called before transition starts

onClose

onClose: function() {}          // called before transition starts

onComplete

onComplete: function(event) {} // called after transition ends
                               // event: "open", "close"

onStart

onStart: function() {}          // called on first item view

onEnd

onEnd: function() {}            // called on last item view

Calling methods programmatically

.close(element, callback);      // @param: dom panel element, or undefined
                                // @param: callback fn
.open(element);                 // open panel, @param: dom grid element
// example using .close() method
var collection = $('.selector').details();

$('.selector').on('click', function(event) {
    event.preventDefault();
    collection.close(undefined, function() {});
});

// example using .open() method
var collection = $('.selector').details();

$(window).on('load', function() {
    var element = $("figure:nth-child(2)");
    collection.open(element);
});

Handlebars Templates

Handlebars provides the power necessary to build semantic templates effectively with no frustration. If you are not familiar with Handlebars, complete details can be found here.

Grid

Class item is the only required class name below.

<script data-role="grid" type="text/x-handlebars-template">
    {{#each items}}
        <figure class="item"> <!-- figure or div tag -->
            <!-- be creative -->
        </figure>
    {{/each}}
</script>

Panel

<script data-role="panel" type="text/x-handlebars-template">
    <!-- be creative -->
</script>

JSON Dataset

The panel template uses the same dataset “context” as grid template. They are “connected” based on index position.

{
    "items": [
        // The data structure is entirely up to you.
        { "key": "value", … },
        { "key": "value", … }
        …
    ]
}

CSS

/* required (don’t forget to add browser prefix) */
.selector                { display: flex; flex-flow: row wrap; }
.selector .panel         { width: 100%; position: relative; overflow: hidden; }

/* optional */
.selector .item          { }
.selector .on            { }
.selector .disabled      { }

Dependencies

Browser Support

License

This software is free to use under the MIT license.