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 🙏

© 2024 – Pkg Stats / Ryan Hefner

subhub

v0.0.5

Published

simple pubsubhubbub client

Downloads

7

Readme

subhub

subhub is a simple node.js interface for subscribing to a pubsubhubbub hub. subhub includes a library for integrating into your existing node.js servers, as well as a simple command line tool for debugging hub output.

using the api

subhub provides a simple library for integrating a subhub connection into your existing node.js, connect, or express http servers.

installation

$ npm install subhub

usage

to use the api, you simply need to configure a subhub instance, tell your server to use it's request handler, and create a subscription. a simple example of this follows.

http = require('http')
subhub = require('subhub')
server = do http.createServer

# configure a subhub instance
firehose = new subhub
  'url': ''
  'subscription':
    'hub.mode': 'subscribe'
    'hub.verify': 'sync'
    'hub.callback': ''
    'hub.topic': ''

# set up the http handlers
server.on 'request', firehose.requestListener
server.listen 8000

# 'data' fires for each document sent by the hub
firehose.on 'data', (doc) ->
  console.log doc

# send a subscription request
# (once subscribed, the hub will begin sending data)
do firehose.subscribe

using the client

a command line client is provided which simply creates up a subscription and writes all incoming hub entries to stdout. this is the quickest way to see all the data being sent by the hub. the client uses nconf, allowing you to configure the subscription through command line arguments, environment variables, or flat files (with that order.

installation

$ npm install -g subhub

usage

$ subhub --help
Usage: subhub 

Arguments:
  -h, --help                    Help. You're looking at it
  -c, --config                  Config file                                      [./config.json]
  --http.port                   Port to run the http server on                   [80]
  --hub.url                     The url of the hub you are subscribing to
  --hub.subscription.mode       Request mode                                     [subscribe]
  --hub.subscription.verify     Hub verification mode                            [sync]
  --hub.subscription.callback   Your callback URL the hub will send data to
  --hub.subscription.topic      The feed url of the topic you are subscribing to

$ subhub --hub.url=http://yourhub --hub.subscription.topic=http://yourhub/topic --hub.subscription.callback=http://yourhost/callback
[stream of messages]