Loquat
JavaScript monadic parser combinators inspired by Haskell's Parsec.
Installation and Usage
Node.js
$ npm install loquat
Here is a simple parsing example:
var lq = require("loquat");
var result = lq.parse(lq.string("foo"), "name", "foobar", 8);
if (result.succeeded) {
console.log(result.value);
}
else {
console.log(result.error.toString());
}
Browsers
$ bower install susisu/Loquat
<script type="text/javascript" src="./bower_components/loquat/dist/loquat.min.js"></script>
<script type="text/javascript">
var result = loquat.parse(loquat.string("foo"), "name", "foobar", 8);
if (result.succeeded) {
console.log(result.value);
}
else {
console.log(result.error.toString());
}
</script>