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

@dchighs/dc-config-mapper

v0.5.2

Published

A opined library to restructure and populate configuration for Dragon City.

Readme

@dchighs/dc-config-mapper

@dchighs/dc-config-mapper is a package for manipulating configuration data from the game Dragon City (this is not an official SocialPoint library; it is fan-made).

📦 Installation

Installation is straightforward; simply use your preferred package manager. Here is an example using NPM:

npm i @dchighs/dc-config-mapper @dchighs/dc-config @dchighs/dc-localization @dchighs/dc-core

You also need to install @dchighs/dc-config, @dchighs/dc-localization, and @dchighs/dc-core. These are set as peerDependencies, meaning the package requires them to function but will use the specific versions you have installed in your project.


🚀 Usage

Mapping Chests

import { Config, ConfigLangauge } from "@dchighs/dc-config"
import { ChestsMapper } from "@dchighs/dc-config-mapper"
import { Localization } from "@dchighs/dc-localization"

;(async () => {
	const userId = process.env.USER_ID
	const authToken = process.env.AUTH_TOKEN
	const url = process.env.URL

	const config = await Config.create({
		userId: userId,
		authToken: authToken,
		url: url,
	})
	
	const localization = await Localization.create(ConfigLangauge.Turkish)
	const chestsMapper = new ChestsMapper(localization)
	
	const { chests, rewards } = chestsMapper.map(config.data.game_data.config.chests)
	
	console.log({ chests, rewards })
})();

Mapping Items

import { ItemsMapper } from "@dchighs/dc-config-mapper"

// ...
	const itemsMapper = new ItemsMapper(localization)
	
	const items = itemsMapper.map(config.data.game_data.config.items)
	
	console.log(items)
})();

Mapping Heroic Races

import { HeroicRacesMapper } from "@dchighs/dc-config-mapper"

// ...
	const heroicRacesMapper = new HeroicRacesMapper(localization)
	
	const heroicRaces = heroicRacesMapper.map(config.data.game_data.config.heroic_races)
	
	console.log(heroicRaces)
})();

Mapping Maze Islands

import { MazeIslandsMapper } from "@dchighs/dc-config-mapper"

// ...
	const mazeIslandsMapper = new MazeIslandsMapper(localization)
	
	const mazeIslands = mazeIslandsMapper.map(config.data.game_data.config.maze_island)
	
	console.log(mazeIslands)
})();

Mapping Skills

import { SkillsMapper } from "@dchighs/dc-config-mapper"

// ...
	const skillsMapper = new SkillsMapper(localization)
	
	const skills = skillsMapper.map(config.data.game_data.config.skills)
	
	console.log(skills)
})();

Compiling Data

If you need to populate data for end-use, it is ideal to use the DataCompiler and provide the necessary context for data compilation:

import { DataCompiler } from "@dchighs/dc-config-mapper"

const dataCompiler = new DataCompiler({
	acceptedPrefixes: [
		"basic_",
		"trainable_",
		"top_",
		"middle_",
		"bottom_",
		"1_",
		"2_",
		"3_",
		"4_"
	]
})

Then, use it as follows:

const heroicRaces = heroicRacesMapper.map(config.data.game_data.config.heroic_races)
const skills = skillsMapper.map(config.data.game_data.config.skills)
const items = itemsMapper.map(config.data.game_data.config.items)

const compileContext = {
	laps: heroicRaces.laps,
	nodes: heroicRaces.nodes,
	missions: heroicRaces.missions,
	rewards: heroicRaces.rewards,
	attacks: skills.attacks,
	dragons: items.dragons
}

const firstIsland = heroicRaces.islands[0]

const finalData = dataCompiler.compile({
	data: firstIsland,
	context: compileContext,
})

console.log(finalData)

🤝 Contributing

  • Want to contribute? Follow these steps:
  • Fork the repository.
  • Create a new branch (git checkout -b feature-new).
  • Commit your changes (git commit -m 'Add new feature').
  • Push to the branch (git push origin feature-new).
  • Open a Pull Request.

📝 License

This project is licensed under the MIT License.