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 🙏

© 2025 – Pkg Stats / Ryan Hefner

swordfight-cli

v1.3.0

Published

Command-line interface for the SwordFight game engine

Readme

SwordFight CLI

A command-line interface for the SwordFight game engine. Play sword-fighting duels against AI opponents directly in your terminal!

Features

  • Interactive Character Selection: Choose from multiple characters with different stats and equipment
  • Dramatic Combat: Cinematic flavor text with typewriter effects
  • Strategic Gameplay: Make tactical decisions each round based on combat state and restrictions
  • Visual Feedback: Health bars, equipment status, and move bonuses displayed beautifully
  • Cursor Navigation: Use arrow keys to select moves and characters
  • Multiplayer Ready: Built on the new multiplayer-capable engine with transport system

Installation

npm install -g swordfight-cli

Usage

Simply run:

swordfight

Or if installed locally:

npx swordfight-cli

Game Flow

  1. Enter Your Name: Choose your warrior's name
  2. Select Game Mode:
    • 🤖 Fight the Computer: Battle against an AI opponent
    • ⚔️ Create Multiplayer Game: Generate a shareable game code
    • 🎮 Join Multiplayer Game: Enter a friend's game code
  3. Choose Your Character: Pick from 7 unique warriors
  4. Battle: Select moves strategically each round

Multiplayer Mode

When you create a multiplayer game, you'll receive a 5-character code (e.g., XYZ42). Share this code with a friend who can then join your game by selecting "Join Multiplayer Game" and entering the code. Both players select their own characters, then battle in real-time over the internet!

Game Mechanics

  • Choose your character and face your opponent
  • Select moves each round using arrow keys
  • Combat range changes based on your moves
  • Certain moves grant bonuses for the next round
  • Restrictions may apply based on previous actions
  • Defeat your opponent to win!

Characters

The game includes several pre-configured characters:

  • Human Fighter: Balanced fighter with broadsword and shield
  • Evil Human Fighter: Skilled warrior with long sword and buckler
  • Goblin: Tough fighter with mace and wooden shield
  • Human Monk: Agile fighter with quarterstaff
  • Lizard Man: Reptilian warrior with scimitar and buckler
  • Mummy: Undead fighter with heavy mace
  • Skeleton: Animated bones with sword and shield

Engine Updates (v1.5.0)

This CLI now uses the updated SwordFight Engine v1.5.0 which features:

  • Unified Transport System: Computer player now uses the same transport system as multiplayer
  • Async Initialization: New lifecycle pattern (create → initialize → connect)
  • Automatic Character Exchange: Opponent characters are exchanged automatically during connection
  • Multiplayer Ready: The same codebase can support both local and networked play

Requirements

  • Node.js 18.0.0 or higher
  • Terminal with emoji support for best experience

Credits

Built on the SwordFight Game Engine v1.5.0