Skip to content

ariataylor96/whisparse

Repository files navigation

whisparse

Chat command parsing, used in whisprite

Installation

With npm:

npm install --save whisparse

With yarn:

yarn add whisparse

Usage:

import parse from 'whisparse';

const chatMessage = '%cmdName arg1 "arg2 is here" arg3';

const parsed = parse(chatMessage, {prefix: '%'}); // Default prefix is '!'

console.log(parsed);
/*
{
 command: 'cmdname',
 args: ['arg1', 'arg2 is here', 'arg3'],
 argsString: 'arg1 "arg2 is here" arg3',
 message: '%cmdName arg1 "arg2 is here" arg3'
}
*/

Currently, prefix is the only option available to configure whisparse, but more will be added as needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published