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

hype.js

v0.0.4

Published

Client-side JavaScript wrapper for The Hype Machine

Downloads

3

Readme

hype.js

Client-side JavaScript library to consume The Hype Machine feeds.

Hype Machine API

Initially I used the Hype Machine JSON API to create this module. The issue with this solution was that it wasn't possible to load tracks as the "key" to do so isn't returned by the JSON API. The current technique is to load the page required as you would in a browser and regex out the track JSON.

Install

This module is super easy to use. If used with browserify it can be required once you do a:

$ npm install hype.js --save

If used as a standalone JavaScript file it will bind to window.hypejs.

Usage

All functions take a callback which accepts two arguments similar to the Node.js callback style as shown:

var hypejs = require('hypejs');

hypejs.latest.all(2, function (err, res) {
  if (err) {
    // Something went wrong...
  } else {
    // res is a json object from the API
  }
});

The JSON returned looks as follows

{
	"page_cur": "/latest/1",
    "page_num": "1",
    "page_mode": "all",
	"page_name": "latest",
	"tracks": [{
		"thumb": "http://static-ak.hypem.net/thumbs_new/ba/2493114.jpg",
		"type": "normal",
		"id": "25dgh",
		"time": 203,
		"ts": 1405154222,
		"postid": 2493553,
		"posturl": "http://www.indieshuffle.com/the-mispers-rio/",
		"fav": 0,
		"favcount": "10"
		"key": "42f1806a636bbce6ab2d6129301100b1",
		"artist": "The Mispers",
		"song": "Rio",
		"is_sc": true,
		"is_bc": false
	}],
    "title": "Latest songs from music blogs worldwide / Hype Machine",
    "page_next": "/latest/2"
}

Provided Functions

latest

all

latest.all([page,] callback)

fresh

latest.fresh([page,] callback)

remixes

latest.remixes([page,] callback)

noRemixes

latest.noRemixes([page,] callback)

popular

now

popular.now([page,] callback)

lastweek

popular.lastweek([page,] callback)

remixes

popular.remixes([page,] callback)

noRemixes

popular.noRemixes([page,] callback)

artists

popular.artists([page,] callback)

noRemix

popular.noRemix([page,] callback)

profile

feed

profile.feed(name, [page,] callback)

loved

profile.loved(name, [page,] callback)

history

profile.history(name, [page,] callback)

obsessed

profile.obsessed(name, [page,] callback)