New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

take-five

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

take-five - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

.nyc_output/26934.json

10

lib/handle-request.js

@@ -16,5 +16,3 @@ module.exports = function handleRequest (req, res, routeList, routers) {

return setImmediate(() => mw(req, res, next))
}
if (routers) {
} else if (routers) {
try {

@@ -24,8 +22,12 @@ const method = req.method.toLowerCase()

const router = routers.get(method)
router(url, req, res)
router(url, req, res, next)
} catch (err) {
return res.err(404)
}
} else {
if (!res.finished) {
res.end()
}
}
}
}

2

package.json
{
"name": "take-five",
"version": "1.1.1",
"version": "1.2.0",
"description": "Very minimal JSON-REST server",

@@ -5,0 +5,0 @@ "main": "take-five.js",

@@ -85,4 +85,5 @@ # take-five

### `next:function`
You must either send data down to the client (and `end` the request either though `send`, `err` or `end`) or call `next` to invoke the next function in the route list. If there is no function remaining in the stack, and you haven't send data to the client, the client will hang until the socket timeout occurs.
If you are done processing the request, but you want a later handler to be able to modify the response, call next. This will invoke the next handler in the stack. If there are no more handlers left, it will call `res.end()` and send the response as is. If you want to immediately send the response, you can call `res.end`, `res.send` or `res.err` directly.
## Do we need another REST server?

@@ -89,0 +90,0 @@ Probably not, but [`restify`](http://restify.com), [`hapi`](http://hapijs.com) and [`express`](http://expressjs.com) are all over-kill on the types of services I'm building for the most part.

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