Skip to content

Repository files navigation

Provides some tools for avoiding starvation in a game named after the task.

Use

Live version - foodguide.bluehexagons.com

github.io - bluehexagons.github.io/foodguide/

Running Offline

This Food Guide must be run on a web server for most browsers to properly open it. With NodeJS installed, an easy way to run this offline is:

npm install
npm run dev

Using the defaults, it should become accessible locally in a browser at 127.0.0.1:8080/index.htm.

Desktop version (foodguide-app)

The foodguide-app repository has source code and release builds for a thin Electron wrapper around this project.

Development

Pull requests and bug reports are greatly appreciated if anything is out of sync with Don't Starve's current versions.

The Unofficial Don't Starve Food Guide is a collection of JavaScript/HTML/CSS files. Install the project dependencies with npm install, install the Playwright Chromium used by the browser smoke test with npx playwright install chromium, then run npm run dev to serve html/ on a local web server so that the JavaScript modules can be loaded by a web browser.

Run npm run check to verify formatting, linting, types, and tests. Use npm run format and npm run lint:fix to apply the project’s automatic fixes.

Reusing the data and helpers in other projects

The food, recipe, and mode-handling modules are pure ES modules with no runtime dependencies and can be imported from Node, Deno, Bun, or any bundler-using web project. After installing this package (e.g. as a git dependency), the public entry points are:

// Everything except DOM helpers
import { food, recipes, modes, AND, NAME, matchesMode } from 'foodguide';

// Or import individual modules
import { food } from 'foodguide/food';
import { recipes, updateFoodRecipes } from 'foodguide/recipes';
import * as constants from 'foodguide/constants';
import { matchesMode, calculateModeMask } from 'foodguide/mode-utils';
import { AND, OR, NAME, TAG } from 'foodguide/functions';

// Browser-only DOM helpers
import { makeImage, makeLinkable } from 'foodguide/utils';

The data tables in food and recipes are the same objects the live tool uses — see html/food.js and html/recipes.js for shape documentation.

Translations

UI strings emitted from JavaScript are centralised in html/strings.js, and static HTML strings are translated via data-i18n="key", data-i18n-html="key", and data-i18n-attr-NAME="key" attributes. Built-in locales live in html/locales/ (currently en, es, and zh); the es and zh translations were generated by Anthropic Claude Opus and have not yet been reviewed by native-speaking Don't Starve players — corrections via PR are welcome.

Adding a locale:

import { registerLocale, setLocale } from 'foodguide/strings';

registerLocale('fr', 'Français', {
	pause: 'Pause',
	resume: 'Reprendre',
	// ...partial overrides; missing keys fall back to English.
});

setLocale('fr');

Names of foods, recipes, characters, and DLCs are intentionally left untranslated for now — those should be sourced from the game itself rather than re-translated by hand.

Contributors

bluehexagons rezecib levy9527 brewingcode agathasilva28 6lancmange lakhnishMonster lormico VaingloriousReptile

About

The Unofficial Don't Starve Food Guide and Crock Pot Simulator

Topics

Resources

Stars

116 stars

Watchers

4 watching

Forks

Sponsor this project

Used by

Contributors

Languages