beam-interactive-node
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -31,3 +31,2 @@ 'use strict'; | ||
*/ | ||
var Connector = function (_EventEmitter) { | ||
@@ -43,3 +42,2 @@ _inherits(Connector, _EventEmitter); | ||
*/ | ||
function Connector(encode, decode, errorPacket, remote) { | ||
@@ -46,0 +44,0 @@ _classCallCheck(this, Connector); |
@@ -58,3 +58,2 @@ 'use strict'; | ||
*/ | ||
function Frontend(options) { | ||
@@ -61,0 +60,0 @@ _classCallCheck(this, Frontend); |
@@ -23,3 +23,2 @@ 'use strict'; | ||
*/ | ||
var Reporter = function () { | ||
@@ -32,3 +31,2 @@ | ||
*/ | ||
function Reporter(client, interval) { | ||
@@ -35,0 +33,0 @@ _classCallCheck(this, Reporter); |
@@ -23,3 +23,2 @@ 'use strict'; | ||
*/ | ||
function Heartbeat(interval, timeout) { | ||
@@ -26,0 +25,0 @@ _classCallCheck(this, Heartbeat); |
@@ -19,6 +19,11 @@ 'use strict'; | ||
return function (ev) { | ||
if (event === 'message') { | ||
fn(ev.data); | ||
} else { | ||
fn(ev); | ||
switch (event) { | ||
case 'error': | ||
fn(ev.error); | ||
break; | ||
case 'message': | ||
fn(ev.data); | ||
break; | ||
default: | ||
fn(ev); | ||
} | ||
@@ -35,8 +40,25 @@ }; | ||
var wrapped = wrapHandler(event, listener); | ||
socket.addEventListener(event, function (ev) { | ||
socket.addEventListener(event, function handler(ev) { | ||
wrapped(ev); | ||
socket.removeEventListener(event, wrapped); | ||
socket.removeEventListener(event, handler); | ||
}); | ||
}; | ||
socket.emit = function (event) { | ||
for (var _len = arguments.length, data = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
data[_key - 1] = arguments[_key]; | ||
} | ||
switch (event) { | ||
case 'error': | ||
socket.dispatchEvent(new ErrorEvent(event, { error: data[0] })); | ||
break; | ||
case 'message': | ||
socket.dispatchEvent(new MessageEvent(event, { data: data[0] })); | ||
break; | ||
default: | ||
socket.dispatchEvent(new CustomEvent(event, { detail: data })); | ||
} | ||
}; | ||
return socket; | ||
@@ -43,0 +65,0 @@ } |
{ | ||
"name": "beam-interactive-node", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "This repository contains reference a implementation of a Beam Interactive robot.", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "eslint lib", | ||
"lint": "eslint .", | ||
"build": "rm -rf dist && babel lib --out-dir dist && cp lib/robot/tetris.proto dist/robot", | ||
"test": "mocha test/unit --recursive --compilers js:babel-register && npm run lint", | ||
"test": "npm run lint && mocha test/unit --recursive --compilers js:babel-register", | ||
"testfe": "browserify -r ./dist/frontend:tetris > dist/bundle.js && http-server", | ||
"integrate": "mocha test/integrate --recursive --compilers js:babel-register", | ||
"prepublish": "npm run lint && npm run build", | ||
"cover": "node node_modules/istanbul/lib/cli cover node_modules/mocha/bin/_mocha -- test/unit --recursive --compilers js:babel-register" | ||
"cover": "istanbul cover node_modules/mocha/bin/_mocha -- test/unit --recursive --compilers js:babel-register" | ||
}, | ||
@@ -35,9 +35,10 @@ "repository": { | ||
"lodash.isplainobject": "^4.0.1", | ||
"protobufjs": "^4.0.0", | ||
"protobufjs": "^5.0.1", | ||
"varint": "^4.0.0", | ||
"ws": "^0.8.0" | ||
"ws": "^1.1.1" | ||
}, | ||
"devDependencies": { | ||
"async": "^1.4.2", | ||
"async": "^2.0.0", | ||
"babel-cli": "^6.8.0", | ||
"babel-eslint": "^6.1.0", | ||
"babel-preset-es2015": "^6.5.0", | ||
@@ -48,9 +49,8 @@ "babel-register": "^6.5.2", | ||
"chai-subset": "^1.1.0", | ||
"eslint": "^2.4.0", | ||
"eslint": "^2.13.1", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-import": "^1.7.0", | ||
"eslint-plugin-react": "^5.1.1", | ||
"http-server": "^0.9.0", | ||
"istanbul": "^0.4.3", | ||
"mocha": "^2.3.2", | ||
"mocha": "^3.0.0", | ||
"mysql": "^2.9.0", | ||
@@ -57,0 +57,0 @@ "redis": "^2.5.1", |
@@ -1,5 +0,10 @@ | ||
# beam-interactive-node [![Build Status](https://travis-ci.org/WatchBeam/beam-interactive-node.svg)](https://travis-ci.org/WatchBeam/beam-interactive-node) | ||
# beam-interactive-node [![Build Status](https://travis-ci.org/WatchBeam/beam-interactive-node.svg)](https://travis-ci.org/WatchBeam/beam-interactive-node) [![](https://badges.gitter.im/MCProHosting/beam.png)](https://gitter.im/MCProHosting/beam-dev) | ||
This repository contains reference a implementation of Beam Interactive protocols in Node.js. It's available on npm: | ||
A Node.js Client for our [Interactive Protocol](https://dev.beam.pro/reference/interactive/index.html). | ||
## Getting Started | ||
Check out our Interactive Tutorial on our [Developer Site](https://dev.beam.pro/tutorials/interactive.html) for a quick guide on how to get started. | ||
It's available on npm: | ||
``` | ||
@@ -9,2 +14,7 @@ npm install --save beam-interactive-node | ||
- [Documentation](http://beam-interactive.readthedocs.org/) | ||
Pairs well with our [node client](https://github.com/watchbeam/beam-client-node). | ||
## Getting Help | ||
Chat with us and other developers on our [gitter](https://gitter.im/MCProHosting/beam-dev). |
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
20
2
69058
20
1358
+ Addedbytebuffer@5.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedlong@3.2.0(transitive)
+ Addedprotobufjs@5.0.3(transitive)
+ Addedws@1.1.5(transitive)
- Removedbindings@1.2.1(transitive)
- Removedbufferutil@1.2.1(transitive)
- Removedbufferview@1.0.1(transitive)
- Removedbytebuffer@4.1.0(transitive)
- Removedglob@5.0.15(transitive)
- Removedlong@2.4.0(transitive)
- Removednan@2.22.02.4.0(transitive)
- Removedprotobufjs@4.1.3(transitive)
- Removedutf-8-validate@1.2.2(transitive)
- Removedws@0.8.1(transitive)
Updatedprotobufjs@^5.0.1
Updatedws@^1.1.1