Skip to content

Exports 18xx-maker data into ruby files

License

Notifications You must be signed in to change notification settings

perwestling/export-rb

 
 

Repository files navigation

18xx-maker/export-rb

build version downloads license

This package exports files needed to load 18xx-maker data into ruby projects, specifically in the format that 18xx.games requires.

Usage

You can use this package from node or via the command line.

CLI

When you npm install this package globaly:

npm install -g @18xx-maker/export-rb

you end up with a script that can output all tiles, or game files directly:

# Render the tiles file
18xx-export-rb tiles

# Render some games
18xx-export-rb game 1830
18xx-export-rb game 1889

Node

To use this package in node:

const exportRb = require("@18xx-maker/export-rb");

// All tiles are in exportRb.tiles
// All games are in exportRb.games

// Render tiles
const tilesRb = exportRb.renderTiles(exportRb.tiles);

// Render a game
const gameRb = exportRb.renderGame(exportRb.games["1830"]);

// If you have a game json that's not from @18xx-maker/games
// you can render that too:
const otherGameRb = exportRb.renderGame(require("./18Awesome.json"));

About

Exports 18xx-maker data into ruby files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.6%
  • HTML 5.4%