{"id":19371118,"url":"https://github.com/qeffects/localstorage","last_synced_at":"2025-10-26T12:33:46.913Z","repository":{"id":261870124,"uuid":"885559792","full_name":"qeffects/localStorage","owner":"qeffects","description":"A simple module for love2d implementing localStorage","archived":false,"fork":false,"pushed_at":"2024-11-08T22:43:49.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T00:36:17.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/qeffects.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T20:36:57.000Z","updated_at":"2024-11-08T22:43:53.000Z","dependencies_parsed_at":"2024-11-08T23:19:15.087Z","dependency_job_id":"56136497-5e9c-4705-b8e3-415d78a2ce50","html_url":"https://github.com/qeffects/localStorage","commit_stats":null,"previous_names":["qeffects/localstorage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeffects%2FlocalStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeffects%2FlocalStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeffects%2FlocalStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeffects%2FlocalStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qeffects","download_url":"https://codeload.github.com/qeffects/localStorage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240493109,"owners_count":19810216,"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":[],"created_at":"2024-11-10T08:17:28.040Z","updated_at":"2025-10-26T12:33:46.839Z","avatar_url":"https://github.com/qeffects.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# localStorage\n\nA recreation of the browser interface localStorage  \nEssentially a simple interface for persistent storage in love2d context  \n\n## Getting started\n\nThe library needs json.lua to function so it's distributed with [pluto](https://github.com/qeffects/pluto-cli)  \nIf your project already uses pluto we can proceed, otherwise follow the instructions linked above  \n  \nAdd this package to your project:  \n`pluto add -n localStorage`  \n  \nThen run  \n`pluto install`  \n  \nAfter everything has completed you can start using localStorage like so:\n\n```lua\nrequire(\"pluto\")\nlocal ls = require(\"localStorage\")\n\nls.set(\"field\", \"value\")\nprint(ls.get(\"field\"))\n```\n\nAnd that's about it, use `.set(fieldName, value)` to set a value (can be number, string, table, etc.)  \nThe value will get automatically saved to the filesystem and available on the next reload\nAnd `.get(fieldName)` to get the persistent value  \n  \nThere's a few more functions for advanced usage:  \n  \n## localStorage.set(fieldName, value)\n  \nSets a field to a value and saves if autoSave is enabled (it is by default)  \n\n[fieldName]: string  \nThe name the field should be named  \n\n[value]: any  \nThe value to set the field to, it can be basic tables (no recursion),  \nor lua primitives like boolean, string, number etc.  \n\n## localStorage.get(fieldName, default)\n\nGets a value from the field \"fieldName\", or returns the default value (if provided)\n\n[fieldName]: string\nThe name of the field to return\n\n[default]: any\nA default value, returned in case the field is not populated\n\n## localStorage.init(autosave, filename)  \n\nManually initates (loads the file) of the library  \nand also allows for some (optional) configuration with the parameters  \n\n[autosave]: boolean  \nWhether to enable autosaving of the storage data to the disk  \n(turn this off if you want to save it manually, e.g. in love.quit)  \n\n[filename]: string  \nUse this to override the default filename  \n\n## localStorage.save()\n\nCall this to save the current state to disk (see init for how to configure and when to use)\n\n\nThis library uses json.lua so you can also `require(\"json-lua\")` and use it yourself (if needed)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqeffects%2Flocalstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqeffects%2Flocalstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqeffects%2Flocalstorage/lists"}