{"id":17913639,"url":"https://github.com/faressoft/appstorage","last_synced_at":"2025-03-23T23:30:41.274Z","repository":{"id":57182938,"uuid":"140208986","full_name":"faressoft/appstorage","owner":"faressoft","description":"LocalStorage for Node.js, auto syncing for objects with JSON files using the Proxy API","archived":false,"fork":false,"pushed_at":"2018-07-15T13:35:43.000Z","size":33,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T00:16:59.047Z","etag":null,"topics":["appstorage","config","files","json","localstorage","preferences","proxy","sync"],"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/faressoft.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":"2018-07-08T23:11:17.000Z","updated_at":"2021-07-03T18:43:15.000Z","dependencies_parsed_at":"2022-09-14T06:10:28.938Z","dependency_job_id":null,"html_url":"https://github.com/faressoft/appstorage","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faressoft%2Fappstorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faressoft%2Fappstorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faressoft%2Fappstorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faressoft%2Fappstorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faressoft","download_url":"https://codeload.github.com/faressoft/appstorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186423,"owners_count":20574550,"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":["appstorage","config","files","json","localstorage","preferences","proxy","sync"],"created_at":"2024-10-28T19:52:57.484Z","updated_at":"2025-03-23T23:30:40.943Z","avatar_url":"https://github.com/faressoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"/logo.png?raw=true\" alt=\"AppStorage Logo\"/\u003e\u003c/p\u003e\n\n# AppStorage\n\n[![npm](https://img.shields.io/npm/v/appstoragejs.svg)](https://www.npmjs.com/package/appstoragejs)\n[![npm](https://img.shields.io/npm/l/appstoragejs.svg)](https://github.com/faressoft/appstoragejs/blob/master/LICENSE)\n\n\u003e LocalStorage for Node.js, auto syncing for objects with JSON files using the Proxy API\n\n# Table of Contents  \n\n* [Installation](#installation)\n* [Usage](#usage)\n* [License](#license)\n\n## Installation\n\n```\nnpm install --save appstoragejs\n```\n\n## Introduction\n\nUse the ES6 [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) API to set traps to recursively watch changes on an object and sync it automatically with a `JSON` file within the current event loop phase using `fs.writeFileSync`.\n\n* `Good for` CLI tools, storing configs, user preferences, cached data, states, etc.\n* `Bad for` production applications, scalable or high-performance applications, web servers, etc.\n\n## Usage\n\n* The data are synced automatically with `data.json` on every change within the current event loop phase.\n* The data are read automatically from `data.json` when the app starts.\n* Nothing to worry about just deal with the object as any normal object.\n\n```js\nvar AppStorage = require('appstoragejs');\n\n// Create a new AppStorage\nvar appStorage = new AppStorage('data.json');\n\n// Just do anything with your object !\nappStorage.name = 'Bob';\nappStorage.age = 13;\nappStorage.records = [1,2,3,4];\n```\n\nYou can define your AppStorage object as a `global` object to be used anywhere within your app.\n\n```js\nglobal.appStorage = appStorage;\n```\n\n# License\n\nThis project is under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaressoft%2Fappstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaressoft%2Fappstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaressoft%2Fappstorage/lists"}