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

gt-helper

v2.1.0

Published

GT Helper is a tool to help developers create new Gather.Town Extensions.

Downloads

18

Readme

gt-helper

 _____ _____            _   _      _
|  __ \_   _|          | | | |    | |
| |  \/ | |    ______  | |_| | ___| |_ __   ___ _ __
| | __  | |   |______| |  _  |/ _ \ | '_ \ / _ \ '__|
| |_\ \ | |            | | | |  __/ | |_) |  __/ |
 \____/ \_/            \_| |_/\___|_| .__/ \___|_|
                                    | |
                                    |_|

GT Helper is a tool to help developers create new Gather.Town Extensions.

Usage

npx gt-helper@latest

CLI Interface

The CLI interface will ask you a series of questions to set up your project.

What is the name of your project?

This is the name of your project. This will be used to create the folder for your project.

Do you want to use a database?

This determines if you will be using a database. If you select y or yes, you will be asked what ORM you want to use. If you select n or no, you will not be asked what ORM you want to use.

What ORM do you want to use?

This is the ORM you want to use. The options are none, prisma, or drizzle.

Do you want to enable experimental features?

This determines if you want to enable experimental features. Currently, this adds an alpha version of a Gather Space backup feature.

Alternate Method: Additional Arguments

If you do not want to use the CLI interface to set up your project, you can use the following arguments to set up your project.

npx gt-helper@latest --name <name> --orm <prisma | drizzle> --experimental

--name is the name of your project. This will be used to create the folder for your project.

--orm is the ORM you want to use. The options are prisma and drizzle.

--experimental is a flag to enable experimental features. Currently, this adds an alpha version of a Gather Space backup feature.

Features

  • Quick setup for Gather.Town Extensions
  • Support for Prisma and Drizzle ORM
  • Focus on type safety and ease of use
  • Verbose Object and Player classes with type checking, and utility functions for extensions
  • Gather Space backup feature (alpha)
  • Overt Gather.Town Extension lifecycle, for easy debugging and testing
  • Modular helper functions, easy to add your own

Player Utility Class

The Player Utility Class is a class that extends the Gather.Town Player class. It adds a lot of utility functions to make it easier to work with players in extensions.

Player Utility Class Functions (Brief Overview)

  • Player Status Utilities:

    • ghost/unghost: control player ghost status
    • setSpeed: control player speed
  • Player Outfit Utilities:

    • parseOutfit: parse outfit string into an object format
    • updateOutfitString: update outfit string
    • updateOutfitJSON: update outfit via JSON object
    • updateOutfit: update outfit via object
    • getSpriteUrl: get sprite url for player
  • Player Inventory Utilities:

    • inventory: get player inventory
    • getInventoryItem: get item from player inventory
    • giveItem: give item to player
    • removeItem: remove item from player

Object Utility Class

The Object Utility Class is a class that extends the Gather.Town Object class. It adds a lot of utility functions to make it easier to work with objects in extensions.

Object Utility Class Functions (Brief Overview)

  • GTObjectFactory

    • Factory style object creation
    • create: Object creation
    • createFromMapObject: Object creation from Map Object
    • create_type_[x]: Object creation by object type
    • create_[usecase]_object: Object creation by usecase
  • GTObject

    • Accessors and Mutators for all Object properties
    • update: Update object in game
    • toString/toJSON: Object export for easy debugging
    • moveTo/moveBy: Easy object movement

Example Setup

Basic Usage with Prisma

Start by running the following command in your terminal. Press Y to install the latest version if asked.

npx gt-helper@latest

Answer the questions as follows:

What is the name of your project? my-project
Would you like to enable experimental features? No
Do you want to use a database? Yes
What ORM do you want to use? Prisma

Once the setup is complete, run the following commands in your terminal to add a space URL to your database.

cd my-project
npm run studio

In the Prisma Studio window, click on the 'spaces' table, then add new record, and fill in the URL field with your Gather Space URL.

npm run start

Roadmap

  • [x] Add CLI interface
  • [x] Add Prisma ORM support
  • [x] Add Object Utility Class
  • [x] Add Player Utility Class
  • [x] Add Drizzle ORM support
  • [x] Add Gather Space backup feature
  • [ ] Add automatic backup feature
  • [ ] Add more helper functions
  • [ ] Add more documentation
  • [ ] Add more code examples
  • [ ] Add 'studio mode' for Gather.Town Extension development
  • [ ] Add more utility functions to Object and Player classes

License

MIT

Contributing

GitHub for this project.

NPM for this package.

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Credits