UNPKG

starforged-cli

Version:

My goal is for this to be an easy-to-use CLI for playing Starforged solo. If your game ends up in a broken state of some sort, and no command yet exists to fix your issue, all of the game data you accumulate is stored in `~/starforged-cli/db.json` and you

33 lines (26 loc) 930 B
const { starforged } = require("dataforged"); const { marked } = require("marked"); const TerminalRenderer = require("marked-terminal"); const chalk = require("chalk"); const { autocompletePromptByIndex } = require("../userPrompts"); const { prop } = require("ramda"); marked.setOptions({ renderer: new TerminalRenderer({ strong: chalk.green.bold, }), }); async function referenceAMove() { const categoryIndex = await autocompletePromptByIndex({ message: "Choose a category.", choices: starforged["Move Categories"].map(prop("Name")), }); const moveIndex = await autocompletePromptByIndex({ message: "Choose a move.", choices: starforged["Move Categories"][categoryIndex].Moves.map( prop("Name") ), }); const move = starforged["Move Categories"][categoryIndex].Moves[moveIndex]; console.log(`\n${marked(`# ${move.Name}\n${move.Text}`)}`); } module.exports = { referenceAMove };