{"id":15102816,"url":"https://github.com/jviotti/jsonbinpack-poc","last_synced_at":"2025-09-27T00:31:45.178Z","repository":{"id":42622993,"uuid":"340405050","full_name":"jviotti/jsonbinpack-poc","owner":"jviotti","description":"This is a PoC. See https://github.com/sourcemeta/jsonbinpack for the production implementation.","archived":true,"fork":false,"pushed_at":"2022-07-22T01:58:21.000Z","size":38243,"stargazers_count":22,"open_issues_count":6,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-09-21T08:02:51.435Z","etag":null,"topics":["binary","deserialization","json","json-schema","jsonschema","serialization","space-efficiency"],"latest_commit_sha":null,"homepage":"https://www.jsonbinpack.org","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jviotti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2021-02-19T15:08:34.000Z","updated_at":"2024-08-19T20:14:28.000Z","dependencies_parsed_at":"2022-09-07T10:40:30.221Z","dependency_job_id":null,"html_url":"https://github.com/jviotti/jsonbinpack-poc","commit_stats":null,"previous_names":["jviotti/jsonbinpack"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviotti%2Fjsonbinpack-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviotti%2Fjsonbinpack-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviotti%2Fjsonbinpack-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviotti%2Fjsonbinpack-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jviotti","download_url":"https://codeload.github.com/jviotti/jsonbinpack-poc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871828,"owners_count":16554457,"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","deserialization","json","json-schema","jsonschema","serialization","space-efficiency"],"created_at":"2024-09-25T19:07:27.137Z","updated_at":"2025-09-27T00:31:37.816Z","avatar_url":"https://github.com/jviotti.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub Actions](https://github.com/jviotti/jsonbinpack/actions/workflows/nodejs.yml/badge.svg?branch=main)](https://github.com/jviotti/jsonbinpack/actions/workflows/nodejs.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n\nJSON BinPack\n============\n\nJSON BinPack is an open-source binary [JSON](https://www.json.org)\nserialization format with a strong focus on space efficiency. It can run in\nschema-driven and schema-less mode to encode any JSON document given a matching\n[JSON Schema 2020-12](http://json-schema.org) definition.\n\n***\n\n**NOTE! This is a prototype pre-production JavaScript-based implementation to prove the\nfeasability of the approach. See https://github.com/sourcemeta/jsonbinpack for the work-in-progress C++\nimplementation.**\n\n***\n\nDocumentation\n-------------\n\n### Installation\n\n```sh\nnpm install --save jsonbinpack\n```\n\n### Example\n\n```javascript\nconst jsonbinpack = require('jsonbinpack')\n\n// Declare a JSON Schema definition\nconst schema = {\n  $schema: 'https://json-schema.org/draft/2020-12/schema',\n  type: 'object',\n  properties: {\n    foo: { type: 'string' }\n  }\n}\n\n// (1) Compile the JSON Schema definition into an Encoding schema\nconst encodingSchema = await jsonbinpack.compileSchema(schema)\n\n// (2) Serialize a matching JSON document using the Encoding schema\nconst buffer = jsonbinpack.serialize(encodingSchema, {\n  foo: 'bar'\n})\n\n// (3) Deserialize the buffer into the original JSON document\nconst result = jsonbinpack.deserialize(encodingSchema, buffer)\n\nconsole.log(result)\n\u003e { foo: 'bar' }\n```\n\n### Reference\n\n#### `jsonbinpack.compileSchema(JSON Schema): Promise\u003cEncoding\u003e`\n\nConvert a JSON Schema definition into an Encoding schema for use with the\n`.serialize()` and `.deserialize()` functions.\n\n#### `jsonbinpack.serialize(Encoding, JSON): Buffer`\n\nSerialize a JSON value according to an Encoding schema.\n\n#### `jsonbinpack.deserialize(Encoding, Buffer): JSON`\n\nDeserialize a buffer according to an Encoding schema.\n\nBuilding from source\n--------------------\n\nRequirements:\n\n- Node.js\n- `npm`\n- GNU Make\n\nInstalling dependencies:\n\n```sh\nnpm install\n```\n\nCompiling the project:\n\n```sh\nmake\n# Run tests\nmake test\n# Run linter\nmake lint\n```\n\nLicense\n-------\n\nThis project is released under the terms specified in the\n[license](https://github.com/jviotti/jsonbinpack/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjviotti%2Fjsonbinpack-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjviotti%2Fjsonbinpack-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjviotti%2Fjsonbinpack-poc/lists"}