Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

avsc

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avsc - npm Package Compare versions

Comparing version 5.0.0-rc.11 to 5.0.0-rc.12

2

package.json
{
"name": "avsc",
"version": "5.0.0-rc.11",
"version": "5.0.0-rc.12",
"description": "Avro for JavaScript",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/mtth/avsc",

@@ -69,2 +69,3 @@ # 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) [![Build status](https://travis-ci.org/mtth/avsc.svg?branch=master)](https://travis-ci.org/mtth/avsc) [![Coverage status](https://coveralls.io/repos/mtth/avsc/badge.svg?branch=master&service=github)](https://coveralls.io/github/mtth/avsc?branch=master)

});
// We can use `type` to encode any values with the same structure:
const bufs = [

@@ -88,13 +89,17 @@ type.toBuffer({city: 'Seattle', zipCodes: ['98101'], visits: 3}),

```javascript
// First assemble the schema from the IDL specification.
avro.assembleProtocolSchema('Ping.avdl', (err, schema) => {
// Then create a server, attaching a handler for `ping` messages.
const server = avro.Protocol.forSchema(schema)
.createServer()
.onPing((cb) => { cb(null, 'pong'); });
// Finally, respond to incoming TCP connections.
require('net').createServer()
.on('connection', (con) => { server.createListener(con); })
.listen(8000);
});
// We first assemble a protocol from its IDL specification.
const protocol = avro.readProtocol(`
protocol LengthService {
/** Endpoint which returns the length of the input string. */
int stringLength(string str);
}
`);
// We then create a corresponding server, implementing our endpoint.
const server = avro.Service.forProtocol(protocol)
.createServer()
.onStringLength(function (str, cb) { cb(null, str.length); });
// Finally, we use our server to respond to incoming TCP connections!
require('net').createServer()
.on('connection', (con) => { server.createChannel(con); })
.listen(24950);
```

@@ -101,0 +106,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc