{"id":17049096,"url":"https://github.com/toddself/levelsync","last_synced_at":"2025-04-30T17:44:06.791Z","repository":{"id":11174915,"uuid":"13550735","full_name":"toddself/levelsync","owner":"toddself","description":"A Backbone.Sync replacement using leveldb","archived":false,"fork":false,"pushed_at":"2014-03-06T15:52:42.000Z","size":258,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-26T12:22:21.131Z","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/toddself.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":"2013-10-14T02:19:06.000Z","updated_at":"2019-05-30T06:10:18.000Z","dependencies_parsed_at":"2022-08-30T20:51:51.025Z","dependency_job_id":null,"html_url":"https://github.com/toddself/levelsync","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Flevelsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Flevelsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Flevelsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toddself%2Flevelsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toddself","download_url":"https://codeload.github.com/toddself/levelsync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251753689,"owners_count":21638367,"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-10-14T09:53:50.512Z","updated_at":"2025-04-30T17:44:06.751Z","avatar_url":"https://github.com/toddself.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![build status](https://secure.travis-ci.org/toddself/levelsync.png)](http://travis-ci.org/toddself/levelsync)\n\n#LevelSync\nLevelSync is a [`Backbone.Model`](http://backbonejs.org/#Model) replacement which uses [LevelDB](http://code.google.com/p/leveldb) via the [levelup](https://github.com/rvagg/node-levelup) interface.\n\n## Installation\n```\nnpm install --save levelsync\n```\n\n## Usage\n```\nvar levelup = require('level');\nvar db = levelup('./path/to/db');\nvar Backbone = require('backbone');\nBackbone.sync = require('levelsync')(db);\n\nvar StatBlock = Backbone.Model.extend({\n  defaults: {\n    'str': 8,\n    'con': 8,\n    'wis': 8,\n    'dex': 8,\n    'int': 8,\n    'chr': 8\n  }\n});\n\nvar myCharacter = new StatBlock();\nmyCharacter.set('str', 18);\nmyCharacter.set('name', 'LEROY JENKINS');\nmyCharacter.save(myCharacter.toJSON(), {cb: function(err){\n  if(!err) console.log(myCharacter.get('name'), 'was saved');\n}});\n\n// or\nvar promise = myCharacter.save();\npromise.when(function(){\n  console.log(myCharacter.get('name'), 'was saved');\n});\n```\n## Changes from Backbone\nThe `options` hash accepts a new parameter, `cb`. This callback will be use for all the level operations if set. It's signature should be `(err, data)`. If this is not set, a [`q`](https://github.com/kriskowal/q) promise will be returned instead.\n\n## License\nLevelSync is copyright (c) 2013 Todd Kennedy. Usage is provided under the terms of the [MIT Licence](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Flevelsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoddself%2Flevelsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoddself%2Flevelsync/lists"}