Update deps.

This commit is contained in:
Julien Fontanet 2015-10-28 12:42:20 +01:00
parent 4fd9639457
commit d279db2a0e
2 changed files with 12 additions and 10 deletions

View File

@ -6,8 +6,8 @@ var Bluebird = require('bluebird')
var EventEmitter = require('events').EventEmitter
var eventToPromise = require('event-to-promise')
var inherits = require('util').inherits
var jsonRpc = require('@julien-f/json-rpc')
var MethodNotFound = require('@julien-f/json-rpc/errors').MethodNotFound
var MethodNotFound = require('json-rpc-peer').MethodNotFound
var Peer = require('json-rpc-peer').default
var startsWith = require('lodash.startswith')
var WebSocket = require('ws')
@ -60,7 +60,7 @@ function Api (url) {
// The JSON-RPC server.
var this_ = this
this._jsonRpc = jsonRpc.createServer(function (message) {
this._jsonRpc = new Peer(function (message) {
if (message.type === 'notification') {
this_.emit('notification', message)
} else {
@ -68,7 +68,7 @@ function Api (url) {
throw new MethodNotFound(message.method)
}
}).on('data', function (message) {
this_._socket.send(JSON.stringify(message))
this_._socket.send(message)
})
}
inherits(Api, EventEmitter)

View File

@ -19,25 +19,27 @@
"node": ">=0.8.0"
},
"scripts": {
"test": "standard && mocha '*.spec.js'"
"lint": "standard",
"posttest": "npm run lint",
"test": "mocha \"*.spec.js\""
},
"dependencies": {
"@julien-f/json-rpc": "^0.3.5",
"bluebird": "^2.9.6",
"event-to-promise": "^0.3.3",
"event-to-promise": "^0.4.0",
"exec-promise": "^0.5.1",
"json-rpc-peer": "^0.11.0",
"lodash.assign": "^3.0.0",
"lodash.foreach": "^3.0.1",
"lodash.isstring": "^3.0.0",
"lodash.startswith": "^3.0.0",
"make-error": "^0.3.0",
"make-error": "^1.0.4",
"pw": "0.0.4",
"ws": "^0.8.0",
"xo-collection": "^0.3.1"
"xo-collection": "^0.4.0"
},
"devDependencies": {
"mocha": "^2.1.0",
"must": "^0.12.0",
"must": "^0.13.1",
"standard": "*"
}
}