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

dankomaconv

v0.1.2

Published

Converters for producing DankomaJSONL data.

Downloads

488

Readme

dankomaconv.js

Converters for producing DankomaJSONL data.

Installation

As a library:

npm install dankomaconv

For the command-line tools, install globally:

npm install -g dankomaconv

You can also run them directly with npx:

npx dankomaconv

Command-line tools

dankomaconv.js provides several command-line converters. Most of them read input from stdin and write DankomaJSONL to stdout.

| Command | Description | | ---------------- | ------------------------------------ | | bili2dankoma | Convert Bilibili danmaku data | | nico2dankoma | Convert NicoNico danmaku data | | ytchat2dankoma | Convert YouTube live chat data | | legacyfix | Convert/fix legacy DankomaJSONL data | | bilidanmafetch | Fetch Bilibili danmaku directly |

Basic usage

Most converters follow this pattern:

X2dankoma < source > dankoma.jsonl

For example:

bili2dankoma < danmaku.bin > dankoma.jsonl
nico2dankoma < danmaku.json > dankoma.jsonl
ytchat2dankoma < chat.json > dankoma.jsonl

legacyfix works the same way:

legacyfix < old.jsonl > dankoma.jsonl

Because the converters use standard input and output, they can also be chained with other Unix tools:

cat source.dat | bili2dankoma | legacyfix > dankoma.jsonl

bilidanmafetch

bilidanmafetch is different: it fetches the danmaku from Bilibili directly instead of reading from stdin.

bilidanmafetch <vid> [page] > dankoma.jsonl

The default page is 1:

bilidanmafetch BV1kx411c7UF > dankoma.jsonl

To fetch a specific page of a multipart video:

bilidanmafetch BV1kx411c7UF 3 > dankoma.jsonl

Authentication is provided through the BILI_COOKIE environment variable.

It must contain a SESSDATA cookie:

export BILI_COOKIE='SESSDATA=...; bili_jct=...'

Then:

bilidanmafetch BV1kx411c7UF > dankoma.jsonl

Logs are written to stderr, while the generated DankomaJSONL is written to stdout. This means it is safe to redirect or pipe the output:

bilidanmafetch BV1kx411c7UF > dankoma.jsonl

or:

bilidanmafetch BV1kx411c7UF | gzip > dankoma.jsonl.gz

Output format

All converter commands produce DankomaJSONL on stdout.

Each line represents one danmaku record.


I'd probably put this **above the existing documentation link section or immediately after it**, because the README now answers the "what the fuck do I actually run?" question without making users dig through `doc/doc.md`.