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

dp1-js

v2.0.0

Published

Node.js SDK for the DP-1 protocol, ported from dp1-go with a TypeScript stack.

Readme

dp1-js

Lint Test

Node.js SDK for the DP-1 protocol, kept intentionally dependency-light.

Overview

dp1-js provides parsing, validation, canonicalization, hashing, and signing helpers for DP-1 playlists, playlist groups, ref manifests, and Feral File channel documents.

It is designed for Node.js 22+ and ships dual ESM/CJS entrypoints through the package root.

Features

  • Parse and validate DP-1 playlist, playlist-group, ref manifest, and channel documents.
  • Canonicalize signing payloads using RFC 8785-style JSON canonicalization.
  • Compute and verify payload hashes and Ed25519 signatures.
  • Merge display preferences with DP-1 resolution order.

Install

npm install dp1-js

Quick Start

Parse and validate a playlist

import { ParseAndValidatePlaylist } from 'dp1-js';

const rawPlaylist = JSON.stringify({
  dpVersion: '1.0.0',
  title: 'Example Playlist',
  items: [
    {
      source: 'https://example.com/artwork.html',
    },
  ],
});

const playlist = ParseAndValidatePlaylist(rawPlaylist);

console.log(playlist.title);

Parse and validate a channel

import { ParseAndValidateChannel } from 'dp1-js';

const rawChannel = JSON.stringify({
  id: 'channel-123',
  slug: 'example-channel',
  title: 'Example Channel',
  version: '1.0.0',
  created: '2025-01-01T00:00:00Z',
  playlists: ['https://example.com/playlist-1.json'],
});

const channel = ParseAndValidateChannel(rawChannel);

console.log(channel.title);

Sign and verify a playlist

import { signDP1Playlist, verifyPlaylistSignature } from 'dp1-js';

const rawPlaylist = JSON.stringify({
  dpVersion: '1.0.0',
  title: 'Example Playlist',
  items: [
    {
      source: 'https://example.com/artwork.html',
    },
  ],
});

const privateKey = '0x...';
const publicKey = Buffer.from('...');

const signature = signDP1Playlist(rawPlaylist, privateKey);

verifyPlaylistSignature(rawPlaylist, signature, publicKey);

console.log(signature);
console.log('Signature verified');

API Notes

  • parseDP1Playlist(json) returns a { playlist, error } result for already-parsed JSON input.
  • ParseAndValidatePlaylist(data) and ParseAndValidateChannel(data) accept raw JSON as Buffer or string.
  • signDP1Playlist(raw, privateKey) returns an ed25519:... signature string.
  • verifyPlaylistSignature(raw, signature, publicKey) throws if verification fails.
  • ParseDPVersion(version) is available for version parsing and major-version checks.

Repo Layout

The repository keeps a familiar module structure in JS:

  • src/playlist
  • src/playlistgroup
  • src/refmanifest
  • src/merge
  • src/sign
  • src/jcs
  • src/extension/*

Development

npm install
npm run lint
npm run type-check
npm test

Requirements

  • Node.js 22+
  • npm for dependency installation

Notes

  • This rewrite is intentionally dependency-light.