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

charter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

charter - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

50

index.js

@@ -1,1 +0,49 @@

// nothing here so far
var dgram = require('dgram');
var async = require('async');
function Client(id, host, port) {
this.host = host || 'localhost';
this.port = (port || 2000) + id;
this.socket = dgram.createSocket('udp4')
this.q = async.queue(this.sender.bind(this));
}
Client.prototype.sender = function(message, cb) {
var b = new Buffer(message);
this.socket.send(b, 0, b.length, this.port, this.host, function(err) {
if (err) throw err;
setTimeout(cb, 5);
});
};
Client.prototype.clear = function() {
this.q.push('CLEAR');
};
Client.prototype.close = function() {
this.q.push('CLOSE');
};
Client.prototype.names = function(arr) {
this.q.push('NAMES ' + arr.join(' '));
};
Client.prototype.labels = function(arr) {
this.q.push('LABELS ' + arr.join(' '));
};
Client.prototype.push = function(arr) {
var msg = 's ' + arr.join(' ');
this.q.push(msg);
};
module.exports = Client;

6

package.json
{
"name": "charter",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/runk/node-charter",

@@ -27,5 +27,3 @@ "description": "Nodejs library for Charter App",

},
"scripts": {
"test": "mocha -R spec --recursive"
},
"scripts": {},
"main": "index.js",

@@ -32,0 +30,0 @@ "engine": {

@@ -14,2 +14,14 @@ node-charter

### Example
```javascript
var Client = require('charter');
var c = new Client(1);
c.clear();
c.names(['default']);
c.labels(['time', 'value']);
for (var i = 0; i < 100; i++)
c.push([i, Math.round(Math.random() * 100)]);
```
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