{"id":13602967,"url":"https://github.com/mtth/avsc","last_synced_at":"2025-05-12T13:18:15.752Z","repository":{"id":37502717,"uuid":"42375652","full_name":"mtth/avsc","owner":"mtth","description":"Avro for JavaScript :zap:","archived":false,"fork":false,"pushed_at":"2025-04-10T04:13:49.000Z","size":4098,"stargazers_count":1322,"open_issues_count":25,"forks_count":151,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-12T13:18:00.675Z","etag":null,"topics":["avro","big-data","binary-format","encoding","javascript","schema-evolution","serialization","typescript"],"latest_commit_sha":null,"homepage":"","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/mtth.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-12T22:37:23.000Z","updated_at":"2025-05-08T23:27:52.000Z","dependencies_parsed_at":"2024-01-27T16:46:34.833Z","dependency_job_id":"ff467c54-3c12-4b3c-8e94-c1b5045190dd","html_url":"https://github.com/mtth/avsc","commit_stats":{"total_commits":926,"total_committers":33,"mean_commits":"28.060606060606062","dds":"0.16630669546436283","last_synced_commit":"1393881e6fc4152e3c172d5e5b217b8cc1e84e45"},"previous_names":[],"tags_count":110,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtth%2Favsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtth%2Favsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtth%2Favsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtth%2Favsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtth","download_url":"https://codeload.github.com/mtth/avsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745196,"owners_count":21957319,"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":["avro","big-data","binary-format","encoding","javascript","schema-evolution","serialization","typescript"],"created_at":"2024-08-01T18:01:44.879Z","updated_at":"2025-05-12T13:18:15.699Z","avatar_url":"https://github.com/mtth.png","language":"JavaScript","readme":"# Avsc [![NPM version](https://img.shields.io/npm/v/avsc.svg)](https://www.npmjs.com/package/avsc) [![Download count](https://img.shields.io/npm/dm/avsc.svg)](https://www.npmjs.com/package/avsc) [![CI](https://github.com/mtth/avsc/actions/workflows/ci.yml/badge.svg)](https://github.com/mtth/avsc/actions/workflows/ci.yml) [![Coverage status](https://coveralls.io/repos/mtth/avsc/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/mtth/avsc?branch=master)\n\nPure JavaScript implementation of the [Avro\nspecification](https://avro.apache.org/docs/1.12.0/specification/).\n\n\n## Features\n\n+ Blazingly [fast and compact][benchmarks] serialization! Typically faster than\n  JSON with much smaller encodings.\n+ All the Avro goodness and more: [type inference][type-inference], [schema\n  evolution][schema-evolution]...\n+ Support for [serializing arbitrary JavaScript objects][logical-types].\n+ Unopinionated [64-bit integer compatibility][custom-long].\n\n\n## Installation\n\n```sh\n$ npm install avsc\n```\n\n\n## Documentation\n\n+ [Home][home]\n+ [API](https://github.com/mtth/avsc/wiki/API)\n+ [Quickstart](https://github.com/mtth/avsc/wiki/Quickstart)\n+ [Advanced usage](https://github.com/mtth/avsc/wiki/Advanced-usage)\n+ [Benchmarks][benchmarks]\n\n\n## Examples\n\n```javascript\nconst avro = require('avsc');\n```\n\n+ Encode and decode values from a known schema:\n\n  ```javascript\n  const type = avro.Type.forSchema({\n    type: 'record',\n    name: 'Pet',\n    fields: [\n      {\n        name: 'kind',\n        type: {type: 'enum', name: 'PetKind', symbols: ['CAT', 'DOG']}\n      },\n      {name: 'name', type: 'string'}\n    ]\n  });\n\n  const buf = type.toBuffer({kind: 'CAT', name: 'Albert'}); // Encoded buffer.\n  const val = type.fromBuffer(buf); // = {kind: 'CAT', name: 'Albert'}\n  ```\n\n+ Infer a value's schema and encode similar values:\n\n  ```javascript\n  const type = avro.Type.forValue({\n    city: 'Cambridge',\n    zipCodes: ['02138', '02139'],\n    visits: 2\n  });\n\n  // We can use `type` to encode any values with the same structure:\n  const bufs = [\n    type.toBuffer({city: 'Seattle', zipCodes: ['98101'], visits: 3}),\n    type.toBuffer({city: 'NYC', zipCodes: [], visits: 0})\n  ];\n  ```\n\n+ Get a [readable stream][readable-stream] of decoded values from an Avro\n  container file (see the [`BlockDecoder` API][decoder-api] for an example\n  compressed using [Snappy][snappy]):\n\n  ```javascript\n  avro.createFileDecoder('./values.avro')\n    .on('metadata', function (type) { /* `type` is the writer's type. */ })\n    .on('data', function (val) { /* Do something with the decoded value. */ });\n  ```\n\n\n[benchmarks]: https://github.com/mtth/avsc/wiki/Benchmarks\n[browser-support]: https://github.com/mtth/avsc/wiki#browser-support\n[custom-long]: https://github.com/mtth/avsc/wiki/Advanced-usage#custom-long-types\n[decoder-api]: https://github.com/mtth/avsc/wiki/API#class-blockdecoderopts\n[home]: https://github.com/mtth/avsc/wiki\n[idl]: https://avro.apache.org/docs/current/idl.html\n[logical-types]: https://github.com/mtth/avsc/wiki/Advanced-usage#logical-types\n[node.js]: https://nodejs.org/en/\n[readable-stream]: https://nodejs.org/api/stream.html#stream_class_stream_readable\n[schema-evolution]: https://github.com/mtth/avsc/wiki/Advanced-usage#schema-evolution\n[snappy]: https://avro.apache.org/docs/current/spec.html#snappy\n[type-inference]: https://github.com/mtth/avsc/wiki/Advanced-usage#type-inference\n","funding_links":[],"categories":["JavaScript","Libraries","big-data","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtth%2Favsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtth%2Favsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtth%2Favsc/lists"}