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

summoner

v0.2.0

Published

A caching http requester for consuming APIs on the server.

Readme

Summoner

A caching http requester for consuming APIs on the server.

What it is

Summoner will get data from a server, parse it, cache it for a configurable length of time, and hand it back off to you as many times as you like until it expires.

Summoner is not yet battle-hardened, so any error reports or pull requests are welcomed.

How to use it

summoner(opts || url, callback)

The callback receives (err, response).

var summoner = require('summoner');
summoner('http://jsonplaceholder.typicode.com/posts/1', (err, json) => {
  console.log(json) // All that wonderful JSON data, pre-parsed, as often as you like, almost guilt-free!
})

summoner({url: 'http://www.google.com/humans.txt', type: "text"}, (err, raw) => {
  console.log(raw) // Raw, fierce, unedited text!
})

The current options and defaults are as follows:

maxAttempts: 5

This is how many times summoner will try to get the data from the server before giving up and returning an error.

type: 'application/json'

The type of data we're getting, and the sort of processing that needs doing. This should get expanded over time. At the moment, anything other than 'application/json' or 'json' will get returned as plain text. Alternatively, you may add your own processing function by registering it with summoner:

  summoner.register('myType', (body) => { /*do stuff, then return it.*/ } )
  summoner({url: 'www.example.com', type: 'myType'}, callback)

ttl: 60*60 (one hour)

Time To Live, how long in seconds the cache will keep ahold of the parsed data before fetching again from the server.

auth: undefined

Auth is an object, currently only useful for basic auth. The format is as follows:

{
  "user": "username",
  "pass": "password"
}

What it's made of

Node-cache makes up the backbone of the beast, while the fabulous and extensive request library is its sinews. The summoner's resolve is tested with the slim and deceptive http-server, and its wit is measured with tape.