{"id":18096302,"url":"https://github.com/bredele/store-mirror","last_synced_at":"2025-07-02T06:02:55.755Z","repository":{"id":15315050,"uuid":"18045030","full_name":"bredele/store-mirror","owner":"bredele","description":"Web socket mirroring plugin for datastore","archived":false,"fork":false,"pushed_at":"2014-04-23T22:20:00.000Z","size":184,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-18T13:09:04.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"stevenleeg/geemusic","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bredele.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-23T22:21:40.000Z","updated_at":"2014-08-07T12:38:26.000Z","dependencies_parsed_at":"2022-08-25T20:21:09.206Z","dependency_job_id":null,"html_url":"https://github.com/bredele/store-mirror","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bredele/store-mirror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Fstore-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Fstore-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Fstore-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Fstore-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bredele","download_url":"https://codeload.github.com/bredele/store-mirror/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bredele%2Fstore-mirror/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261789227,"owners_count":23209774,"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-31T19:13:24.767Z","updated_at":"2025-07-02T06:02:55.691Z","avatar_url":"https://github.com/bredele.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# store-mirror\n\n  Web socket mirroring plugin for **[datastore](http://github.com/bredele/datastore)**\n\n## Installation\n\n  Install with [component](http://component.io):\n\n    $ component install bredele/store-mirror\n\n  Install with [nodejs](http://nodejs.org):\n\n    $ component install bredele/store-mirror\n\n  \u003e browserify is currently not supported\n\n\n## Concept\n\nThis plugin allows you to map a **[datastore](http://github.com/bredele/store)** in client and server side. If a change occurs in server side, the store in client side will immediately be updated and vice versa.\n\n`mirror` is also really simple (see [test](https://github.com/bredele/store-mirror/tree/master/test)) and its API is the same in both sides:\n\n### Client\n\n```js\nvar mirror = require('store-mirror');\n\nstore.use(mirror('test'));\n```\n\n \u003e `mirror` uses [socket.io](https://github.com/LearnBoost/socket.io) as a transport layer.\n\n### Server\n\n```js\nvar mirror = require('store-mirror');\nvar io = require('socket.io').listen(80);\n\nstore.use(mirror('test', io));\n```\n\n### Have fun on both sides\n\nSee [store](http://github.com/bredele/store) for more information.\n\n```js\nstore.set('name', 'bredele');\n```\n\n## API\n\n### mirror(channel, origin)\n\n `mirror` opens a web socket `channel` and redirect every messages through this channel.\n\n#### browser\n\n In client slide, `origin` is optional and should be your websocket server's address (window origin by default):\n\n```js\nstore.use(mirror('test', 'http://localhost'));\n```\n\n  \u003e don't forget to include the socket.io script in your document.\n\n#### nodejs\n\n In server slide, `origin` is mandatory and is socket.io itself:\n\n```js\nvar mirror = require('store-mirror');\nvar io = require('socket.io').listen(80);\n\nstore.use(mirror('test', io));\n```\n\n\n## License\n\n  The MIT License (MIT)\n\n  Copyright (c) 2014 \u003ccopyright holders\u003e\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbredele%2Fstore-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbredele%2Fstore-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbredele%2Fstore-mirror/lists"}