// readme

clash-of-clans-data

A comprehensive, fully-typed Node.js package containing all Clash of Clans game data as structured JSON with TypeScript types and image assets, consumable as an ESM or CJS npm package.


Features

  • Complete game data โ€” defenses, troops, spells, heroes, equipment, pets, traps, walls, buildings, leagues, and more for all three bases (Home Village, Builder Base, Clan Capital)
  • Fully typed โ€” every entity has a precise TypeScript interface; no any, no guessing
  • Fluent query API โ€” chainable namespace methods with filtering, lookup by TH level, damage type, and more
  • Image assets included โ€” every building level ships with its PNG, accessible via relative path
  • Dual ESM + CJS โ€” works in both modern ESM projects and legacy CommonJS

Requirements

  • Node.js >= 24
  • pnpm (for development)

Installation

npm install clash-of-clans-data
# or
pnpm add clash-of-clans-data

Quick Start

import { builder, clan, clanCapital, home } from "clash-of-clans-data";

// Home Village โ€” single building
const cannon = home().defenses().cannon().first()!;
console.log(cannon.name); // "Cannon"โ€ฆ