{"id":14978173,"url":"https://github.com/socketio/socket.io-json-parser","last_synced_at":"2025-10-19T11:30:46.610Z","repository":{"id":45010489,"uuid":"89645891","full_name":"socketio/socket.io-json-parser","owner":"socketio","description":"socket.io parser based on JSON.stringify / JSON.parse","archived":false,"fork":false,"pushed_at":"2023-09-06T17:59:52.000Z","size":238,"stargazers_count":14,"open_issues_count":7,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T14:58:32.655Z","etag":null,"topics":["json","socket-io","socket-io-parser"],"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/socketio.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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}},"created_at":"2017-04-27T22:36:29.000Z","updated_at":"2024-10-06T20:51:43.000Z","dependencies_parsed_at":"2024-01-23T21:40:09.750Z","dependency_job_id":null,"html_url":"https://github.com/socketio/socket.io-json-parser","commit_stats":null,"previous_names":["darrachequesne/socket.io-json-parser"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-json-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-json-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-json-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socketio%2Fsocket.io-json-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socketio","download_url":"https://codeload.github.com/socketio/socket.io-json-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237116698,"owners_count":19258302,"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":["json","socket-io","socket-io-parser"],"created_at":"2024-09-24T13:56:59.197Z","updated_at":"2025-10-19T11:30:46.010Z","avatar_url":"https://github.com/socketio.png","language":"JavaScript","readme":"\n# socket.io-json-parser\n\nAn alternative to the default [socket.io-parser](https://github.com/socketio/socket.io-parser), encoding and decoding packets with `JSON.parse / stringify`.\n\nWith that parser, binary data (ArrayBuffer / Buffer / Blob / File) is not supported.\n\nPlease note that you MUST use the parser on both sides (server \u0026 client).\n\nSee also:\n\n- the default parser: https://github.com/socketio/socket.io-parser\n- a parser based on msgpack: https://github.com/darrachequesne/socket.io-msgpack-parser\n\n## Usage\n\n```js\nconst io = require('socket.io');\nconst ioc = require('socket.io-client');\nconst customParser = require('socket.io-json-parser');\n\nconst server = io(PORT, {\n  parser: customParser\n});\n\nconst socket = ioc('ws://localhost:' + PORT, {\n  parser: customParser\n});\n\nsocket.on('connect', () =\u003e {\n  socket.emit('hello');\n});\n```\n\n## Format\n\n`socket.emit('hello', 'you')` will create the following packet:\n\n```json\n{\n  \"type\": 2,\n  \"nsp\": \"/\",\n  \"data\": [\"hello\", \"you\"]\n}\n```\n\nwhich will be encoded by the parser as:\n\n`{\"type\":2,\"nsp\":\"/\",\"data\":[\"hello\",\"you\"]}`\n\nMore information about the exchange protocol can be found [here](https://github.com/socketio/socket.io-protocol).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-json-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocketio%2Fsocket.io-json-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocketio%2Fsocket.io-json-parser/lists"}