{"id":17968353,"url":"https://github.com/gre/json-beautify","last_synced_at":"2025-07-25T20:08:24.138Z","repository":{"id":32048196,"uuid":"35619771","full_name":"gre/json-beautify","owner":"gre","description":"JSON.stringify with fixed maximum character width.","archived":false,"fork":false,"pushed_at":"2020-02-10T14:20:50.000Z","size":11,"stargazers_count":45,"open_issues_count":5,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T00:38:45.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-14T15:38:22.000Z","updated_at":"2024-04-29T02:47:42.000Z","dependencies_parsed_at":"2022-09-04T15:10:37.158Z","dependency_job_id":null,"html_url":"https://github.com/gre/json-beautify","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fjson-beautify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fjson-beautify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fjson-beautify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gre%2Fjson-beautify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gre","download_url":"https://codeload.github.com/gre/json-beautify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245435039,"owners_count":20614817,"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":[],"created_at":"2024-10-29T14:21:06.482Z","updated_at":"2025-03-25T09:30:46.514Z","avatar_url":"https://github.com/gre.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"json-beautify\n=============\nJSON.stringify with fixed maximum character width.\n\n**json-beautify** is a fork of `JSON.stringify` [json2.js](https://github.com/douglascrockford/JSON-js/blob/master/json2.js) implementation.\n\n\nIt has the exact same signature of `JSON.stringify` but it also adds an optional 4th parameter:\n\nThe maximum fixed character width (for instance 80).\n\n## Examples:\n\n```js\nvar beautify = require(\"json-beautify\");\n\nvar obj = { str: \"Hello World\", num: 42, smallarray: [ 1, 2, 3, \"foo\", {} ], smallobject: { foo: \"bar\", bar: 42 }, bigarray: [ 1, 2, 3, \"foo\", { foo: \"bar\", bar: 42, arr: [ 1, 2, 3, \"foo\", {} ] } ], bigobject: { foo: [ 1, 2, 3, \"foo\", {} ], bar: 42, a: {b: { c: 42 }}, foobar: \"FooBar\" } };\n```\n\n\n### With 100 fixed-spaces:\n\n```js\nconsole.log(beautify(obj, null, 2, 100));\n```\n\n```json\n{\n  \"str\": \"Hello World\",\n  \"num\": 42,\n  \"smallarray\": [ 1, 2, 3, \"foo\", {} ],\n  \"smallobject\": { \"foo\": \"bar\", \"bar\": 42 },\n  \"bigarray\": [ 1, 2, 3, \"foo\", { \"foo\": \"bar\", \"bar\": 42, \"arr\": [ 1, 2, 3, \"foo\", {} ] } ],\n  \"bigobject\": { \"foo\": [ 1, 2, 3, \"foo\", {} ], \"bar\": 42, \"a\": { \"b\": { \"c\": 42 } }, \"foobar\": \"FooBar\" }\n}\n```\n\n### With 80 fixed-spaces:\n\n```js\nconsole.log(beautify(obj, null, 2, 80));\n```\n\n```json\n{\n  \"str\": \"Hello World\",\n  \"num\": 42,\n  \"smallarray\": [ 1, 2, 3, \"foo\", {} ],\n  \"smallobject\": { \"foo\": \"bar\", \"bar\": 42 },\n  \"bigarray\": [\n    1,\n    2,\n    3,\n    \"foo\",\n    { \"foo\": \"bar\", \"bar\": 42, \"arr\": [ 1, 2, 3, \"foo\", {} ] }\n  ],\n  \"bigobject\": {\n    \"foo\": [ 1, 2, 3, \"foo\", {} ],\n    \"bar\": 42,\n    \"a\": { \"b\": { \"c\": 42 } },\n    \"foobar\": \"FooBar\"\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgre%2Fjson-beautify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgre%2Fjson-beautify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgre%2Fjson-beautify/lists"}