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

hypem-dl

v1.0.2

Published

Fetches music from Hype Machine

Downloads

14

Readme

hypem-dl

Fetches mp3 files from Hype Machine

Run as a CLI

Download up to 50 tracks at a time from Hype Machine. Use the page parameter to retrieve more than 50 tracks.

npx hypem-dl --slug popular

Options:

  • --destination DIRECTORY_PATH - Store files here (Default: user Downloads directory)
  • --page NUMBER - Starts at 1 (Default: 1)

Use in your codebase

Installation

npm install hypem-dl
# or yarn add hypem-dl

Download files

This will download up to 50 tracks as mp3 files to a local directory. Files are named ${artist} - ${title}.mp3. The only required parameter is the slug.

import { HypemDownloadArgs, hypemDownload } from "hypem-dl";

// Full list of arguments you can pass in
const args: HypemDownloadArgs = {
  // Which local folder to store the mp3 files (defaults to user home downloads folder)
  destination: "./data/";
  // "popular", "latest", or a username
  slug: "popular";
  // Which page to retrieve (starts at 1)
  page: 1;
  // HTTP User-Agent override
  userAgent: "USERAGENT";
  // HTTP Cookie override
  cookie: "COOKIE";
};
await hypemDownload({ slug: "popular" });

Progress reporting

Because we download sequentially, the promise exposes an onProgress function for responding to progress.

const promise = hypemDownload(args);
promise.onProgress((p) => {
  // `p` is a value from 0 to 1
  console.log(p);
});

Get URLs for MP3 files

This will return information for up to 50 tracks (e.g. artist, song title, and a streaming URL), leaving it up to you how to use the URLs. Use the second page parameter to retrieve more than 50 tracks.

import { TrackStatus, GetStreamUrlsArgs, getStreamUrls } from "hypem-dl";

// Full list of arguments you can pass in
const args: GetStreamUrlsArgs = {
  // "popular", "latest", or a username
  slug: "popular";
  // Which page to retrieve (starts at 1)
  page: 1;
  // HTTP User-Agent override
  userAgent: "USERAGENT";
  // HTTP Cookie override
  cookie: "COOKIE";
};
const results: TrackStatus[] = await getStreamUrls({ slug: "popular" });

Lint

yarn lint

As of now, this just runs prettier manually.

Misc

YouTube searches

We included a utility script for opening up a bunch of YouTube searches off the commandline.

For example, if you want to perform a YouTube search for every filename in in the current directory:

ls | node src/bin/youtube_search.cjs

This will automatically open the default browser. Once you have the YouTube URL you care about, you can use youtube-dl to download the media.

Please support Hype Machine!

Please consider donating to support this amazing team. I am not affiliated with the company, but I am a proud monthly supporter. I built this tool out of an enduring love for the product, as I've been using it almost daily for over 10 years now. Please keep doing what you're doing 💜💜💜