Skip to content

About

A library for interacting with difficulties in the EToH Joke Towers wiki.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Logo

EToH Joke Towers

An API for managing and interacting with the EToH Joke Towers Difficulty Chart. This package provides a structured way to define, organize, and retrieve difficulty levels, complete with metadata such as names, images, colors, and ratings.

Installation

npm install ejt

Usage

import Difficulty, { rgb } from "ejt-difficulty-chart";

const automatic = Difficulty.Automatic;
console.log(automatic.name); // "Automatic"
console.log(automatic.layoutRating); // -17
console.log(automatic.color); // { r: 214, g: 255, b: 186 }

const sameDifficulty = Difficulty.get("Automatic");
console.log(sameDifficulty === automatic); // true

const custom = new Difficulty("CustomDifficulty")
	.setName("Custom Difficulty")
	.setDescription("A locally defined difficulty.")
	.setVisualRating("42")
	.setLayoutRating(42)
	.setClass(1)
	.setColor(rgb(255, 0, 0))
	.setImage("https://example.com/custom.png");

Colours use 8-bit RGB channel values. The rgb helper validates each channel and returns an immutable plain object.

Development

Requires Node.js 18 or newer.

npm install
npm test

npm run build regenerates the difficulty data and compiles the library with the standard TypeScript compiler. The Python scraper in scraper/ is unchanged and can still be run independently.

License

MIT. See LICENSE.

About

A library for interacting with difficulties in the EToH Joke Towers wiki.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages