nodejs compatibility #2

wants to merge 8 commits into


None yet
2 participants

rictic commented Feb 11, 2012


I've been enjoying using jsparse, but I wanted to be able to test my parsers in nodejs, and figured it'd also be nice to have the option to put everything within its own namespace, so I hacked up this patch.

I haven't yet updated the examples, but tests.js passes (in 3ms! and ~100ms including startup time and everything), and I added a browser invocation of the tests.js code.

There are two backwards incompatible changes introduced. One is that to use it the old way (with everything in the toplevel namespace) in a browser you must call


And even with that, memoize must be set on jsparse, it can't be set in the toplevel namespace.

Anyways, thanks for writing jsparse!


doublec commented Feb 13, 2012

Thanks for the pull request, I'll look at it tonight and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment