create-server
Advanced tools
Comparing version 0.0.3 to 0.0.4
24
index.js
@@ -85,14 +85,6 @@ 'use strict'; | ||
switch (type) { | ||
case 'http': | ||
server = require('http').createServer(); | ||
break; | ||
case 'https': | ||
server = require('https').createServer(options); | ||
break; | ||
case 'spdy': | ||
server = require('spdy').createServer(options); | ||
break; | ||
if ('http' === type) { | ||
server = require('http').createServer(); | ||
} else { | ||
server = require(type).createServer(options); | ||
} | ||
@@ -126,4 +118,6 @@ | ||
// | ||
if (fn.request) server.on('request', fn.request); | ||
if (fn.close) server.once('close', fn.close); | ||
['request', 'upgrade', 'error'].forEach(function each(event) { | ||
if (fn[event]) server.on('request', fn[event]); | ||
}); | ||
@@ -135,3 +129,3 @@ // | ||
if (options.listen !== false && fn.listening) { | ||
if (options.listen !== false) { | ||
listen(server, port, fn.listening); | ||
@@ -159,3 +153,3 @@ } | ||
[ | ||
'close', 'request', 'listening', | ||
'close', 'request', 'listening', 'upgrade', 'error', | ||
'http', 'https', 'spdy' | ||
@@ -162,0 +156,0 @@ ].forEach(function each(name) { |
{ | ||
"name": "create-server", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Create a pre-configured HTTP server", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha $(find test -name '*.test.js')" | ||
}, | ||
@@ -31,3 +31,9 @@ "repository": { | ||
"connected": "0.0.x" | ||
}, | ||
"devDependencies": { | ||
"assume": "0.0.x", | ||
"mocha": "1.20.x", | ||
"pre-commit": "0.0.x", | ||
"spdy": "1.26.x" | ||
} | ||
} |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
8236
6
185
1
0
61
4
2
4