
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
A gametest scripting module that aims to make scripting much more customized.
A minecraft gametest scripting module that aims to make gametest scripting much more customized, and currently has a few features.
And much more there is to come in the near future.
YlModule
manages custom commands in clusters, giving the module the opportunity to be much more efficient in handling data. Command
instances are the units of data in the system, which are separated and stored in different managers. Managers, or CommandManager
instances to be precise, manage commands and handle their execution. Command managers must have unique names and prefixes to be easily distinguishable from each other.
For custom commands to be created, a CommandManager
must be instantiated first in order for the commands to be stored and managed somewhere.
Command Manager constructor
constructor(name: string, prefix: string): CommandManager
Command constructor
constructor(options: CommandOptions): Command
import { CommandManager, Command } from "ylmodule";
// Instantiation of CommandManager
const testManager = new CommandManager("Test", "-");
// Registration of a command
testManager.register(
new Command({
name: "ping",
description: "Replies with pong!",
callback: (interaction) => {
// Reply to the interaction
interaction.reply("Pong!");
},
})
);
The command system is quite unique and requires a little more effort to execute. The command test
from above can be executed in the format {prefix}{command}
, where {prefix}
is the prefix of the manager where the command is stored, and {command}
being the name of the command itself.
In cases where a command has subcommands and options, the format for specifying which subcommand is executed is {subcommand}
, and the format for specifying options is {option}: {value}
. The {option}
is the name of the option and {value}
is the value passed. Note that the colon is required to avoid ambiguity between options and subcommands.
This may be confusing, but consider the following example to illustrate the format:
Say a command tag
is created:
import { CommandManager, Command, CommandTypes } from "ylmodule";
// Instantiate the CommandManager
const commands = new CommandManager("GeneralCommands", "-");
// Register the command
commands.register(
new Command({
name: "tag",
description: "Manages the tag of players",
options: [
{
name: "player",
description: "The player to have their tags managed",
type: CommandTypes.Player,
required: true,
subcommands: [
{
name: "add",
description: "Adds tags to the player",
options: [
{
name: "tag",
description: "The tag to be added",
type: CommandTypes.String, // This is not required as "type" is set to String by default,
required: true,
},
],
},
{
name: "remove",
description: "Removes tags from the player",
options: [
{
name: "tag",
description: "The tag to be added",
type: CommandTypes.String,
required: true,
},
],
},
{
name: "list",
description: "Shows the tags of the player",
},
],
},
],
callback: (interaction) => {
// Just reply for the mean time
interaction.reply(`${interaction.commandName} used!`);
},
})
);
In the command example above, the command can be executed this way:
{prefix}{command} {option}: {value} {subcommand} {option}: {value}
For example:
-tag player: Ylon add tag: "test-tag"
-tag player: Ylon list
YlModule
is installed with Node Package Manager (npm) by typing npm i ylmodule
in the terminal. Do note that Node.js must be installed for the npm CLI to be accessible.
# To install YlModule
npm i ylmodule
After installing YlModule
, you can initialize the current working directory as the script pack to be used by running npx ylmodule init
, doing so will initialize the directory as a pack by adding the manifest.json
and the src
folder. The command also adds the scripts field inside the package.json
for production.
NOTE: Executing
npx ylmodule init
will not overwrite the existingmanifest.json
file andsrc
folder, and will, by default, generate a javascript file (index.js
) insidesrc
that is used as the entry file in themanifest.json
.
# To initialize the current working directory
npx ylmodule init
The build
script can then be ran once done editing the contents of the src
folder. Running the script will compile all of the javascript files inside the source folder to the scripts
folder, as well as the built ylmodule
which will be inside yl_modules/YlModule
.
# To compile the source folder and build the module
npm run build
FAQs
A gametest scripting module that aims to make scripting much more customized.
The npm package ylmodule receives a total of 0 weekly downloads. As such, ylmodule popularity was classified as not popular.
We found that ylmodule demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.