Socket
Socket
Sign inDemoInstall

json-rpc-engine

Package Overview
Dependencies
Maintainers
6
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-rpc-engine - npm Package Compare versions

Comparing version 5.4.0 to 6.0.0

dist/asMiddleware.d.ts

35

CHANGELOG.md

@@ -10,2 +10,23 @@ # Changelog

## [6.0.0] - 2020-11-19
### Added
- Add docstrings for public `JsonRpcEngine` methods ([#70](https://github.com/MetaMask/json-rpc-engine/pull/70))
### Changed
- **(BREAKING)** Refactor exports ([#69](https://github.com/MetaMask/json-rpc-engine/pull/69))
- All exports are now named, and available via the package entry point.
- All default exports have been removed.
- **(BREAKING)** Convert `asMiddleware` to instance method ([#69](https://github.com/MetaMask/json-rpc-engine/pull/69))
- The `asMiddleware` export has been removed.
- **(BREAKING)** Add runtime typechecks to `JsonRpcEngine.handle()`, and error responses if they fail ([#70](https://github.com/MetaMask/json-rpc-engine/pull/70))
- Requests will now error if:
- The request is not a plain object, or if the `method` property is not a `string`. Empty strings are allowed.
- A `next` middleware callback is called with a truthy, non-function parameter.
- Migrate to TypeScript ([#69](https://github.com/MetaMask/json-rpc-engine/pull/69))
- Hopefully improve stack traces by removing uses of `Promise.then` and `.catch` internally ([#70](https://github.com/MetaMask/json-rpc-engine/pull/70))
- Make some internal `JsonRpcEngine` methods `static` ([#71](https://github.com/MetaMask/json-rpc-engine/pull/71))
## [5.4.0] - 2020-11-07

@@ -37,1 +58,15 @@

- In general, it is a bad practice to work with state that depends on middleware execution, while the middleware are executing.
[Unreleased]:https://github.com/MetaMask/json-rpc-engine/compare/v6.0.0...HEAD
[6.0.0]:https://github.com/MetaMask/json-rpc-engine/compare/v5.4.0...v6.0.0
[5.4.0]:https://github.com/MetaMask/json-rpc-engine/compare/v5.3.0...v5.4.0
[5.3.0]:https://github.com/MetaMask/json-rpc-engine/compare/v5.2.0...v5.3.0
[5.2.0]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.8...v5.2.0
[5.1.8]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.6...v5.1.8
[5.1.6]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.5...v5.1.6
[5.1.5]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.4...v5.1.5
[5.1.4]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.3...v5.1.4
[5.1.3]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.1...v5.1.3
[5.1.1]:https://github.com/MetaMask/json-rpc-engine/compare/v5.1.0...v5.1.1
[5.1.0]:https://github.com/MetaMask/json-rpc-engine/compare/v5.0.0...v5.1.0
[5.0.0]:https://github.com/MetaMask/json-rpc-engine/compare/v4.0.0...v5.0.0

37

package.json
{
"name": "json-rpc-engine",
"version": "5.4.0",
"description": "a tool for processing JSON RPC",
"version": "6.0.0",
"description": "A tool for processing JSON-RPC messages.",
"license": "ISC",
"author": "kumavis",
"main": "src/index.js",
"types": "src/index.d.ts",
"main": "dist/index.js",
"engines": {
"node": ">=10.0.0"
},
"files": [
"src"
"dist"
],
"scripts": {
"lint": "eslint . --ext js,json",
"lint:fix": "eslint . --ext js,json --fix",
"build": "tsc --project .",
"lint": "eslint . --ext ts,js,json",
"lint:fix": "eslint . --ext ts,js,json --fix",
"test": "mocha ./test",

@@ -19,14 +22,19 @@ "coverage": "nyc --check-coverage yarn test"

"dependencies": {
"eth-rpc-errors": "^3.0.0",
"safe-event-emitter": "^1.0.1"
"@metamask/safe-event-emitter": "^2.0.0",
"eth-rpc-errors": "^4.0.2"
},
"devDependencies": {
"@metamask/eslint-config": "^2.1.0",
"eslint": "^6.8.0",
"@metamask/eslint-config": "^4.1.0",
"@types/node": "^14.14.7",
"@typescript-eslint/eslint-plugin": "^4.8.0",
"@typescript-eslint/parser": "^4.8.0",
"eslint": "^7.13.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-json": "^2.1.0",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-node": "^11.1.0",
"mocha": "^7.1.1",
"nyc": "^15.0.0",
"sinon": "^9.0.2"
"nyc": "^15.1.0",
"sinon": "^9.0.2",
"typescript": "^4.0.5"
},

@@ -45,4 +53,5 @@ "repository": {

"contributors": [
"kumavis <aaron@kumavis.me>"
"kumavis <aaron@kumavis.me>",
"Erik Marks <rekmarks@protonmail.com>"
]
}

@@ -8,5 +8,5 @@ # json-rpc-engine

```js
const RpcEngine = require('json-rpc-engine')
const { JsonRpcEngine } = require('json-rpc-engine')
let engine = new RpcEngine()
let engine = new JsonRpcEngine()
```

@@ -29,6 +29,6 @@

engine.handle(request, function(err, response){
// do something with response.result
// Do something with response.result, or handle response.error
})
// there is also a Promise signature
// There is also a Promise signature
const response = await engine.handle(request)

@@ -58,10 +58,8 @@ ```

RpcEngines can be nested by converting them to middleware using `asMiddleware(engine)`:
Engines can be nested by converting them to middleware using `JsonRpcEngine.asMiddleware()`:
```js
const asMiddleware = require('json-rpc-engine/src/asMiddleware')
let engine = new RpcEngine()
let subengine = new RpcEngine()
engine.push(asMiddleware(subengine))
const engine = new JsonRpcEngine()
const subengine = new JsonRpcEngine()
engine.push(subengine.asMiddleware())
```

@@ -74,3 +72,3 @@

```js
const createAsyncMiddleware = require('json-rpc-engine/src/createAsyncMiddleware')
const { createAsyncMiddleware } = require('json-rpc-engine')

@@ -77,0 +75,0 @@ let engine = new RpcEngine()

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