code, however in certain situations it's useful to check the status of the
agent. The `http.getAgent()` function allows you to access the agents.
+Options:
+
+- `host`: A domain name or IP address of the server to issue the request to.
+- `port`: Port of remote server.
+- `socketPath`: Unix Domain Socket (use one of host:port or socketPath)
+
### Event: 'upgrade'
- `function (response, socket, head)`
+ `function (response, socket, head) { }`
Emitted each time a server responds to a request with an upgrade. If this
event isn't being listened for, clients receiving an upgrade header will have
`__filename`), the entry point of the current application can be obtained
by checking `require.main.filename`.
-
+## AMD Compatibility
+
+Node's modules have access to a function named `define`, which may be
+used to specify the module's return value. This is not necessary in node
+programs, but is present in the node API in order to provide
+compatibility with module loaders that use the Asynchronous Module
+Definition pattern.
+
+The example module above could be structured like so:
+
+ define(function (require, exports, module) {
+ var PI = Math.PI;
+
+ exports.area = function (r) {
+ return PI * r * r;
+ };
+
+ exports.circumference = function (r) {
+ return 2 * PI * r;
+ };
+ });
+
+* Only the last argument to `define()` matters. Other module loaders
+ sometimes use a `define(id, [deps], cb)` pattern, but since this is
+ not relevant in node programs, the other arguments are ignored.
+* If the `define` callback returns a value other than `undefined`, then
+ that value is assigned to `module.exports`.
+* **Important**: Despite being called "AMD", the node module loader **is
+ in fact synchronous**, and using `define()` does not change this fact.
+ Node executes the callback immediately, so please plan your programs
+ accordingly.
+
+
+### Accessing the main module
+
+When a file is run directly from Node, `require.main` is set to its
+`module`. That means that you can determine whether a file has been run
+directly by testing
+
+ require.main === module
+
+For a file `foo.js`, this will be `true` if run via `node foo.js`, but
+`false` if run by `require('./foo')`.
+
+Because `module` provides a `filename` property (normally equivalent to
+`__filename`), the entry point of the current application can be obtained
+by checking `require.main.filename`.
+
+
## Addenda: Package Manager Tips
The semantics of Node's `require()` function were designed to be general