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 ๐Ÿ™

ยฉ 2026 โ€“ย Pkg Stats / Ryan Hefner

@ursamu/parser

v1.4.10

Published

> Transform your text into magic! A modern, JavaScript-powered MUSHcode engine that makes your MUSH dreams come true. ๐Ÿš€

Readme

๐ŸŽฎ MUSHcode Parser

Transform your text into magic! A modern, JavaScript-powered MUSHcode engine that makes your MUSH dreams come true. ๐Ÿš€

npm version License: MIT

โœจ Features

  • ๐ŸŽฏ Powerful Function System - Create and use MUSHcode functions with ease
  • ๐Ÿ”„ Smart Substitutions - Flexible text substitution system
  • ๐Ÿ”Œ Plugin Architecture - Extend functionality with plugins
  • ๐Ÿ› ๏ธ TypeScript Support - Full TypeScript support for modern development

๐Ÿ“ฆ Installation

Choose your favorite package manager:

# Using npm
npm install @ursamu/parser

# Using yarn
yarn add @ursamu/parser

# Using pnpm
pnpm add @ursamu/parser

๐Ÿš€ Quick Start

import { Parser } from "@ursamu/parser";

// Create your magical parser
const parser = new Parser();

// Let's make some magic happen!
async function magicExample() {
  const result = await parser.run({
    msg: "add(1,2)",
    data: {},
    scope: {},
  });
  
  console.log(result);
  // Output: 3
}

๐ŸŽฎ Built-in MUX Functions

The parser comes with several classic MUX functions ready to use:

// Comments - returns nothing
@@(This is a comment)

// Say something
say(Hello World!)  // => says "Hello World!"

// Pose an action
pose(waves hello)  // => waves hello

// Emit a message
emit(A loud noise echoes)  // => A loud noise echoes

// Basic arithmetic
add(5, 10)  // => 15

๐Ÿ› ๏ธ Creating Custom Functions

Add your own functions to extend the parser's capabilities:

// Add a multiplication function
parser.add("multiply", async (args) => {
  return args.reduce((a, b) => parseInt(a) * parseInt(b), 1);
});

// Use it!
await parser.run({
  msg: "multiply(5,4)",
  data: {},
  scope: {},
}); // => "20"

๐ŸŽจ Text Substitutions

Make your text more dynamic with substitutions:

// Add ANSI color substitutions
parser.addSubs("ansi", {
  before: "%ch",
  after: "\u001b[1m", // Bold
  strip: ""
});

// Use them!
const colorful = parser.substitute("ansi", "%chBold text!%cn");

๐Ÿ”Œ Creating Plugins

Extend the parser with your own plugins:

const myPlugin = (parser) => {
  // Add custom functions
  parser.add("greet", async (args) => `Hello, ${args[0]}!`);
  
  // Add custom substitutions
  parser.addSubs("custom", {
    before: /%emoji/g,
    after: "๐ŸŽฎ"
  });
};

// Use your plugin
parser.plugin(myPlugin);

๐Ÿงช Development

# Clone the repo
git clone https://github.com/lcanady/parser.git

# Install dependencies
npm install

# Run tests
npm test

# Build the project
npm run build

๐Ÿ“š API Reference

Parser Class

The main class that handles all parsing operations.

class Parser {
  // Create a new parser
  constructor(options?: ParserBuildOptions);

  // Add a new function
  add(name: string, func: MuFunction): void;

  // Add substitutions
  addSubs(label: string, ...subs: Sub[]): void;

  // Run the parser
  run(ctx: Context): Promise<string>;
}

Context Interface

interface Context {
  msg?: string;           // The message to parse
  data: Record<string, any>; // Additional data
  scope: Record<string, any>; // Variable scope
}

๐Ÿ“œ License

MIT


Made with โค๏ธ