@goodgamestudios/game-alias

Get and convert between game id’s and their various aliases

Usage no npm install needed!

<script type="module">
  import goodgamestudiosGameAlias from 'https://cdn.skypack.dev/@goodgamestudios/game-alias';
</script>

README

Game Aliases

Get and convert between game id’s and their various aliases

Motivation

Different aliases are used for games throughout code and documentation:

  • id’s, e.g. 12, 15, etc
  • names, e.g. bigfarm, empire, empiremillenniumwars, etc
  • codenames, e.g. ranch, castle, etc.
  • acronyms, e.g. em, bf, etc

This module provides functions that convert between ids and aliases, and vice versa.

Installation

npm add @goodgamestudios/game-alias

Usage

const {id, name, codename, acronym} = require('@goodgamestudios/game-alias')

id('bigfarm')   // ← 15
id('ranch')     // ← 15
id(15)          // ← 15

name(15)        // ← 'bigfarm'
name('bigfarm') // ← 'bigfarm'
name('ranch')   // ← 'bigfarm'

codename(15)        // ← 'ranch'
codename('ranch')   // ← 'ranch'
codename('bigfarm') // ← 'ranch'

acronym(15) // ← 'bf'
acronym('ranch') // ← 'bf'
acronym('bigfarm') // ← 'bf'