@18xx-maker/export-rb
Exports 18xx-maker data into ruby files
Last updated 18 days ago by kelsin .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @18xx-maker/export-rb 
SYNC missed versions from official npm registry.

18xx-maker/export-rb

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, from a browser 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"));

Browser

In this repo we have two browser builds of this package in the dist folder:

Note: Neither of these files exist in the npm package.

The first is pretty large and includes ALL @18xx-maker/games data. Please make sure this is what you want if you choose to use that file.

The other just has the rendering functions. Both are UMD browserify bundles that can export a global xxMaker that can be used just like the node package above. Feel free to check out the (incredibly basic) example index.html for an example.

Current Tags

  • 0.3.4                                ...           latest (18 days ago)

11 Versions

  • 0.3.4                                ...           18 days ago
  • 0.3.3                                ...           18 days ago
  • 0.3.2                                ...           18 days ago
  • 0.3.1                                ...           18 days ago
  • 0.3.0                                ...           18 days ago
  • 0.2.3                                ...           18 days ago
  • 0.2.2                                ...           18 days ago
  • 0.2.1                                ...           18 days ago
  • 0.2.0                                ...           18 days ago
  • 0.1.0                                ...           18 days ago
  • 0.0.1                                ...           18 days ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 135
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (7)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |