{"id":20572054,"url":"https://github.com/netease/pomelo-cocos2d-js","last_synced_at":"2026-03-09T04:33:01.760Z","repository":{"id":12743754,"uuid":"15416844","full_name":"NetEase/pomelo-cocos2d-js","owner":"NetEase","description":"pomelo-cocos2d-js client","archived":false,"fork":false,"pushed_at":"2016-02-26T06:12:44.000Z","size":307,"stargazers_count":100,"open_issues_count":14,"forks_count":64,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-04-13T23:44:13.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NetEase.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-12-24T10:58:17.000Z","updated_at":"2023-08-25T18:58:05.000Z","dependencies_parsed_at":"2022-09-07T09:31:23.119Z","dependency_job_id":null,"html_url":"https://github.com/NetEase/pomelo-cocos2d-js","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-cocos2d-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-cocos2d-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-cocos2d-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NetEase%2Fpomelo-cocos2d-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NetEase","download_url":"https://codeload.github.com/NetEase/pomelo-cocos2d-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230568591,"owners_count":18246378,"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-16T05:18:10.605Z","updated_at":"2026-03-09T04:33:01.706Z","avatar_url":"https://github.com/NetEase.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#pomelo-cocos2d-js\n\n`pomelo-cocos2d-js` is a library for using in [pomelo](http://pomelo.netease.com/) with [cocos2dx-js](http://cocos2d-x.org/products#cocos2dx-js)  \n\n#Usage\nusing browserify to resolve library dependencies  \n\nadd this library to your project  \n\n```\nnpm install pomelo-cocos2d-js --save\n```\n\nadd to your browserify main.js   \n\n```\nrequire('pomelo-cocos2d-js');\n```\n\nin cocos2d-js you can also add [dist/pomelo-cocos2d-js.js](https://github.com/NetEase/pomelo-cocos2d-js/tree/master/dist/pomelo-cocos2d-js.js) file into ***jsList***  \n\nthen you can use `pomelo` object under the gloal `window` object the same as using in the browser  \n\nsimple chat test  \n```\nvar pomelo = window.pomelo;\n\nvar route = 'gate.gateHandler.queryEntry';\nvar uid = \"uid\";\nvar rid = \"rid\";\nvar username = \"username\";\n\npomelo.init({\n\thost: \"127.0.0.1\",\n\tport: 3014,\n\tlog: true\n}, function() {\n\tpomelo.request(route, {\n\t\tuid: uid\n\t}, function(data) {\n\t\tpomelo.disconnect();\n\t\tpomelo.init({\n\t\t\thost: data.host,\n\t\t\tport: data.port,\n\t\t\tlog: true\n\t\t}, function() {\n\t\t\tvar route = \"connector.entryHandler.enter\";\n\t\t\tpomelo.request(route, {\n\t\t\t\tusername: username,\n\t\t\t\trid: rid\n\t\t\t}, function(data) {\n\t\t\t\tcc.log(JSON.stringify(data));\n\t\t\t\tchatSend();\n\t\t\t});\n\t\t});\n\t});\n});\n\nfunction chatSend() {\n\tvar route = \"chat.chatHandler.send\";\n\tvar target = \"*\";\n\tvar msg = \"msg\"\n\tpomelo.request(route, {\n\t\trid: rid,\n\t\tcontent: msg,\n\t\tfrom: username,\n\t\ttarget: target\n\t}, function(data) {\n\t\tcc.log(JSON.stringify(data));\n\t});\n}\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2012-2015 NetEase, Inc. and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetease%2Fpomelo-cocos2d-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetease%2Fpomelo-cocos2d-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetease%2Fpomelo-cocos2d-js/lists"}