1.2.0 • Published 3 years ago

whisparse v1.2.0

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

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.

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

4 years ago