Socket
Socket
Sign inDemoInstall

@anzerr/http.server

Package Overview
Dependencies
3
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.17 to 1.0.18

6

package.json
{
"name": "@anzerr/http.server",
"version": "1.0.17",
"version": "1.0.18",
"description": "Simple http server",

@@ -30,4 +30,4 @@ "keywords": [

"dependencies": {
"@anzerr/mime.util": "^1.0.9",
"@anzerr/clone.util": "^1.0.12"
"@anzerr/clone.util": "^1.0.12",
"@anzerr/mime.util": "^1.0.10"
},

@@ -34,0 +34,0 @@ "devDependencies": {

const mime = require('@anzerr/mime.util');
const mime = require('@anzerr/mime.util'),
events = require('events');
class Response {
let cid = 0;
class Response extends events {
constructor(res, req) {
super();
this._res = res;

@@ -18,2 +22,4 @@

});
this._cid = (cid = (cid + 1) % Number.MAX_SAFE_INTEGER);
this._start = process.hrtime();
}

@@ -47,3 +53,6 @@

end(data, encoding) {
this._res.end(data, encoding);
this._res.end(data, encoding, () => {
const end = process.hrtime(this._start);
this.emit('end', {stream: false, cid: this._cid, ms: ((end[0] * 1e9 + end[1]) / 1e6)});
});
return this;

@@ -78,3 +87,6 @@ }

this._res.writeHead(this._status, this._head);
stream.pipe(this._res);
stream.pipe(this._res).on('finish', () => {
const end = process.hrtime(this._start);
this.emit('end', {stream: true, cid: this._cid, ms: ((end[0] * 1e9 + end[1]) / 1e6)});
});
return this;

@@ -81,0 +93,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc