{"id":22070554,"url":"https://github.com/bconnorwhite/stringify-json-object","last_synced_at":"2026-05-09T00:39:13.259Z","repository":{"id":65338756,"uuid":"290937941","full_name":"bconnorwhite/stringify-json-object","owner":"bconnorwhite","description":"Stringify and format a JSON object.","archived":false,"fork":false,"pushed_at":"2023-01-24T18:27:08.000Z","size":332,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T11:20:06.882Z","etag":null,"topics":["json","node","nodejs","stringify","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/bconnorwhite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-28T03:06:06.000Z","updated_at":"2023-01-18T00:04:39.000Z","dependencies_parsed_at":"2023-02-14T00:30:55.323Z","dependency_job_id":null,"html_url":"https://github.com/bconnorwhite/stringify-json-object","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fstringify-json-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fstringify-json-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fstringify-json-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bconnorwhite%2Fstringify-json-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bconnorwhite","download_url":"https://codeload.github.com/bconnorwhite/stringify-json-object/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245153280,"owners_count":20569400,"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":["json","node","nodejs","stringify","typescript"],"created_at":"2024-11-30T20:17:11.674Z","updated_at":"2026-05-09T00:39:08.241Z","avatar_url":"https://github.com/bconnorwhite.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--BEGIN HEADER--\u003e\n\u003cdiv id=\"top\" align=\"center\"\u003e\n  \u003ch1\u003estringify-json-object\u003c/h1\u003e\n  \u003ca href=\"https://npmjs.com/package/stringify-json-object\"\u003e\n    \u003cimg alt=\"NPM\" src=\"https://img.shields.io/npm/v/stringify-json-object.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/bconnorwhite/stringify-json-object\"\u003e\n    \u003cimg alt=\"TypeScript\" src=\"https://img.shields.io/github/languages/top/bconnorwhite/stringify-json-object.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/bconnorwhite/stringify-json-object?branch=master\"\u003e\n    \u003cimg alt=\"Coverage Status\" src=\"https://img.shields.io/coveralls/github/bconnorwhite/stringify-json-object.svg?branch=master\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cblockquote align=\"center\"\u003eStringify and format a JSON object.\u003c/blockquote\u003e\n\n\u003cbr /\u003e\n\n_If I should maintain this repo, please ⭐️_\n\u003ca href=\"https://github.com/bconnorwhite/stringify-json-object\"\u003e\n  \u003cimg align=\"right\" alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/bconnorwhite/stringify-json-object?label=%E2%AD%90%EF%B8%8F\u0026style=social\"\u003e\n\u003c/a\u003e\n\n_DM me on [Twitter](https://twitter.com/bconnorwhite) if you have questions or suggestions._\n\u003ca href=\"https://twitter.com/bconnorwhite\"\u003e\n  \u003cimg align=\"right\" alt=\"Twitter\" src=\"https://img.shields.io/twitter/url?label=%40bconnorwhite\u0026style=social\u0026url=https%3A%2F%2Ftwitter.com%2Fbconnorwhite\"\u003e\n\u003c/a\u003e\n\n---\n\u003c!--END HEADER--\u003e\n\n## Installation\n\n```sh\nyarn add stringify-json-object\n```\n\n```sh\nnpm install stringify-json-object\n```\n\n```sh\npnpm add stringify-json-object\n```\n\n## Usage\n\nThe `stringify` function works like `JSON.stringify`:\n\n```ts\nimport stringify from \"stringify-json-object\";\n\nstringify(true); // 'true'\nstringify(1); // '1'\nstringify(\"foo\"); // '\"foo\"'\nstringify({ foo: \"bar\" }); // '{\"foo\":\"bar\"}'\nstringify({ foo: \"bar\", missing: undefined }); // '{\"foo\":\"bar\"}'\n\n```\n\nThe `stringify` function also accepts an options argument, to easily format the output:\n\n```ts\nimport stringify from \"stringify-json-object\";\n\nstringify({ foo: \"bar\" }, { pretty: true }); // '{\\n  \"foo\": \"bar\"\\n}\"\n```\n\nAdditionally, primitives resolve to typed string literals:\n```ts\nimport stringify from \"stringify-json-object\";\n\nstringify(true); // \"true\"\nstringify(1); // \"1\"\nstringify(\"foo\"); // \"\\\"foo\\\"\"\nstringify({ foo: \"bar\" }); // string\n\n```\n\n\u003c!--BEGIN FOOTER--\u003e\n\n\u003cbr /\u003e\n\n\u003ch2 id=\"dependencies\"\u003eDependencies\u003ca href=\"https://www.npmjs.com/package/stringify-json-object?activeTab=dependencies\"\u003e\u003cimg align=\"right\" alt=\"dependencies\" src=\"https://img.shields.io/librariesio/release/npm/stringify-json-object.svg\"\u003e\u003c/a\u003e\u003c/h2\u003e\n\n- [types-json](https://www.npmjs.com/package/types-json): Type checking for JSON values\n\n\u003cbr /\u003e\n\n\u003ch3\u003eDev Dependencies\u003c/h3\u003e\n\n- [autorepo](https://www.npmjs.com/package/autorepo): Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.\n\n\u003cbr /\u003e\n\n\u003ch2 id=\"license\"\u003eLicense \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg align=\"right\" alt=\"license\" src=\"https://img.shields.io/npm/l/stringify-json-object.svg\"\u003e\u003c/a\u003e\u003c/h2\u003e\n\n[MIT](https://opensource.org/licenses/MIT)\n\u003c!--END FOOTER--\u003e\n\n\u003cbr /\u003e\n\n## Related Packages\n\n- [parse-json-object](https://www.npmjs.com/package/parse-json-object): Parse a typed JSON object\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbconnorwhite%2Fstringify-json-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbconnorwhite%2Fstringify-json-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbconnorwhite%2Fstringify-json-object/lists"}