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

cdb-to-json

v2.0.0

Published

CLI-first Yu-Gi-Oh! Card Ingestion Tool

Readme

cdb-to-json

cdb-to-json converts EDOPro/YGOPro-compatible CDB (SQLite) databases into JSON on macOS, Linux, and Windows. It requires Node.js 22 or later.

Quick start

npm install cdb-to-json

# Lossless database envelope (the default profile)
npx cdb-to-json convert cards.cdb > cards.raw.json

# Client-friendly card catalog
npx cdb-to-json convert cards.cdb --profile card > cards.json

# YGO-DSL source documents with simulator provenance
npx cdb-to-json convert cards.cdb --profile source > source.json

Run cdb-to-json --help for the current command and option reference.

Commands

| Command | Purpose | | --- | --- | | convert [inputs...] | Convert CDB input to JSON or JSONL. | | inspect [inputs...] | Print database metadata without emitting cards. | | validate [inputs...] | Validate CDB input structure. | | schema <profile> | Print a JSON Schema. Use raw, card, source, card-array, or source-array. |

Output profiles

| Profile | Output | Schema | | --- | --- | --- | | raw (default) | One lossless CDB database envelope | cdb.raw/1 | | card | One client-friendly record per card | cdb.card/2 | | source | One YGO-DSL source document per card, including CDB provenance | ygo.card-source/1 |

Both JSON and JSONL are supported. JSON emits an array for card and source; JSONL emits one card or source document per line.

card and source currently accept exactly one input database and write to stdout or a single --output file. They do not support --merge or --split.

Output destinations

All profiles can write to stdout or a file:

npx cdb-to-json convert cards.cdb --profile card --output cards.json
npx cdb-to-json convert cards.cdb --profile source --format jsonl --output source.jsonl

The raw profile additionally supports one file per input database:

npx cdb-to-json convert ./databases --profile raw --split database --output ./out

--split database requires a new output directory. Raw conversion does not support --merge or --split card.

--force replaces an existing file output. Directory output is never replaced.

Useful options

--profile raw|card|source       Select an output profile (default: raw)
--format json|jsonl             Select output encoding (default: json)
--output, -o <path>             Write to a file or directory instead of stdout
--locale, -l <tag>              Declare source-text locale
--source-namespace <name>       Namespace for card external IDs (default: konami)
--pretty                        Pretty-print JSON output
--force                         Replace an existing file output
--max-rows <n>                  Limit rows per table
--max-text-bytes <n>            Limit text-cell size
--max-output-bytes <n>          Limit output size

Platform support

The normal reader and output paths use portable Node filesystem operations and work on macOS, Linux, and Windows. Linux-only descriptor-relative hardening is optional; it is not required for conversion or file output.

Legacy API

The v1-compatible default export remains available for existing users:

import legacyConvert from "cdb-to-json/legacy";

const tables = await legacyConvert("./databases", "./output", {
  emit: true,
  ignore: [],
});

Development

npm ci
npm run build
npm test
npm run lint
npm run package:check

Design record

ADR-0001: Restore portable conversion records why the portable paths are the default.

License

ISC