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

wpageviews

v0.3.0

Published

Get wikipedia page view statistics for all pages in chosen category and subcategories

Readme

wpageviews

npm version Build Status

Simple module which helps to get monthly page views for wikipedia pages belonging to some category and all its subcategories using data from http://stats.grok.se.

Warning: statistics is collected for all subcategories of given category, so getting data for high-level categories might take long. There is a random delay (500 to 2000 ms) before each request to http://stats.grok.se. Queries to wikipedia API are also throttled by nodemw package.

You can get total page views for any period from 1 to 90 days. Note, however, that stats.grok.se returns values either for 30, 60 or 90 days. Data is then sliced to required period. This also means that getting page views for 31 days takes significantly longer than getting page views for 30 days.

Installation

npm install wpageviews --save

Usage

var PageViewsCollector = require('wpageviews')

var pageViewsCollector = new PageViewsCollector({
  lang: 'en',
  period: 7 //valid values are from 1 to 90
});

pageViewsCollector.getPageViews('Some category')
.then(function(pageViewsArray) {
  pageViewsArray.forEach(function(pageViews) {
    // Page title
    console.log(pageViews.title);

    // Array of categories reflecting the path to this page from root category
    // Note that these are not the categories of the page
    console.log(pageViews.categories.join());

    // Total page view for given period
    console.log(pageViews.views);
  });
});

Tests

npm test