{"id":13998553,"url":"https://github.com/iwoplaza/typed-binary","last_synced_at":"2025-09-05T19:57:23.130Z","repository":{"id":40277401,"uuid":"446966224","full_name":"iwoplaza/typed-binary","owner":"iwoplaza","description":"Describe binary structures with full TypeScript support. Encode and decode into pure JavaScript objects.","archived":false,"fork":false,"pushed_at":"2024-10-29T08:47:33.000Z","size":3405,"stargazers_count":101,"open_issues_count":7,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T09:56:47.023Z","etag":null,"topics":["binary","decoding","encoding","ts","typescript"],"latest_commit_sha":null,"homepage":"https://iwoplaza.github.io/typed-binary/","language":"TypeScript","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/iwoplaza.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":"2022-01-11T20:09:48.000Z","updated_at":"2024-10-29T08:47:14.000Z","dependencies_parsed_at":"2024-01-15T19:45:01.681Z","dependency_job_id":"d999182d-b29d-4d61-9f64-56ec22f26a60","html_url":"https://github.com/iwoplaza/typed-binary","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"b9c9f262c178f5e771795c90b82824b025f1cb33"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwoplaza%2Ftyped-binary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwoplaza%2Ftyped-binary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwoplaza%2Ftyped-binary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwoplaza%2Ftyped-binary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwoplaza","download_url":"https://codeload.github.com/iwoplaza/typed-binary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227245185,"owners_count":17753239,"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":["binary","decoding","encoding","ts","typescript"],"created_at":"2024-08-09T19:01:46.566Z","updated_at":"2024-11-30T00:31:43.728Z","avatar_url":"https://github.com/iwoplaza.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![typed binary (light mode)](/docs/media/logo-light.svg#gh-light-mode-only)\n![typed binary (dark mode)](/docs/media/logo-dark.svg#gh-dark-mode-only)\n\nDescribe binary structures with full TypeScript support.\n\n[Website](https://iwoplaza.github.io/typed-binary) — [Documentation](https://iwoplaza.github.io/typed-binary/guides/getting-started)\n\n![Basic Type and Documentation Inference](/docs/media/code-showcase-dark.svg#gh-dark-mode-only)\n![Basic Type and Documentation Inference](/docs/media/code-showcase-light.svg#gh-light-mode-only)\n\n\u003c!-- https://ray.so/#code=aW1wb3J0IGJpbiBmcm9tICd0eXBlZC1iaW5hcnknOwoKLyogREVGSU5FICovCgpjb25zdCBWZWMzZiA9IGJpbi50dXBsZU9mKFtiaW4uZjMyLCBiaW4uZjMyLCBiaW4uZjMyXSk7CmNvbnN0IFBsYXllciA9IGJpbi5vYmplY3QoewogIG5hbWU6IGJpbi5zdHJpbmcsCiAgcG9zaXRpb246IFZlYzNmLAp9KTsKCnR5cGUgUGxheWVyID0gYmluLlBhcnNlZDx0eXBlb2YgUGxheWVyPjsKLy8gICBePyB7IG5hbWU6IHN0cmluZywgcG9zaXRpb246IFtudW1iZXIsIG51bWJlciwgbnVtYmVyXSB9CgovKiBXUklURSAqLwoKY29uc3QgYnVmZmVyID0gbmV3IEFycmF5QnVmZmVyKFBsYXllci5tYXhTaXplKTsKY29uc3Qgd3JpdGVyID0gbmV3IGJpbi5CdWZmZXJXcml0ZXIoYnVmZmVyKTsKClBsYXllci53cml0ZSh3cml0ZXIsIHsKICBuYW1lOiAiSm9obiIsCiAgLy8gRVJST1I6IEV4cGVjdGVkIFtudW1iZXIsIG51bWJlciwgbnVtYmVyXSwgZ290IFtudW1iZXIsIG51bWJlcl0KICBwb3NpdGlvbjogWzEsIDJdLAp9KTsKCi8qIFJFQUQgKi8KCmNvbnN0IHJlYWRlciA9IG5ldyBiaW4uQnVmZmVyUmVhZGVyKGJ1ZmZlcik7CmNvbnN0IHBsYXllciA9IFBsYXllci5yZWFkKHJlYWRlcik7Ci8vICAgIF4_IHsgbmFtZTogc3RyaW5nLCBwb3NpdGlvbjogW251bWJlciwgbnVtYmVyLCBudW1iZXJdIH0\u0026language=typescript\u0026title=main.ts\u0026theme=raindrop\u0026padding=16\u0026width=710\u0026background=false\u0026darkMode=true --\u003e\n\n\u003c/div\u003e\n\n# Why Typed Binary?\n\nSerialize and deserialize typed schemas without the need for redundant interfaces or an external DSL. Schemas themselves define what type they encode and decode, and **the IDE knows it**!\n\n- Since value types are inferred from the schemas themselves, there is a **single source-of-truth**.\n- No external DSL necessary to define the schemas, meaning you have instant feedback without the need to compile the interface definitions.\n- It's platform independent (use it in Node.js as well as in in Browsers)\n- While being made with TypeScript in mind, it also works in plain JavaScript.\n\n# Documentation\n\nThe [typed binary documentation](https://iwoplaza.github.io/typed-binary/guides/getting-started) is a great starting point for learning how to use the library.\n\n# Installation\n\n```sh\n# using npm\nnpm install typed-binary\n\n# using pnpm\npnpm add typed-binary\n\n# using yarn\nyarn add typed-binary\n```\n\n\u003e To properly enable type inference, **TypeScript 4.5** and up is required because of it's newly added [Tail-Recursion Elimination on Conditional Types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types) feature,\n\n# Running examples\n\nThere are a handful of examples provided. To run any one of them make sure to clone the [typed-binary](https://github.com/iwoplaza/typed-binary) repository first, then go into the `examples/` directory. To setup the examples environment, run `pnpm install`, which will fetch dependencies, build the parent project and link it to the 'examples' project.\n\nPick an example that peaks interest, and run `pnpm example:exampleName`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwoplaza%2Ftyped-binary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwoplaza%2Ftyped-binary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwoplaza%2Ftyped-binary/lists"}