https://github.com/canop/json.parsemore
A not eval based JSON parser handling NaN and infinities
https://github.com/canop/json.parsemore
Last synced: about 1 year ago
JSON representation
A not eval based JSON parser handling NaN and infinities
- Host: GitHub
- URL: https://github.com/canop/json.parsemore
- Owner: Canop
- Created: 2013-05-08T07:16:51.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-06-03T05:52:22.000Z (about 12 years ago)
- Last Synced: 2025-04-01T10:35:50.970Z (over 1 year ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 12
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
JSON.parseMore
==============
Based on Crockford's json_parse.js, this not eval based JSON parser adds support for the much needed NaN and infinities.
[Test it online](http://dystroy.org/JSON.parseMore)
Why ?
-----
* because when you deal with numbers in a scientific or technical applications, it's hard not to use IEEE754's NaN and sometimes painful not to use infinities
* because some JSON builders let you write NaN (for example Google's gson)
* because `eval('('+json+')')` fails on IE with big JSON strings
How to use it ?
---------------
Download the js file and import it :
and then parse any JSON string using
var parsed = JSON.parseMore(json);
License
-------
Public Domain. Use as you wish and at your own risk.