Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
node-avro-io
Advanced tools
This will allow you to encode / decode avro binary format to / from json format, it supports both deflate and snappy compressions and supports node streams
Implements the avro spec
This status of this repository is initial release
npm install node-avro-io
or
npm install git://github.com/jamesbrucepower/node-avro-io.git
Serializing data to an avro binary file
var avro = require('./index').DataFile.AvroFile();
var schema = {
"name": "data",
"type": "record",
"fields": [
{"name":"key","type": "string"},
{"name":"value","type": "string"},
{"name":"flag","type": "boolean"},
{"name":"subrecord","type":"record","fields":[
{"name":"key","type":"string"},
{"name":"value","type":["string","int","null"]}
]}
]
};
var writer = avro.open("test.avro", schema, { flags: 'w', codec: 'deflate' });
writer
.append({ key:"john", value:"hive", flag: true, subrecord: { key: "preference", value: 2}})
.append({ key:"eric", value:"lola", flag: true, subrecord: { key: "postcode", value: null}})
.end({ key:"fred", value:"wonka", flag: false, subrecord: { key: "city", value: "michigan"}});
Deserializing data to from avro binary file
require("./index").DataFile.AvroFile()
.open('test.avro', null, { flags: 'r' })
.on('data', function(data) {
console.log(data);
});
See tests for more usage examples
TODO:
v2.0.0
FAQs
This will allow you to encode / decode avro binary format to / from json format, it supports both deflate and snappy compressions and supports node streams
The npm package node-avro-io receives a total of 4 weekly downloads. As such, node-avro-io popularity was classified as not popular.
We found that node-avro-io demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.