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

moussaka-client

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moussaka-client - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

dist/moussaka-client.js

2

bower.json
{
"name": "moussaka-client",
"version": "0.1.0",
"version": "0.1.1",
"authors": [

@@ -5,0 +5,0 @@ "Sean Dawson <contact@seandawson.info>"

@@ -8,3 +8,6 @@ // Logging

var Logger = function () {};
var Logger = function (logLevel) {
this.logLevel = logLevel ||
this.severity.warning.level;
};

@@ -43,6 +46,8 @@ Logger.prototype.severity = {

console.log(sprintf('[%s] [%s]: %s', (new Date())
.toLocaleTimeString(),
severity.label,
msg));
if (severity.level >= this.logLevel) {
console.log(sprintf('[%s] [%s]: %s', (new Date())
.toLocaleTimeString(),
severity.label,
msg));
}

@@ -49,0 +54,0 @@ };

@@ -46,2 +46,7 @@ // Main class

if (opts.logLevel) {
logger.logLevel = opts.logLevel;
}
};

@@ -52,2 +57,13 @@

MoussakaClient.prototype.getBaseUrl = function () {
if (!this.serverUrl) {
throw new Error('Server URL not defined.');
}
var str = this.serverUrl;
if (str.substr(-1) === '/') {
return str.substr(0, str.length - 1);
}
return str;
};
MoussakaClient.prototype.registerVar = function (name, value, schema) {

@@ -120,3 +136,3 @@ if (this.registedVars[name]) {

MoussakaClient.prototype.connect = function () {
var url = this.serverUrl + path.join('/projects/',
var url = this.getBaseUrl() + path.join('/projects/',
this.projectId, 'devices/');

@@ -153,3 +169,3 @@ logger.trace('Connecting device at: ' + url);

MoussakaClient.prototype.disconnect = function () {
var url = this.serverUrl + path.join('/projects/',
var url = this.getBaseUrl() + path.join('/projects/',
this.projectId, 'devices/', this._id, '/');

@@ -194,3 +210,3 @@ logger.trace('Disconnecting device at: ' + url);

MoussakaClient.prototype.pollFn = function () {
var url = this.serverUrl + path.join('/projects/',
var url = this.getBaseUrl() + path.join('/projects/',
this.projectId, 'sessions/', this._id, '/updates/');

@@ -197,0 +213,0 @@

{
"name": "moussaka-client",
"version": "0.1.0",
"version": "0.1.1",
"description": "A javascript library that allows you to use javascript applications with the Moussaka prototyping framework.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -49,3 +49,3 @@ moussaka-client

| ----------------- |-----------------------------------------------------------------------------------------------|-------------------------|
| deviceName | The name of the device (i.e. John Smith's PC) | None |
| deviceName | The name of the device (i.e. John Smith's PC.) | None |
| apiKey | The user API key retreived from the user account settings in Moussaka. | None |

@@ -55,3 +55,4 @@ | projectId | The project ID retreived from the project view page in Moussaka. | None |

| serverUrl | The url to your Moussaka server. | http://localhost:3000/ |
| pollInterval | The time in milliseconds between each poll to the server | 1000 |
| pollInterval | The time in milliseconds between each poll to the server. | 1000 |
| logLevel | See section below. | 2 (warning) |

@@ -111,5 +112,18 @@ #### Installing

#### Log Level
By passing in a logLevel option you can control the detail of the log messages. The log levels are as follows:
- trace: 0
- info: 1
- warning: 2
- error: 3
- exception: 4
For example, to see only messages that are errors or exceptions, you would pass { logLevel: 3 } to the MoussakaClient constructor.

@@ -26,3 +26,4 @@ (function (require, module) {

projectId: chance.guid(),
projectVersion: chance.word()
projectVersion: chance.word(),
serverUrl: 'http://localhost:3333/'
};

@@ -29,0 +30,0 @@

@@ -43,3 +43,3 @@ (function (require, module) {

}
});
}, 3333);

@@ -46,0 +46,0 @@ it('should register vars without error', function() {

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