npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

textadv

v3.0.1

Published

Text Adventures generator from Markdown files

Downloads

21

Readme

textadv

Text Adventures generator from Markdown files.

Note: this is prototype app without proper unit tests. Use it at your own risk!

Usage:
  $ textadv <command> [options]

Commands:
  gen <file>  Generates Text Adventure from a Markdown file
  run <file>  Runs Text Adventure from a Markdown file

For more info, run any command with the `--help` flag:
  $ textadv gen --help
  $ textadv run --help

Options:
  -h, --help  Display this message 

File Format

Project declaration

Declare your project's name and intro at the root level:

# Haunted House

This is the intro to this awesome adventure!

Let's dive in!

You can optionally start your file with a meta-information block:

---
title: Haunted House
author: John Doe <[email protected]>
---

Locations

Declare each location as a second-level text with a pin emoji:

## 📍 Uncle's house

You are at your uncle's house.

The dog is restless and you hear a sound coming from the kitchen.

Sometimes you'll prefer to use a short identifier for your location (when using the goto command, for instance). This can be done via the [...] marker as seen below:

## 📍 Uncle's Kitchen [kitchen]

There is no one here...

The trash can is moving!

Interactions

After declaring a location's description, add possible interactions as bullet-point lists:

- go kitchen
  - "You hold your breath for a moment and decide do check the kitchen"
  - goto kitchen
- stand still
  - "You decide it's better to stay quiet and watch your surroundings"

Each bullet point is matched against the players input. When a match is found, it will start executing the second-level bullet-points, and stop when those are finished (unless explicitly instructed otherwise by Commands and Checks)

You can have one single bullet-point match against lots of input variations. Example:

- check/examine dog/beagle/buddy
  - "Buddy is moving around the room in a very unusual way"
- hear/check sound(s)/noise; pay attention 
  - "This is nothing like you've heard before"

Second-level bullet-points can be of 3 types: messages, commands, or checks.

Messages

A message is just a quoted text:

"You hold your breath for a moment and decide do check the kitchen"

Commands

A command can change the state of the game.

Command's reference list:

  • goto <room>: Move player to the room with the specified ID
  • set <flag>: Set the named flag as 1
  • clear <flag>: Clear the named flag back to 0
  • continue: Continue processing the next bullet
  • check-room: Re-introduce the room to the player

Checks

A check will test the condition and skip to the next bullet when the condition is false.

Check's reference list:

  • zero <flag>: Check if the flag equals 0
  • notzero <flag>: Check if the flag is different from 0

Objects

TODO

Using multiple files

You can split your adventure into multiple markdown files by using the extends keyword.

[extends](./another-file.md)

This will instantly load the referenced file (in parenthesis) and add its contents to each declared section.

This means you can have multiple files adding descriptions and commands to the same previously declared sections, in effect "extending" them.