{"id":20336638,"url":"https://github.com/amireshoon/jstorage","last_synced_at":"2026-05-08T05:54:44.834Z","repository":{"id":56947107,"uuid":"264673632","full_name":"amireshoon/jStorage","owner":"amireshoon","description":"a Light non-framework JSON-BASED storage","archived":false,"fork":false,"pushed_at":"2020-05-19T13:30:10.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-18T03:06:21.725Z","etag":null,"topics":["composer","json","key-value","key-value-store","php","storage","storage-engine"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/amireshoon.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":"2020-05-17T13:31:31.000Z","updated_at":"2021-01-21T12:20:16.000Z","dependencies_parsed_at":"2022-08-21T03:10:28.402Z","dependency_job_id":null,"html_url":"https://github.com/amireshoon/jStorage","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/amireshoon%2FjStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amireshoon%2FjStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amireshoon%2FjStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amireshoon%2FjStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amireshoon","download_url":"https://codeload.github.com/amireshoon/jStorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241859673,"owners_count":20032318,"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":["composer","json","key-value","key-value-store","php","storage","storage-engine"],"created_at":"2024-11-14T21:06:13.896Z","updated_at":"2025-12-03T08:05:54.743Z","avatar_url":"https://github.com/amireshoon.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jStorage - a Light non-framework JSON-BASED storage\r\n[![GitHub issues](https://img.shields.io/github/issues/Naereen/StrapDown.js.svg)](https://github.com/amireshoon/jStorage/issues/)\r\n[![Awesome Badges](https://img.shields.io/badge/badges-awesome-green.svg)](https://github.com/amireshoon/jStorage)\r\n\r\njStorage is JSON-BASED small key value storage for more porductive.\r\n\r\n  - No frameworks used\r\n  - .gitignore option\r\n  - Light and ready to go\r\n\r\n### Installation\r\n\r\nInstall using composer:\r\n\r\n```php\r\n$ composer require amirhwsin/jstorage\r\n```\r\nit's highly recommended installing using composer but if you need other way to go you can download project from git or simply clone it.\r\n```sh\r\n$ git clone https://github.com/amireshoon/jStorage.git\r\n```\r\n\r\n### Methods\r\n\r\nThere is no index or primary key for fetching data.\r\njStorage uses `jStorage_key` for indexing data.\r\nYou will have custom `key` paramteres for customizing storage.\r\n\r\nSome methods you have to know about:\r\n\r\n| Methods | Description |\r\n| ------ | ------ |\r\n| add | Insert new data set in storage |\r\n| update | Update exists data set by `key`|\r\n| remove | Remove exists data set by `key` |\r\n| get | Get exists data set by `key` |\r\n| commit | Commit all changes that you made |\r\n\r\n\r\n### Usage\r\n\r\nUse this code to load class:\r\n```php\r\nuse jStorage;\r\n```\r\nIf you want to git ignore your storage then use like this:\r\nFirst parameter is where storage(JSON file) stored.\r\nAnd the second one is for `.gitignore` file path.\r\n```php\r\n$jStorage = new jStorage\\App('storage_folder/db.json', __DIR__ .  '/.gitignore');\r\n```\r\nOtherwise use this:\r\n```php\r\n $jStorage = new jStorage\\App('storage_folder/db.json');\r\n```\r\n\r\n# Add\r\nFor adding object to storage use like this:\r\n\r\narray usage (Will compiled to json):\r\n```php\r\n $jStorage-\u003eadd('username',[\r\n     'password' =\u003e 'JG^RWY',\r\n     'first_last_name' =\u003e 'Amirhossein Meydani',\r\n     'email' =\u003e 'amirhwsin@outlook.com'\r\n ]);\r\n```\r\nstring usage:\r\n```php\r\n$jStorage-\u003eadd('username','amirhossein');\r\n```\r\nint usage:\r\n```php\r\n$jStorage-\u003eadd('phone_number',19248124);\r\n```\r\nbool usage:\r\n```php\r\n$jStorage-\u003eadd('is_prefect_day', true);\r\n```\r\n\r\nAt the end **do not forget to commit** like this:\r\n```php\r\n$jStorage-\u003ecommt();\r\n```\r\n\r\n# Get\r\nTo get a data set you have to use `key` that you used to store data set.\r\nYou can get data set like this:\r\n```php\r\n$is_prefect_day = $jStorage-\u003eget('is_prefect_day');\r\n```\r\n# Update\r\nFor update a data set you have to use `key` that you store data set.\r\n```php\r\n$jStorage-\u003eupdate('key','new value');\r\n```\r\nAt the end **do not forget to commit** like this:\r\n```php\r\n$jStorage-\u003ecommt();\r\n```\r\n# Remove\r\n```php\r\n$jStorage-\u003eremove('key');\r\n```\r\nAt the end **do not forget to commit** like this:\r\n```php\r\n$jStorage-\u003ecommt();\r\n```\r\nLicense\r\n----\r\nMIT License\r\n\r\nCopyright (c) 2020 Amirhossein Meydani\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n\r\n\r\n\r\n**Feel free to contribute**\r\n\r\n[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famireshoon%2Fjstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famireshoon%2Fjstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famireshoon%2Fjstorage/lists"}