Methods
addRule(Rl) → {Rule}
Adds a new rule
Parameters:
Name | Type | Description |
---|---|---|
Rl |
object
|
Rule
|
The rule to add |
addRules(Rls) → {Array.<Rule>}
Adds multiple new rules
Parameters:
Name | Type | Description |
---|---|---|
Rls |
Array.<object>
|
Array.<Rule>
|
An array of the rules to add |
parse(Data) → {Context}
Parses the data specified as a string or Buffer. After the parsing completed, returns the root context which contains all the generated sub-contexts through the entire parsing
Parameters:
Name | Type | Description |
---|---|---|
Data |
string
|
Buffer
|
The data to be parsed |
parseFile(Url, Opt) → {Promise}
Parses a file asynchronously
Parameters:
Name | Type | Default | Description |
---|---|---|---|
Url |
string
|
The file URL |
|
Opt |
object
|
null |
Streaming options |
Returns:
- Type:
-
Promise
A Promise that will resolve when the parsing completes.
You can get the root context as the 1st parameter of a callback
which you can pass to .then()