whisparse

1.2.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i whisparse

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

2.49 kB

Total Files

5

Last publish

Collaborators

  • markrawls