{"id":30060097,"url":"https://github.com/tiaanduplessis/json-reader-writer","last_synced_at":"2025-08-08T01:42:05.556Z","repository":{"id":57285106,"uuid":"80362222","full_name":"tiaanduplessis/json-reader-writer","owner":"tiaanduplessis","description":"Read or write to a JSON file synchronously","archived":false,"fork":false,"pushed_at":"2019-10-23T18:15:29.000Z","size":53,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T16:20:11.867Z","etag":null,"topics":["json","json-reader-writer"],"latest_commit_sha":null,"homepage":"","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/tiaanduplessis.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}},"created_at":"2017-01-29T18:05:06.000Z","updated_at":"2022-05-30T09:48:09.000Z","dependencies_parsed_at":"2022-09-19T23:04:05.865Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/json-reader-writer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/json-reader-writer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fjson-reader-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fjson-reader-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fjson-reader-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fjson-reader-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/json-reader-writer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Fjson-reader-writer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352341,"owners_count":24402672,"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-07T02:00:09.698Z","response_time":73,"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":["json","json-reader-writer"],"created_at":"2025-08-08T01:41:50.557Z","updated_at":"2025-08-08T01:42:05.537Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e📘 json-reader-writer ✍️\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eRead or write to a JSON file synchronously\u003c/strong\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://npmjs.org/package/json-reader-writer\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/v/json-reader-writer.svg?style=flat-square\" alt=\"NPM version\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://npmjs.org/package/json-reader-writer\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/json-reader-writer.svg?style=flat-square\" alt=\"Downloads\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/feross/standard\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\" alt=\"Standard\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/tiaanduplessis/json-reader-writer\"\u003e\n      \u003cimg src=\"https://img.shields.io/travis/tiaanduplessis/json-reader-writer/master.svg?style=flat-square\" alt=\"Travis build\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/RichardLitt/standard-readme)\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square\" alt=\"Standard Readme\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://badge.fury.io/gh/tiaanduplessis%2Fjson-reader-writer\"\u003e\n      \u003cimg src=\"https://badge.fury.io/gh/tiaanduplessis%2Fjson-reader-writer.svg?style=flat-square\" alt=\"GitHub version\" /\u003e\n   \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003cli\u003e\u003ca href=\"#install\"\u003eInstall\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#api\"\u003eAPI\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#contribute\"\u003eContribute\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n\u003c/details\u003e\n\n## Install\n\nNote that this module Uses JSON.stringify, which can [run out of memory](https://github.com/nodejs/node/issues/13465). If the data you need to write is large, consider using a streaming JSON writer, such as @mbostock's [json-write](https://www.npmjs.com/package/json-write). Otherwise, go ahead and...\n\n```sh\n$ npm install --save json-reader-writer\n```\n\n```sh\n$ yarn add json-reader-writer\n```\n\n## Usage\n\n```js\nconst {readJSON, writeJson} = require('json-reader-writer')\nconst filePath = 'foo.json'\nconst obj = {\n  foo: 1,\n  bar: 2,\n  baz: 2\n}\n\nconsole.log(writeJson(filePath, obj)) // true if successful\nconsole.log(readJSON(filePath)) // { foo: 1, bar: 2, baz: 2 }\n\n```\n\n## API\n\n### readJSON(filename)\n\nTakes the filename of the JSON file you want to read from as argument. Defaults to `file.json` if  no `filename` provided.\n\n### writeJSON(filename, objectToWrite)\n\nTakes the filename of the JSON file you want to write to and the valid object you want to write as arguments.\n\n\n## Contribute\n\nContributions are welcome. Please open up an issue or create PR if you would like to help out.\n\nNote: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fjson-reader-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Fjson-reader-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Fjson-reader-writer/lists"}