{"id":17483746,"url":"https://github.com/creationix/msgpack-es","last_synced_at":"2025-04-10T02:43:41.219Z","repository":{"id":66014232,"uuid":"66031039","full_name":"creationix/msgpack-es","owner":"creationix","description":"Msgpack implemented in pure ecmascript.","archived":false,"fork":false,"pushed_at":"2016-08-30T23:51:52.000Z","size":10,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T03:27:07.840Z","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/creationix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-18T21:11:04.000Z","updated_at":"2023-09-08T17:13:51.000Z","dependencies_parsed_at":"2023-03-10T23:28:27.141Z","dependency_job_id":null,"html_url":"https://github.com/creationix/msgpack-es","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"2947061e6a944e1265e7bf3236e3dc84cf87c59a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fmsgpack-es","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fmsgpack-es/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fmsgpack-es/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fmsgpack-es/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/msgpack-es/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248145370,"owners_count":21055113,"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-19T00:27:18.984Z","updated_at":"2025-04-10T02:43:41.206Z","avatar_url":"https://github.com/creationix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# msgpack-es\n\nMsgpack implemented in pure ECMAScript.\n\n## Usage\n\nThese files are written using ES6 modules.  I consume them using [rollup][].\n\nFor example:\n\n```js\nimport { encode, decode } from \"./msgpack\";\n\n// Encode a value to Uint8Array holding msgpack\nlet encoded = encode([1,2,3]);\n\n// Decode back to a value\nlet decoded = decode(encoded);\n\n```\n\n### Custom Types\n\nMsgpack supports up to 128 custom, application defined, types.  To register a new\ntype you need to provide a constructor function and encode/decode functions.\n\nFor example, here is how you would serialize `RegExp` instances.\n\n```js\nimport { register, encode, decode } from \"./msgpack\";\n\nregister(1, RegExp, encodeRegExp, decodeRegExp);\nfunction encodeRegExp(reg) {\n  // this needs to return a Uint8Array that will be stored.  The format can be\n  // anything, but here we're reusing msgpack for convienience.\n  return encode([reg.source,reg.flags]);\n}\nfunction decodeRegExp(buf) {\n  let opts = decode(buf);\n  return new RegExp(opts[0], opts[1]);\n}\n```\n\n## Tests\n\nRun tests with [rollup][] and [node][].\n\n```sh\nrollup test.js | node\n```\n\n[rollup]: http://rollupjs.org\n[node]: https://nodejs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fmsgpack-es","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Fmsgpack-es","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fmsgpack-es/lists"}