Socket
Socket
Sign inDemoInstall

bser

Package Overview
Dependencies
1
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bser

JavaScript implementation of the BSER Binary Protocol


Version published
Weekly downloads
19M
decreased by-9.55%
Maintainers
2
Install size
39.7 kB
Created
Weekly downloads
 

Readme

Source

BSER Binary Protocol

For more details about the protocol see Watchman's docs.

API

var bser = require('bser');

Buffer

Create
var bunser = new bser.BunserBuf();
Append
bunser.append(buf);
Read
bunser.on('value', function(obj) {
  console.log(obj);
});
Dump
bser.dumpToBuffer(obj);

Example

Read BSER from socket:

var bunser = new bser.BunserBuf();

bunser.on('value', function(obj) {
  console.log('data from socket', obj);		   
});

var socket = net.connect('/socket');

socket.on('data', function(buf) {
  bunser.append(buf);
});

Write BSER to socket:

socket.write(bser.dumpToBuffer(obj));

Keywords

FAQs

Last updated on 24 Aug 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc