New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

riemann

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

riemann - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

4

package.json
{
"name": "riemann",
"version": "1.1.1",
"version": "2.0.0",
"description": "node.js client for Riemann, supports hybrid UDP/TCP connections.",

@@ -21,3 +21,3 @@ "author": {

"dependencies": {
"node-protobuf": "^1.4.3",
"protobufjs": "6.8.8",
"event-to-promise": "^0.8.0"

@@ -24,0 +24,0 @@ },

@@ -5,29 +5,2 @@ # [Riemann](http://aphyr.github.com/riemann/) Node.js Client

## Prerequisites
Riemann uses [Google Protocol Buffers](https://github.com/google/protobuf),
so please make sure it's installed beforehand.
### Ubuntu/Debian via apt
```sh
apt-get install libprotobuf-dev
```
### RHEL/Centos via yum
```sh
yum install protobuf-devel
```
### Mac OS via homebrew
```sh
brew install protobuf
```
### Windows
https://github.com/fuwaneko/node-protobuf#windows
## Installation

@@ -34,0 +7,0 @@

@@ -74,3 +74,3 @@ var assert = require('assert');

if (!payload.host) { payload.host = hostname; }
if (!payload.time) { payload.time = new Date().getTime()/1000; }
if (!payload.time) { payload.time = Math.round(new Date().getTime()/1000); }
if (typeof payload.metric !== "undefined" && payload.metric !== null) {

@@ -77,0 +77,0 @@ payload.metric_f = payload.metric;

@@ -0,1 +1,4 @@

var protobuf = require('protobufjs');
var path = require('path');
/* initialize our protobuf schema,

@@ -5,13 +8,47 @@ and cache it in memory. */

if (!riemannSchema) {
var Schema = require('node-protobuf');
var readFile = require('fs').readFileSync;
riemannSchema = new Schema(readFile(__dirname+'/proto/proto.desc'));
schemaLoad();
}
function schemaLoad() {
return new Promise((resolve, reject) => {
if (riemannSchema) {
resolve();
}
protobuf.load(path.join(__dirname, '/proto/proto.proto'), (err, root) => {
if (err) {
reject(err);
}
// Pull the message type out.
riemannSchema = root;
resolve();
});
});
}
exports.schemaLoad = schemaLoad;
function _serialize(type, value) {
return riemannSchema.serialize(value, type);
var messageType = riemannSchema.lookupType(type);
// https://www.npmjs.com/package/protobufjs#valid-message
var errorString = messageType.verify(value);
var message;
// Using create is faster, so only fall back to fromObject in worst case.
if (errorString) {
message = messageType.fromObject(value);
} else {
message = messageType.create(value);
}
return messageType.encode(message).finish();
}
function _deserialize(type, value) {
return riemannSchema.parse(value, type);
var messageType = riemannSchema.lookupType(type);
var buffer = Buffer.from(value, 'binary');
return messageType.decode(buffer);
}

@@ -18,0 +55,0 @@

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