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 🙏

© 2025 – Pkg Stats / Ryan Hefner

coh-content-db

v2.0.0-rc.16

Published

City of Heroes Content Database

Readme

coh-content-db

GitHub Actions Workflow Status Codecov GitHub Tag NPM Version GitHub License

City of Heroes Content Database

Change Log

CHANGELOG.md

Installation

npm install coh-content-db

Usage

There are two ways to use this package; As a data provider, or a db consumer.

As a data provider

Data providers utilize the various -Data interfaces provided in this package to construct content bundles that can be loaded into the db for consumption by DB consumers such as Badger.

For an example data package, see the coh-content-db-homecoming project.

Defining archetypes, zones, badges, etc.

To define content, create a new instance using the appropriate Data interface and provide values for the required fields:

///test-badge.ts
import { BadgeData } from 'coh-content-db'

export const TestBadge: BadgeData = {
    key: 'test-badge',
    type: 'achievement',
    name: [{ value: 'Test Badge' }, { alignment: 'praetorian', value: 'My Badge for Praetorians' }],
    releaseDate: '2020-03-01',
    alignment: ['hero', 'praetorian'],
}

Then, create a BundleData instance and load your content into the appropriate field.

import { BundleData } from 'coh-content-db'

export const MyBundle: BundleData = {
    header: { name: 'My Content Bundle', version: '1.0.0', lastUpdateTime: '2025-04-21T00:00:00Z' },
    badges: [TestBadge],
}

Markdown and Links

Fields with long text values can typically accept Markdown format. These fields will also be typed with the tag type MarkdownString.

Within markdown, you can construct a link to a badge or zone using the special badge:// and zone:// protocol indicators that consumer apps can use to provide runtime links or tooltips. This replaces the custom [badge:xyz] format from v1 and data packages will need to update accordingly.

To create a link, use the standard Markdown link format, with the url as following:

This is a link to the [Ghoulish](badge://ghoulish) badge.

There are convenience functions also provided to construct the URI automatically that can be used as follows:

import { badgeLink, badgeUri } from 'coh-content-db'

const uri = `This is a link to the [Ghoulish](${badgeUri('ghoulish')}) badge.`
// This is a link to the [Ghoulish](badge://ghoulish) badge.
const link = `This is a link to the ${badgeLink('ghoulish')} badge.`
// This is a link to the [ghoulish](badge://ghoulish) badge.

As a DB consumer

Create a new database instance from a content bundle, such as coh-content-db-homecoming:

import { CohContentDatabase } from 'coh-content-db'
import { HOMECOMING } from 'coh-content-db-homecoming'

const database = new CohContentDatabase(HOMECOMING)

or from a JSON object:

import { BundleData, CohContentDatabase } from 'coh-content-db'

const response = await fetch('https://n15g.github.io/coh-content-db-homecoming/bundle.json')
const bundle = await response.json() as BundleData

const database = new CohContentDatabase(bundle)

Access the content

for (const badge of db.badges) {
    console.log(badge.key)
}

Release

  1. Determine the next Semantic Release version, i.e. 2.0.0-rc.16
  2. Update the version and release notes in the CHANGELOG.md.
    • Commit with the comment Changelog <semver>
  3. npm version <semver> - Updates the package.json and commits + tags new version. Use semver syntax for version number.
  4. npm run push - Push the commit and tags to remote.
  5. GitHub will release automatically.

Tags matching the pattern v<X>.<Y>.<Z> will attempt to publish to npm (this can only be achieved by the package manager (n15g). The npm version command automatically prepends the v prefix to the version number.

npm version 1.4.x
npm run push