JSON: Difference between revisions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
There's this [https://github.com/composer/composer/blob/master/src/Composer/Json/JsonFile.php code for reading/writing/validating JSON] which is used by the Composer project. | There's this [https://github.com/composer/composer/blob/master/src/Composer/Json/JsonFile.php code for reading/writing/validating JSON] which is used by the Composer project. | ||
When working with large JSON data sets, it's helpful to have a viewer like http://jsonviewer.stack.hu/ which easily parses and renders the object in a tree fashion. [https://github.com/GerHobbelt/nicejson-php/blob/master/nicejson.php PHP code for formatting JSON] to make it "readable" aka "pretty print" is now built-in, as of PHP 5.4, with <code> | When working with large JSON data sets, it's helpful to have a viewer like http://jsonviewer.stack.hu/ which easily parses and renders the object in a tree fashion. [https://github.com/GerHobbelt/nicejson-php/blob/master/nicejson.php PHP code for formatting JSON] to make it "readable" aka "pretty print" is now built-in, as of PHP 5.4, with <code>json_decode JSON_PRETTY_PRINT</code> | ||
There are other tools too for working with json | |||
# Python <code>python -m json.tool myFile.json</code> | |||
# Node based https://github.com/ddopson/underscore-cli | |||
# Binary C https://stedolan.github.io/jq/ (with online viewer) | |||
[[Category:JavaScript]] | [[Category:JavaScript]] | ||
[[Category:Data]] | [[Category:Data]] | ||