{"id":13749260,"url":"https://github.com/abodelot/jquery.json-viewer","last_synced_at":"2025-05-15T04:06:54.908Z","repository":{"id":24827921,"uuid":"28242496","full_name":"abodelot/jquery.json-viewer","owner":"abodelot","description":"jQuery plugin for displaying JSON data","archived":false,"fork":false,"pushed_at":"2022-10-24T17:45:21.000Z","size":43,"stargazers_count":428,"open_issues_count":5,"forks_count":171,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-10T10:09:54.479Z","etag":null,"topics":["jquery","json"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abodelot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-19T19:09:26.000Z","updated_at":"2025-03-29T14:09:32.000Z","dependencies_parsed_at":"2022-09-05T15:52:02.008Z","dependency_job_id":null,"html_url":"https://github.com/abodelot/jquery.json-viewer","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abodelot%2Fjquery.json-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abodelot%2Fjquery.json-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abodelot%2Fjquery.json-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abodelot%2Fjquery.json-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abodelot","download_url":"https://codeload.github.com/abodelot/jquery.json-viewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270646,"owners_count":22042859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jquery","json"],"created_at":"2024-08-03T07:00:58.027Z","updated_at":"2025-05-15T04:06:49.895Z","avatar_url":"https://github.com/abodelot.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# jQuery json-viewer\n\n![npm](https://img.shields.io/npm/v/jquery.json-viewer.svg)\n![npm](https://img.shields.io/npm/l/jquery.json-viewer.svg)\n![npm](https://img.shields.io/npm/dt/jquery.json-viewer.svg)\n![workflow](https://github.com/abodelot/jquery.json-viewer/actions/workflows/node.js.yml/badge.svg)\n\n*json-viewer* is a jQuery plugin for easily displaying JSON objects by transforming them into HTML.\n\nFeatures:\n- Syntax highlighting\n- Collapse and expand child nodes on click\n- Clickable links\n- Easily readable and minimal DOM structure\n- Optional support for libraries supporting big numbers\n\nCheck out the [demo page](https://abodelot.github.io/jquery.json-viewer/demo.html)!\n\n## Install\n\nWith npm:\n\n```sh\nnpm install jquery.json-viewer\n```\n\nMake sure jQuery is already included. Then import `jquery.json-viewer.js` and `jquery.json-viewer.css` in your HTML document:\n\n```html\n\u003chead\u003e\n  \u003cscript src=\"node_modules/jquery.json-viewer/json-viewer/jquery.json-viewer.js\"\u003e\u003c/script\u003e\n  \u003clink href=\"node_modules/jquery.json-viewer/json-viewer/jquery.json-viewer.css\" type=\"text/css\" rel=\"stylesheet\"\u003e\n\u003c/head\u003e\n```\n\nYou can also simply copy `json-viewer/jquery.json-viewer.js` and `json-viewer/jquery.json-viewer.css` files from this git repository into your project.\n\n## Usage\n\nCall the `jsonViewer()` method on target element and pass your JSON data in argument:\n\n```html\n\u003cpre id=\"json-renderer\"\u003e\u003c/pre\u003e\n```\n\n```js\nvar data = {\n  \"foobar\": \"foobaz\"\n};\n$('#json-renderer').jsonViewer(data);\n```\n\n## Options\n\nThe `jsonViewer` method accepts an optional config object as a second argument. The supported options are:\n\n- `collapsed` (boolean, default: `false`): all nodes are collapsed at html generation.\n- `rootCollapsable` (boolean, default: `true`): allow root element to be collasped.\n- `withQuotes` (boolean, default: `false`): all JSON keys are surrounded with double quotation marks (`{\"foobar\": 1}` instead of `{foobar: 1}`).\n- `withLinks` (boolean, default: `true`): all values that are valid links will be clickable, if `false` they will only be strings.\n- `bigNumbers` (boolean, default: `false`): support different libraries for big numbers, if `true` display the real number only, `false` shows object containing big number with all fields instead of number only.\n\nExample:\n\n```js\n$('#json-renderer').jsonViewer(data, {collapsed: true, withQuotes: true, withLinks: false});\n```\n\n#### Big number support\n\nEnabling `bigNumbers` the json object visible will show the number stored inside the object only and does not display\nall fields.\n\nExample Object using Decimal.js - other libraries are similar:\n```js\nvar Decimal = require('decimal.js');\nvar data = { \"x\": new Decimal(123) };\n\n$('#json-renderer').jsonViewer(data, {bigNumbers: false});\n\n// {\n//   \"x\": {\n//        \"constructor\": ,\n//        \"s\": 1,\n//        \"e\": 2,\n//        \"d\": [\n//          123\n//        ]\n//   }\n// }\n\n$('#json-renderer').jsonViewer(data, {bigNumbers: true});\n\n// {\n//   \"x\": 123\n// }\n```\nThe following libraries are supported:\n\n- Decimal.js: https://github.com/MikeMcl/decimal.js/\n- Decimal.js-light: https://github.com/MikeMcl/decimal.js-light/\n- Big.js: https://github.com/MikeMcl/big.js/\n- BigNumber.js: https://github.com/MikeMcl/bignumber.js/\n- Lossless-JSON: https://github.com/josdejong/lossless-json\n\n## About\n\n- Author: [Alexandre Bodelot](https://github.com/abodelot)\n- License: [MIT License](http://opensource.org/licenses/MIT)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabodelot%2Fjquery.json-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabodelot%2Fjquery.json-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabodelot%2Fjquery.json-viewer/lists"}