Giter Club home page Giter Club logo

mud's Introduction

MUD reminiscing with node & redux

Why not?

Getting started

  • npm i
  • npm run start
  • telnet localhost 1337

Test

  • npm run test

Dependencies

  • the latest version of telnet is unfortunately not on NPM, so using git url as dependency instead.

Middleware

You can define middleware to create interactions between the client and the server. server exposes use which takes two arguments:

  • matchCommand: string or regex used to match the user's command, e.g. /join/ would match user input join and joint but not joi
  • response: callback that is executed when the command matches. The callback is executed with a single argument which is an object:
{
    command, // the user's input
    client, // object representing user's connection to server
    l, // write a line to the client
    prompt, // show the user's prompt
}

Note:

  • You can define as many middleware functions as you want
  • Middleware is matched and executed in the order of which they are defined
  • If matchCommand is undefined, or use is called with a single argument, the middleware is executed when no middleware was matched with the user's input
  • You can use colors when outputting text to the client using 'l()', e.g. l('Connected to MUD!'.red.bold); outputs Connected to MUD in bold, red text

mud's People

Contributors

eriklillehagen avatar godspeedelbow avatar matteo-mazzanti avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

mud's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.