Closed meltingice closed 12 years ago
Hey mate,
Yeah it is a bit weird... It is so we can follow node.js naming conventions, and to perhaps one day have proper async parsing/stringifying, which would then be a graceful upgrade for everyone.
Just a continuing thought... until true async parsing arrives, however you intend to implement that, perhaps the async versions should be wrapped in a setTimeout() internally? This would make the function call actually async and would make the upgrade even more graceful.
Ooooo, that's a nice idea. +1
Are you happy to do a pull request?
Done and done.
Released as v1.0.1.
The naming around parse/parseSync and stringify/stringifySync is misleading because they really aren't async at all since it always uses the sync version and then calls the provided callback function.
If anything, I'd imagine the functions should be merged in such a way that you can provide a callback to be fired upon error.