{"id":20576641,"url":"https://github.com/hobbyquaker/persist-json","last_synced_at":"2026-04-25T05:40:07.455Z","repository":{"id":57322315,"uuid":"66939718","full_name":"hobbyquaker/persist-json","owner":"hobbyquaker","description":"Persist an object as plain JSON file","archived":false,"fork":false,"pushed_at":"2017-09-28T18:59:56.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T07:36:26.405Z","etag":null,"topics":["json","node-module","object","persist"],"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/hobbyquaker.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":"2016-08-30T12:45:39.000Z","updated_at":"2017-09-29T15:38:28.000Z","dependencies_parsed_at":"2022-08-25T21:01:16.682Z","dependency_job_id":null,"html_url":"https://github.com/hobbyquaker/persist-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fpersist-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fpersist-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fpersist-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fpersist-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobbyquaker","download_url":"https://codeload.github.com/hobbyquaker/persist-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242196397,"owners_count":20087771,"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-module","object","persist"],"created_at":"2024-11-16T05:46:31.699Z","updated_at":"2026-04-25T05:40:07.428Z","avatar_url":"https://github.com/hobbyquaker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# persist-json\n\n[![NPM version](https://badge.fury.io/js/persist-json.svg)](http://badge.fury.io/js/persist-json)\n[![Dependency Status](https://img.shields.io/gemnasium/hobbyquaker/persist-json.svg?maxAge=2592000)](https://gemnasium.com/github.com/hobbyquaker/persist-json)\n[![Build Status](https://travis-ci.org/hobbyquaker/persist-json.svg?branch=master)](https://travis-ci.org/hobbyquaker/persist-json)\n[![Coverage Status](https://coveralls.io/repos/github/hobbyquaker/persist-json/badge.svg?branch=master)](https://coveralls.io/github/hobbyquaker/persist-json?branch=master)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![License][mit-badge]][mit-url]\n\n\u003e Persist an object as plain JSON file\n\n## Usage\n\n```npm install persist-json```\n\n```Javascript\nvar pjson = require('persist-json')('project-name');\n```\n\nThe path where the JSON file will be stored is determinated by the [persist-path](https://github.com/hobbyquaker/persist-path) module.\n\n## Methods\n\nBoth methods save and load can be used either asynchronous (by providing a callback as last param) or synchronous.\nOn asynchronous usage the callback is called with the params of `fs.writeFileSync` respectively `fs.readFileSync`.\n\n#### *undefined* save( *string* filename , *object* content [, *function* callback ] )\n\n#### *object|undefined* load( *string* filename [, *function* callback ] )\n\n\n## Secure mode\n\n```Javascript\nvar pjson = require('persist-json')('project-name', {secure: true});\n```\n\nSecure mode saves the file first with suffixed `.new`, then renames an eventually existing `file` to `file.bak` and then\nrenames the `file.new` file to `file`.\n\n\n# License\n\nMIT (c) 2016-2017 [Sebastian Raff](https://github.com/hobbyquaker)\n\n[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat\n[mit-url]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Fpersist-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobbyquaker%2Fpersist-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Fpersist-json/lists"}