0.1.2 • Published 6 years ago
lwaxer v0.1.2
Lwaxer
It might be as annoying as Lwaxana.
Small text utility to get keywords defined by rules from a given string
Install
Use the following command to install lwaxer within your project.
npm i lwaxer
Usage
Import lwaxer to your project as you will do with any other npm package.
let Lwaxer = require("lwaxer");
Add the rules you want to use. Rules can be strings to be matched or regex. By default no rules are set, but you can uses the provided default ones
Lwaxer.rules = Lwaxer.defaultRules();
The you can use getKeywords(string)
let result = Lwaxer.getKeywords('The String you want to parse');
Lwaxer will receive a string and will return an array with all the keywords defined within the rules in order of appearance.
Example
The following string
let line = "click at the loginButton, on the loginButton do a click"
when passed through Lwaxer.getKeywords(line)
with the default rules
should return an array containing
['click','loginButton','loginButton','click']