flexus-net
Advanced tools
Comparing version 2.0.4 to 2.0.5
14
net.js
@@ -15,2 +15,16 @@ var isChromeApp = typeof chrome == 'object' && typeof chrome.runtime == 'object' && typeof chrome.runtime.id == 'string'; | ||
console.warn('flexus-net not implemented in browser') | ||
var chromenet = require('chrome-net'); | ||
// It's better to have the noop shim of net API in place than letting other modules crash. | ||
// For example http-node inherits net.Server and would throw error without this. | ||
function noop() {} | ||
module.exports = { | ||
connect: noop, | ||
createConnection: noop, | ||
createServer: noop, | ||
Server: noop, | ||
Socket: noop, | ||
isIP: chromenet.isIP, | ||
isIPv4: chromenet.isIPv4, | ||
isIPv6: chromenet.isIPv6 | ||
}; | ||
} |
{ | ||
"name": "flexus-net", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "truly multiplatform wrapper for node net module", | ||
@@ -5,0 +5,0 @@ "author": "Mike Kovařík <kenr.mk@gmail.com>", |
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
7192
27