net.isIP()

net.isIP(input) Tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.

net.createServer()

net.createServer([options][, connectionListener]) Creates a new server. The connectionListener argument is automatically set as a listener for the 'connection' event. options is an object with the following defaults: { allowHalfOpen: false, pauseOnConnect: false } If allowHalfOpen is true, then the socket won't automatically send a FIN packet when the other end of the socket sends a FIN packet. The socket becomes non-readable, but still writable. You should call the end() method explicitl

net.createConnection()

net.createConnection(options[, connectListener]) A factory function, which returns a new net.Socket and automatically connects with the supplied options. The options are passed to both the net.Socket constructor and the socket.connect method. The connectListener parameter will be added as a listener for the 'connect' event once. Here is an example of a client of the previously described echo server: const net = require('net'); const client = net.createConnection({port: 8124}, () => { /

net.connect()

net.connect(options[, connectListener]) A factory function, which returns a new net.Socket and automatically connects with the supplied options. The options are passed to both the net.Socket constructor and the socket.connect method. The connectListener parameter will be added as a listener for the 'connect' event once. Here is an example of a client of the previously described echo server: const net = require('net'); const client = net.connect({port: 8124}, () => { // 'connect' listen

module.require()

module.require(id) id <String> Return: <Object> module.exports from the resolved module The module.require method provides a way to load a module as if require() was called from the original module. Note that in order to do this, you must get a reference to the module object. Since require() returns the module.exports, and the module is typically only available within a specific module's code, it must be explicitly exported in order to be used.

module.parent

module.parent <Object> Module object The module that first required this one.

module.loaded

module.loaded <Boolean> Whether or not the module is done loading, or is in the process of loading.

module.id

module.id <String> The identifier for the module. Typically this is the fully resolved filename.

module.filename

module.filename <String> The fully resolved filename to the module.

module.exports

module.exports <Object> The module.exports object is created by the Module system. Sometimes this is not acceptable; many want their module to be an instance of some class. To do this, assign the desired export object to module.exports. Note that assigning the desired object to exports will simply rebind the local exports variable, which is probably not what you want to do. For example suppose we were making a module called a.js const EventEmitter = require('events'); module.exports