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

module-details

v2.0.1

Published

Give it the name of an npm module and get tons of up-to-date details about it. Useful for things like building static documentation sites that reference npm modules.

Readme

module-details

Give it the name of an npm module and get tons of up-to-date details about it. Useful for things like building static documentation sites that reference npm modules.

Turns out, getting JSON about a package from npm is super simple, for example just open this in a browser: http://registry.npmjs.org/slugger

So, this module returns everything you can see there. Plus a few more goodies...

You'll notice that JSON includes the readme, which is awesome! But, if you actually want to render it into a template for a site somewhere you likely want to do a bit more with that readme.

So, what it does it this:

  • Optionally, removes the first header an attaches it to that module data as a title property (npm modules have a name, but no pretty, properly capitalized titles)
  • Hides anything in your readme between <!-- starthide --> and <!-- endhide --> comments you include in your markdown.
    • This is useful for, say, adding a link to the readme saying where the full docs site is.
    • Or hiding other stuff
  • You can also tell it to always hide sections with a certain title. For example, you may be doing this for lots of repos, to merge into a single site and you always want to hide a section in those readmes if they start with license.
  • Creates a property called toc that it built from the headings in your readme. it includes their text content, heading-level, as well as a link text that can be used to embed an anchor to that corresponding heading.
  • Turns all your headings into github-style headings where you hover and they're links to themselves.

install

npm install module-details

example

var getModuleDetails = require('module-details');

// you don't have to send it anything other than a callback
getModuleDetails('slugger', function (err, moduleInfo) {
    // error or moduleInfo
});

// available options and their default settings
var options = {
    sectionsToRemove: [],
    hideFirstHeading: true
};

// you pass options as a second argument
getModuleDetails('slugger', options, function (err, moduleInfo) {
    // error or moduleInfo
});

credits

If you like this follow @HenrikJoreteg on twitter.

license

MIT