{"id":19916812,"url":"https://github.com/srackham/backbone-localstorage-sync","last_synced_at":"2025-07-06T10:02:45.852Z","repository":{"id":23940734,"uuid":"27322164","full_name":"srackham/backbone-localstorage-sync","owner":"srackham","description":"A Backbone sync function adapter for persisting Models and Collections to browser LocalStorage.","archived":false,"fork":false,"pushed_at":"2014-12-18T02:03:42.000Z","size":148,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T10:02:40.755Z","etag":null,"topics":[],"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/srackham.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":"2014-11-30T02:38:32.000Z","updated_at":"2018-06-19T02:48:06.000Z","dependencies_parsed_at":"2022-08-06T00:15:29.124Z","dependency_job_id":null,"html_url":"https://github.com/srackham/backbone-localstorage-sync","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/srackham/backbone-localstorage-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srackham%2Fbackbone-localstorage-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srackham%2Fbackbone-localstorage-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srackham%2Fbackbone-localstorage-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srackham%2Fbackbone-localstorage-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srackham","download_url":"https://codeload.github.com/srackham/backbone-localstorage-sync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srackham%2Fbackbone-localstorage-sync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263882251,"owners_count":23524457,"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-12T21:47:41.438Z","updated_at":"2025-07-06T10:02:45.834Z","avatar_url":"https://github.com/srackham.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backbone LocalStorage sync adaptor\n\nA Backbone sync function adapter for persisting Models and Collections to\nbrowser LocalStorage.\n\nBased on [example in Backbone Fundamentals\nbook](https://github.com/addyosmani/backbone-fundamentals/blob/gh-pages/practicals/modular-todo-app/js/libs/backbone/localstorage.js).\n\nModifications:\n\n- Converted to a Node compatible module for use by Browserify/Webpack.\n- No dependencies (Backbone or Underscore).\n- You can specify separate stores for each Model and Collection.\n\n\n## Installing\nInstall module with `npm install backbone-localstorage-sync`\n\n\n## Using\nGlobally (one store for all models and collections), for example:\n\n    var BackboneLocalStorageSync = require('backbone-localstorage-sync');\n    Backbone.sync = BackboneLocalStorageSync('flux-backbone-todo');\n\nStorage a per Model/Collection class basis, for example:\n\n    var BackboneLocalStorageSync = require('backbone-localstorage-sync');\n\n    var TodoItem = Backbone.Model.extend({\n      sync: BackboneLocalStorageSync('flux-backbone-todo'),\n    });\n\n    var TodoStore = Backbone.Collection.extend({\n      model: TodoItem,\n      sync: BackboneLocalStorageSync('flux-backbone-todo'),\n    });\n\nThese examples assume you are bundling your app with a CommonJS comaptible tool such as Webpack or Browserify.\n\n**NOTE:** Because LocalStorage requests execute synchronously the fetch, save\nand destroy APIs are also synchronous (differs from the usual async behavior of\nclient-server adapters).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrackham%2Fbackbone-localstorage-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrackham%2Fbackbone-localstorage-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrackham%2Fbackbone-localstorage-sync/lists"}