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

@keneanung/nexus-package-builder

v1.4.0

Published

Tool to create an Iron Realms Nexus native package from individual files

Downloads

17

Readme

Package builder for Iron Realms Nexus

This project is a package builder inspired by and similar in function to muddler for Mudlet. It takes a package definition file that's better suited for humans than the original format and files that can be edited separately as input and creates a package file for the Nexus MUD client of Iron Realms.

Usage

Installation

npm install @keneanung/nexus-package-builder

Running the tool

npx nexus-package-builder [-v <version>] <package-definition.yaml> <output-dir>

Examples:

npx nexus-package-builder input.yaml ./output
npx nexus-package-builder -v 1.2.0 input.yaml ./output

This command will convert the yaml file input.yaml to the package file ./output/input.nxs.

The yaml file schema

This is a sample yaml file with all fields:

# yaml-language-server: $schema=./resources/nexus-schema.json
name: Package Name
description: This is the package description
enabled: true
type: group
version: 1.0.0
dependencies:
  - foo
  - bar
website: https://foo.com/bar
items:
  # function with inline code
  - name: functionName
    type: function
    code: console.log('hello world')
    enabled: true
  # function with external code file
  - name: anotherFunctionName
    type: function
    codeFile: ./codeFile.js
    enabled: true
  - name: alias
    type: alias
    case_sensitive: true
    enabled: true
    text: Alias text to match
    matching: begins # or exact or regexp
    prefix_suffix: true
    whole_words: true
    actions:
      # script with inline code
      - action: script
        script: console.log('hello from script')
      - action: script
        scriptFile: ./scriptFile.js
      - action: button
        buttonaction: command  # or default or highlight or unhighlight or label
        buttonid: '0'
        command: someCommandToRun
        label: labelToSet
      - action: command
        command: commandText
        prefix_suffix: true
      - action: disable
        name: thingToDisable
        type: alias # or event or trigger or group or keybind
      - action: disableme
      - action: enable
        name: thingToEnable
        type: alias # or event or trigger or group or keybind
      - action: function
        fn: functionToCall
      - action: goto
        label: labelToGoTo
      - action: if
        cond-type1: target # or value or variable
        cond-val1: value1
        cond-type2: target # or value or variable
        cond-val2: value2
        cond-op: starts # or ends or greater or smaller or eq
        cond-mod: not # or empty
        cond-cs: true
        dothen: continue # or jump or stop
        dothenlabel: labelToJumpTo
        doelse: continue # or jump or stop
        doelselabel: labelToJumpToElse
      - action: label
        label: labelName
      - action: notification
        heading: header for browser notification
        text: text of notification
      - action: notify
        notice: NoticeText
        notice_fg: red # any colour in HTML (so name or hex)
        notice_bg: red # any colour in HTML (so name or hex)
      - action: repeat
        cond-type1: target # or value or variable
        cond-val1: value1
        cond-type2: target # or value or variable
        cond-val2: value2
        cond-op: starts # or ends or greater or smaller or eq
        cond-mod: not # or empty
        cond-cs: true
        label: labelToJumpTo
        mode: count # or while
      - action: sound
        sound: urlToSoundToPlay
      - action: stop
      - action: variable
        op: add # or del or div or mul or set or sub
        valtype: target # or value or variable
        value: valueof the variable
        varname: name of the new variable
      - action: wait
        milliseconds: "0"
        seconds: "1"
      - action: waitfor
        text: text from the game to wait for
        matching: begins # or exact or regexp or substring
        case_sensitive: true
        expire: "10"
        whole_words: true
  - type: group
    name: group name
    enabled: true
    items:
      # list of reflexes (triggers, aliases, groups, keybinds, events)
  - type: event
    name: name of the event
    enabled: true
    evtype: GMCP
    evsubtype: Char.Afflictions.Add # or Char.Afflictions.Remove or Char.Vitals or Room.AddPlayer or Room.RemovePlayer or Char.Defences.Add or Char.Defences.Remove or IRE.Target.Set or Room.Info
    actions:
      # list of actions to run, see the alias
  - type: keybind
    enabled: true
    name: keybindName
    key: 0 # numerical ID for the key
    key_alt: true
    key_ctrl: true
    key_shift: true
    actions:
      # list of actions to run, see the alias
  - type: trigger
    name: triggername
    text: text to trigger
    enabled: true
    matching: begins # or exact or regexp or substring
    case_sensitive: true
    whole_words: true
    actions:
      # list of actions to run, see the alias

To ease the editing of yaml files, this package also includes a yaml schema file. Some editors can include it with the following comment at the top of the file:

# yaml-language-server: $schema=.node_modules/@keneanung/nexus-package-builder/resources/nexus-schema.json

The only mandatory values for each item are type for reflexes and action for actions as those distinguish which fields are allowed. Default values will be used for missing fields.

NOTE You should not use most actions as they are part of the simplified scripting. If you are already writing code complex enough to warrant the use of external code files, stick to the actions script and possibly function.