Comparing version 2.1.0 to 2.2.0
@@ -27,5 +27,3 @@ module.exports.send = (req, res) => (data = 200, code = 200, headers = {}, cb = () => {}) => { | ||
if (typeof res.emit === 'function') { | ||
res.emit('response', params) | ||
} | ||
res.emit('response', params) | ||
@@ -32,0 +30,0 @@ if (typeof data === 'object') { |
{ | ||
"name": "restana", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Super fast and minimalist web framework for building REST micro-services.", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"find-my-way": "^1.14.1" | ||
"find-my-way": "^1.15.1" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
@@ -1,3 +0,3 @@ | ||
# REST-Ana | ||
Super fast and minimalist *connect-like* web framework for building REST micro-services. | ||
# restana | ||
Blazing fast and minimalist *connect-like* web framework for building REST micro-services. | ||
> Uses 'find-my-way' blazing fast router: https://www.npmjs.com/package/find-my-way | ||
@@ -171,5 +171,28 @@ | ||
## turbo-http integration | ||
What is turbo-http? Checkout: https://www.npmjs.com/package/turbo-http | ||
Using `turbo-http` in restana: | ||
```bash | ||
npm i turbo-http | ||
``` | ||
```js | ||
// ATTENTION: The performance of the service below can blow your mind ;) | ||
const server = require('restana/libs/turbo-http') | ||
const service = require('restana')({ | ||
server | ||
}) | ||
service.get('/hi', (req, res) => { | ||
res.send({ | ||
msg: 'Hello World!' | ||
}) | ||
}) | ||
service.start() | ||
``` | ||
> NOTE: When using `turbo-http`, the node.js `cluster` module can't be used! | ||
## Performance comparison (framework overhead) | ||
[Performance comparison](performance/) for a basic *Hello World!* response (single thread process). | ||
Node version: v10.4.0 | ||
Node version: v10.6.0 | ||
Laptop: MacBook Pro 2016, 2,7 GHz Intel Core i7, 16 GB 2133 MHz LPDDR3 | ||
@@ -180,3 +203,3 @@ ```bash | ||
### String response ('Hello World!') | ||
* **restana-turbo-http**: Requests/sec 57519.38 | ||
* **restana-turbo-http**: Requests/sec 57622.13 | ||
* **restana**: Requests/sec 43575.36 | ||
@@ -190,3 +213,3 @@ * fastify: Requests/sec 36894.86 | ||
### JSON response ({msg: 'Hello World!'}) | ||
* **restana-turbo-http**: Requests/sec 52894.71 | ||
* **restana-turbo-http**: Requests/sec 53025.65 | ||
* **restana**: Requests/sec 39681.39 | ||
@@ -193,0 +216,0 @@ * fastify: Requests/sec 33143.12 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13074
7
176
219
Updatedfind-my-way@^1.15.1