lacona-addon-simple
Removal Notice
This module is no longer used. On modern versions of Lacona, its functionality can be reproduced with:
var Writable = Writable; { var stream = objectMode: true ; var list = ; stream { list; }; stream { ; }; return stream;} parser
Historical Information
By default, the lacona parser behaves like a stream outputting parse results in the order that they are computed. However, sometimes for simple applications you do not need this complex behavior. lacona-addon-simple
simplifies the results of the parser to return all parse results in a callback.
var lacona = ;var Simple = ;var laconaParser = ; var simpleParser = laconaParser; ; simpleParser;
Installation
npm install lacona-addon-simple
Use
lacona-addon-simple
exports a single constructor. The constructor must be invoked using new
. It accepts a single argument, a lacona.Parser
instance.
The returned object has one property and one method:
property parser
- the instance oflacona.Parser
passed to the constructor. Can be modified at will.method parse
- a function that takes an input string and a callback. It will parse the input string usingparser
and return an array of all results to the callback, or an error.