{"id":13815849,"url":"https://github.com/mohsen1/json-formatter-js","last_synced_at":"2025-09-03T12:40:20.911Z","repository":{"id":1209339,"uuid":"41514123","full_name":"mohsen1/json-formatter-js","owner":"mohsen1","description":" Render JSON objects in beautiful HTML (pure JavaScript)","archived":false,"fork":false,"pushed_at":"2025-03-03T18:38:32.000Z","size":1778,"stargazers_count":715,"open_issues_count":7,"forks_count":106,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-08-20T21:28:29.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://azimi.me/json-formatter-js/","language":"TypeScript","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/mohsen1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-27T22:16:53.000Z","updated_at":"2025-08-01T00:51:05.000Z","dependencies_parsed_at":"2024-06-18T12:16:55.050Z","dependency_job_id":"9b149b9e-6aeb-468e-8d24-7bfbe9891155","html_url":"https://github.com/mohsen1/json-formatter-js","commit_stats":{"total_commits":141,"total_committers":16,"mean_commits":8.8125,"dds":0.6382978723404256,"last_synced_commit":"d537360359b3e2a2de0aa00d45ded67e6f3ea439"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/mohsen1/json-formatter-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen1%2Fjson-formatter-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen1%2Fjson-formatter-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen1%2Fjson-formatter-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen1%2Fjson-formatter-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohsen1","download_url":"https://codeload.github.com/mohsen1/json-formatter-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen1%2Fjson-formatter-js/sbom","scorecard":{"id":657020,"data":{"date":"2025-08-11","repo":{"name":"github.com/mohsen1/json-formatter-js","commit":"bd1b1bf983747f83c7747bde99488405f6db15a6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 2/13 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/npm-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/npm-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/npm-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/npm-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/npm-publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/mohsen1/json-formatter-js/npm-publish.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4www-5p9h-95mh","Warn: Project is vulnerable to: GHSA-9gqv-wp59-fq42","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T14:57:53.545Z","repository_id":1209339,"created_at":"2025-08-21T14:57:53.545Z","updated_at":"2025-08-21T14:57:53.545Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272687191,"owners_count":24976556,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-04T04:04:16.838Z","updated_at":"2025-09-03T12:40:20.856Z","avatar_url":"https://github.com/mohsen1.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# JSON Formatter\n\n\u003e Render JSON objects in HTML with a **collapsible** navigation.\n\n**Check out [`\u003cpretty-json\u003e` Custom Element](https://github.com/mohsen1/pretty-json) for a more portable and light solution**\n\n## Usage\n\n**[Live Demo](http://azimi.me/json-formatter-js/)**\n\nInstall via npm\n\n```shell\nnpm install --save json-formatter-js\n```\n\nInclude `json-formatter.js` from the `dist` folder in your page.\n\n```js\nimport JSONFormatter from \"json-formatter-js\";\n\nconst myJSON = { ans: 42 };\n\nconst formatter = new JSONFormatter(myJSON);\n\ndocument.body.appendChild(formatter.render());\n```\n\n## API\n\n### `JSONFormatter(json [, open [, config] ])`\n\n#### `json` (`Object`) - **required**\n\nThe JSON object you want to render. It has to be an object or array. Do NOT pass a raw JSON string.\n\n#### `open` (`Number`)\n\nDefault: `1`\nThis number indicates up to how many levels the rendered tree should expand. Set it to `0` to make the whole tree collapsed or set it to `Infinity` to expand the tree deeply.\n\n#### `config` (`Object`)\n\nDefault:\n\n```js\n{\n  hoverPreviewEnabled: false,\n  hoverPreviewArrayCount: 100,\n  hoverPreviewFieldCount: 5,\n  animateOpen: true,\n  animateClose: true,\n  theme: null,\n  useToJSON: true,\n  sortPropertiesBy: null,\n  maxArrayItems: 100,\n  exposePath: false\n}\n```\n\nAvailable configurations:\n\n##### Hover Preview\n\n- `hoverPreviewEnabled`: enable preview on hover.\n- `hoverPreviewArrayCount`: number of array items to show in preview. Any array larger than this number will be shown as `Array[XXX]` where `XXX` is the length of the array.\n- `hoverPreviewFieldCount`: number of object properties to show for object preview. Any object with more properties than this number will be truncated.\n\n##### Theme\n\n- `theme`: a string that can be any of these options: `['dark']`. Look at [`src/style.less`](src/style.less) for making new themes.\n\n##### Animation\n\n- `animateOpen`: enable animation when expanding a JSON object. True by default.\n- `animateClose`: enable animation when closing a JSON object. True by default.\n\n##### Rendering Options\n\n- `useToJSON`: use the `toJSON` method to render an object as a string, if available. Useful for objects like `Date` or Mongo's `ObjectID` that might make more sense as a string than as empty objects. True by default.\n- `sortPropertiesBy`: use the given sorting function to deeply sort the object properties.\n- `maxArrayItems`: use to split arrays into multiple smaller groups. This value defines the size of each group. If the length of the array is less than this number, no groups are created. It's the same behavior as the Webkit developer tool's console.\n- `exposePath`: add an array of keys to each node dataset so it is possible to correlate nodes to the original JSON.\n\n### `openAtDepth([depth])`\n\n```js\nconst formatter = new JSONFormatter({ ... });\ndocument.body.appendChild(formatter.render());\nformatter.openAtDepth(3);\n```\n\n#### `depth` (`Number`)\n\nDefault: `1`\nThis number indicates up to how many levels the rendered tree should open. It allows use cases such as collapsing all levels (with value `0`) or expanding all levels (with value `Infinity`).\n\n## Development\n\nInstall the dependencies:\n\n```shell\nnpm install\n```\n\nRun the dev server:\n\n```shell\nnpm run dev\n```\n\n### Running Tests\n\n**Once:**\n\n```shell\nnpm test\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohsen1%2Fjson-formatter-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohsen1%2Fjson-formatter-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohsen1%2Fjson-formatter-js/lists"}