{ "path": [ "./src/latest/nodejs_ref_guide" ], "split": true, "disableTests": true, "extension": "markdown", "g": "javascript", "format": "ast", "parseOptions": "./parseOptions.json", "additionalObjs": "./additionalObjs.json", "output": "./nodemanual.input", "_": [], "outputAssets": "./out/resources", "title": "{package.name} {package.version} API documentation", "viewSourceLabel": "View source code", "package": { "name": "nodemanual", "version": "2.0.0", "private": true, "repository": { "type": "git", "url": "git://github.com/c9/nodemanual.org.git" }, "repository.type": "git", "repository.url": "git://github.com/c9/nodemanual.org.git", "engines": { "node": "~0.6.0" }, "engines.node": "~0.6.0", "dependencies": { "marked": "~0.1.5", "markdown_conrefs": "~1.2.3", "wrench": "~1.3.5", "jade": "0.26.1", "findit": "~0.1.2", "fs-tools": "~0.1.0", "stack": "~0.1.0", "creationix": "~0.3.1", "panda-docs": ">=0.3.3", "panino": ">=1.2.0", "functional-docs": ">=0.0.4" }, "dependencies.marked": "~0.1.5", "dependencies.markdown_conrefs": "~1.2.3", "dependencies.wrench": "~1.3.5", "dependencies.jade": "0.26.1", "dependencies.findit": "~0.1.2", "dependencies.fs-tools": "~0.1.0", "dependencies.stack": "~0.1.0", "dependencies.creationix": "~0.3.1", "dependencies.panda-docs": ">=0.3.3", "dependencies.panino": ">=1.2.0", "dependencies.functional-docs": ">=0.0.4", "devDependencies": {}, "url": "https://github.com/c9/nodemanual.org" }, "linkFormat": "{url}/blob/master/{file}#L{line}", "list": { "Addons": { "id": "Addons", "type": "class", "description": "Addons are dynamically linked shared objects. They can provide glue to C and\nC++ libraries. The API (at the moment) is rather complex, involving\nknowledge of several libraries:\n\n - V8 Javascript, a C++ library. Used for interfacing with Javascript:\n creating objects, calling functions, etc. These are documented mostly in\n the `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source tree),\n and also available [online](http://izs.me/v8-docs/main.html).\n\n - [libuv](https://github.com/joyent/libuv), a C event loop library. Anytime\n one needs to wait for a file descriptor to become readable, wait for a timer,\n or wait for a signal to received one needs to interface with libuv. That is,\n if you perform any I/O, libuv needs to be used.\n\n - Internal Node libraries. Most importantly is the `node::ObjectWrap` class\n which you will likely want to derive from.\n\n - Additional libraries are located the `deps/` folder.\n\nNode.js statically compiles all its dependencies into the executable. When\ncompiling your module, you don't need to worry about linking to any of these\nlibraries.\n\nFirst, let's make a small Addon which is the C++ equivalent of the following\nJavascript code:\n\n exports.hello = function() { return 'world'; };\n\nTo get started, we'll create a file `hello.cc`:\n\n #include \n #include \n\n using namespace v8;\n\n Handle Method(const Arguments& args) {\n HandleScope scope;\n return scope.Close(String::New(\"world\"));\n }\n\n void init(Handle target) {\n NODE_SET_METHOD(target, \"hello\", Method);\n }\n NODE_MODULE(hello, init)\n\nNote that all Node.js addons must export an initialization function:\n\n void Initialize (Handle target);\n NODE_MODULE(module_name, Initialize)\n\nThere is no semi-colon after `NODE_MODULE`, as it's not a function (for more\ninformation, see `node.h`).\n\nThe source code needs to be built into `hello.node`, the binary Addon. To do\nthis we create a file called `wscript` which is python code and looks like\nthis:\n\n srcdir = '.'\n blddir = 'build'\n VERSION = '0.0.1'\n\n def set_options(opt):\n opt.tool_options('compiler_cxx')\n\n def configure(conf):\n conf.check_tool('compiler_cxx')\n conf.check_tool('node_addon')\n\n def build(bld):\n obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')\n obj.target = 'hello'\n obj.source = 'hello.cc'\n\nRunning `node-waf configure build` will create a file\n`build/default/hello.node` which is our Addon.\n\n`node-waf` is just [WAF](http://code.google.com/p/waf), the Python-based\nbuild system. `node-waf` is provided for developers to easily access it.\n\nYou can now use the binary addon in a Node project `hello.js` by pointing\n`require` to the recently built module:\n\n var addon = require('./build/Release/hello');\n\n console.log(addon.hello()); // 'world'\n\nFor the moment, that is all the documentation on addons. Please see\n for a real example.", "short_description": "Addons are dynamically linked shared objects. They can provide glue to C and\nC++ libraries. The API (at the moment) is rather complex, involving\nknowledge of several libraries:\n", "ellipsis_description": "Addons are dynamically linked shared objects. They can provide glue to C and\nC++ libraries. The API (at the moment) ...", "line": 95, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/addons.markdown", "fileName": "addons", "resultingFile": "addons.html#Addons", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/addons.markdown#L95", "name": "Addons", "path": "Addons" }, "assert": { "id": "assert", "type": "class", "description": "\nAll of the `assert` methods basically compare two different states—an expected\none, and an actual one—and return a Boolean condition. If the comparisson is\n`true`, the condition passes. If an assert method is `false`, the entire Node.js\napp crashes.\n\nSome methods have an additional `message` parameter, which sends text out to the\nconsole when the assert fails.\n\n#### Example: Testing for equivalency\n\n", "stability": "5 - Locked", "short_description": "\nAll of the `assert` methods basically compare two different states—an expected\none, and an actual one—and return a Boolean condition. If the comparisson is\n`true`, the condition passes. If an assert method is `false`, the entire Node.js\napp crashes.\n", "ellipsis_description": "\nAll of the `assert` methods basically compare two different states—an expected\none, and an actual one—and return a ...", "line": 19, "aliases": [], "children": [ { "id": "assert.assert", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "message", "types": [ "String" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value you receive" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails (alias of: asset.ok)" } ], "description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `assert.ok()`, except that `message` is\nrequired.", "short_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `assert.ok()`, except that `message` is\nrequired.", "ellipsis_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `a...", "line": 49, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.assert", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L49", "name": "assert", "path": "assert.assert" }, { "id": "assert.deepEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests for deep equality.", "short_description": "Tests for deep equality.", "ellipsis_description": "Tests for deep equality. ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.deepEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L92", "name": "deepEqual", "path": "assert.deepEqual" }, { "id": "assert.doesNotThrow", "type": "class method", "signatures": [ { "args": [ { "name": "block", "types": [ "Function" ] }, { "name": "error", "optional": true, "types": [ "RegExp", "Function" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "block", "types": [ "Function" ], "description": "A block of code to check against" }, { "name": "error", "types": [ "RegExp", "Function" ], "description": "The expected error that's thrown; this can be a constructor, regexp, or validation function", "optional": true }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Expects `block` not to throw an error; for more details, see `assert.throws()`.", "short_description": "Expects `block` not to throw an error; for more details, see `assert.throws()`.", "ellipsis_description": "Expects `block` not to throw an error; for more details, see `assert.throws()`. ...", "line": 159, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.doesNotThrow", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L159", "name": "doesNotThrow", "path": "assert.doesNotThrow" }, { "id": "assert.equal", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ).", "short_description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ).", "ellipsis_description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ). ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.equal", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L71", "name": "equal", "path": "assert.equal" }, { "id": "assert.fail", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "types": [ "String" ] }, { "name": "operator", "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails" }, { "name": "operator", "types": [ "String" ], "description": "The operator used to separate the `actual` and `expected` values in the `message`" } ], "description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n\n\n#### Example\n\n", "short_description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n", "ellipsis_description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n ...", "line": 37, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.fail", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L37", "name": "fail", "path": "assert.fail" }, { "id": "assert.ifError", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value to check against" } ], "description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in callbacks.", "short_description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in callbacks.", "ellipsis_description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in call...", "line": 168, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.ifError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L168", "name": "ifError", "path": "assert.ifError" }, { "id": "assert.notDeepEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests for any deep inequality.", "short_description": "Tests for any deep inequality.", "ellipsis_description": "Tests for any deep inequality. ...", "line": 102, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notDeepEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L102", "name": "notDeepEqual", "path": "assert.notDeepEqual" }, { "id": "assert.notEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ).", "short_description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ).", "ellipsis_description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ). ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L82", "name": "notEqual", "path": "assert.notEqual" }, { "id": "assert.notStrictEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ).", "short_description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ).", "ellipsis_description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ). ...", "line": 123, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notStrictEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L123", "name": "notStrictEqual", "path": "assert.notStrictEqual" }, { "id": "assert.ok", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value you receive" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails (alias of: assert.assert)", "optional": true } ], "description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `assert()`, except that `message` is not\nrequired.", "short_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `assert()`, except that `message` is not\nrequired.", "ellipsis_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `...", "line": 61, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.ok", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L61", "name": "ok", "path": "assert.ok" }, { "id": "assert.strictEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests strict equality, as determined by the strict equality operator ( `===` ).", "short_description": "Tests strict equality, as determined by the strict equality operator ( `===` ).", "ellipsis_description": "Tests strict equality, as determined by the strict equality operator ( `===` ). ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.strictEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L112", "name": "strictEqual", "path": "assert.strictEqual" }, { "id": "assert.throws", "type": "class method", "signatures": [ { "args": [ { "name": "block", "types": [ "Function" ] }, { "name": "error", "optional": true, "types": [ "Function", "RegExp", "Function" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "block", "types": [ "Function" ], "description": "A block of code to check against" }, { "name": "error", "types": [ "Function", "RegExp", "Function" ], "description": "The expected error that's thrown; this can be a constructor, regexp, or validation function", "optional": true }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "If `block`throws an error, then the assertion passes.\n\n#### Example: Validate `instanceof` using a constructor:\n\n\n\n#### Example: Validate an error message using regular expressions:\n\n\n\n#### Example: Custom error validation:\n\n", "short_description": "If `block`throws an error, then the assertion passes.\n", "ellipsis_description": "If `block`throws an error, then the assertion passes.\n ...", "line": 148, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.throws", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L148", "name": "throws", "path": "assert.throws" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L19", "name": "assert", "path": "assert" }, "assert.fail": { "id": "assert.fail", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "types": [ "String" ] }, { "name": "operator", "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails" }, { "name": "operator", "types": [ "String" ], "description": "The operator used to separate the `actual` and `expected` values in the `message`" } ], "description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n\n\n#### Example\n\n", "short_description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n", "ellipsis_description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n ...", "line": 37, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.fail", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L37", "name": "fail", "path": "assert.fail" }, "assert.assert": { "id": "assert.assert", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "message", "types": [ "String" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value you receive" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails (alias of: asset.ok)" } ], "description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `assert.ok()`, except that `message` is\nrequired.", "short_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `assert.ok()`, except that `message` is\nrequired.", "ellipsis_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `a...", "line": 49, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.assert", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L49", "name": "assert", "path": "assert.assert" }, "assert.ok": { "id": "assert.ok", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value you receive" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails (alias of: assert.assert)", "optional": true } ], "description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `assert()`, except that `message` is not\nrequired.", "short_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `assert()`, except that `message` is not\nrequired.", "ellipsis_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `...", "line": 61, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.ok", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L61", "name": "ok", "path": "assert.ok" }, "assert.equal": { "id": "assert.equal", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ).", "short_description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ).", "ellipsis_description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ). ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.equal", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L71", "name": "equal", "path": "assert.equal" }, "assert.notEqual": { "id": "assert.notEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ).", "short_description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ).", "ellipsis_description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ). ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L82", "name": "notEqual", "path": "assert.notEqual" }, "assert.deepEqual": { "id": "assert.deepEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests for deep equality.", "short_description": "Tests for deep equality.", "ellipsis_description": "Tests for deep equality. ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.deepEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L92", "name": "deepEqual", "path": "assert.deepEqual" }, "assert.notDeepEqual": { "id": "assert.notDeepEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests for any deep inequality.", "short_description": "Tests for any deep inequality.", "ellipsis_description": "Tests for any deep inequality. ...", "line": 102, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notDeepEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L102", "name": "notDeepEqual", "path": "assert.notDeepEqual" }, "assert.strictEqual": { "id": "assert.strictEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests strict equality, as determined by the strict equality operator ( `===` ).", "short_description": "Tests strict equality, as determined by the strict equality operator ( `===` ).", "ellipsis_description": "Tests strict equality, as determined by the strict equality operator ( `===` ). ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.strictEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L112", "name": "strictEqual", "path": "assert.strictEqual" }, "assert.notStrictEqual": { "id": "assert.notStrictEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ).", "short_description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ).", "ellipsis_description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ). ...", "line": 123, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notStrictEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L123", "name": "notStrictEqual", "path": "assert.notStrictEqual" }, "assert.throws": { "id": "assert.throws", "type": "class method", "signatures": [ { "args": [ { "name": "block", "types": [ "Function" ] }, { "name": "error", "optional": true, "types": [ "Function", "RegExp", "Function" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "block", "types": [ "Function" ], "description": "A block of code to check against" }, { "name": "error", "types": [ "Function", "RegExp", "Function" ], "description": "The expected error that's thrown; this can be a constructor, regexp, or validation function", "optional": true }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "If `block`throws an error, then the assertion passes.\n\n#### Example: Validate `instanceof` using a constructor:\n\n\n\n#### Example: Validate an error message using regular expressions:\n\n\n\n#### Example: Custom error validation:\n\n", "short_description": "If `block`throws an error, then the assertion passes.\n", "ellipsis_description": "If `block`throws an error, then the assertion passes.\n ...", "line": 148, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.throws", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L148", "name": "throws", "path": "assert.throws" }, "assert.doesNotThrow": { "id": "assert.doesNotThrow", "type": "class method", "signatures": [ { "args": [ { "name": "block", "types": [ "Function" ] }, { "name": "error", "optional": true, "types": [ "RegExp", "Function" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "block", "types": [ "Function" ], "description": "A block of code to check against" }, { "name": "error", "types": [ "RegExp", "Function" ], "description": "The expected error that's thrown; this can be a constructor, regexp, or validation function", "optional": true }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Expects `block` not to throw an error; for more details, see `assert.throws()`.", "short_description": "Expects `block` not to throw an error; for more details, see `assert.throws()`.", "ellipsis_description": "Expects `block` not to throw an error; for more details, see `assert.throws()`. ...", "line": 159, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.doesNotThrow", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L159", "name": "doesNotThrow", "path": "assert.doesNotThrow" }, "assert.ifError": { "id": "assert.ifError", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value to check against" } ], "description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in callbacks.", "short_description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in callbacks.", "ellipsis_description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in call...", "line": 168, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.ifError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L168", "name": "ifError", "path": "assert.ifError" }, "Buffer": { "id": "Buffer", "type": "class", "metadata": { "type": "global" }, "description": "\nPure Javascript is Unicode friendly, but not nice to binary data. When dealing\nwith TCP streams or the file system, it's often necessary to handle octet\nstreams. Node has several strategies for manipulating, creating, and consuming\noctet streams.\n\nRaw data is stored in instances of the `Buffer` class. A `Buffer` is similar to\nan array of integers, but corresponds to a raw memory allocation outside the V8\nheap. A `Buffer` cannot be resized.\n\nThe `Buffer` class is a global, making it very rare that one would need to ever\n`require('buffer')`.\n\nConverting between Buffers and JavaScript string objects requires an explicit\nencoding method. These encoding methods are:\n\n* `'ascii'` - for 7 bit ASCII data only. This encoding method is very fast, and\nwill strip the high bit if set.\n Note that this encoding converts a null character (`'\\0'` or `'\\u0000'`) into\n`0x20` (character code of a space). If you want to convert a null character into\n`0x00`, you should use `'utf8'`.\n\n* `'base64'`: Base64 string encoding\n\n* `'binary'`: A way of encoding raw binary data into strings by using only the\nfirst 8 bits of each character. This encoding method is deprecated and should be\navoided in favor of `Buffer` objects where possible. This encoding is going to\nbe removed in future versions of Node.js.\n\n* `'hex'`: Encodes each byte as two hexidecimal characters.\n\n* `'ucs2'`: 2-bytes, little endian encoded Unicode characters. It can encode\nonly BMP (Basic Multilingual Plane—from U+0000 to U+FFFF).\n\n* `'utf8'` - Multi byte encoded Unicode characters. Many web pages and other\ndocument formats use UTF-8.\n\nIn most cases, the default of `'utf8'` is used.\n\nFor more information, see [this article on manipulating\nbuffers](../nodejs_dev_guide/manipulating_buffers.html).", "stability": "3 - Stable", "short_description": "\nPure Javascript is Unicode friendly, but not nice to binary data. When dealing\nwith TCP streams or the file system, it's often necessary to handle octet\nstreams. Node has several strategies for manipulating, creating, and consuming\noctet streams.\n", "ellipsis_description": "\nPure Javascript is Unicode friendly, but not nice to binary data. When dealing\nwith TCP streams or the file system...", "line": 49, "aliases": [], "children": [ { "id": "Buffer._charsWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.write()` is called.", "short_description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.write()` is called.", "ellipsis_description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.w...", "line": 655, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer._charsWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L655", "name": "_charsWritten", "path": "Buffer._charsWritten" }, { "id": "Buffer.copy", "type": "class method", "signatures": [ { "args": [ { "name": "targetBuffer", "types": [ "Buffer" ] }, { "name": "targetStart", "default_value": 0, "types": [ "Number" ] }, { "name": "sourceStart", "default_value": 0, "types": [ "Number" ] }, { "name": "sourceEnd", "default_value": "buffer.length", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "targetBuffer", "types": [ "Buffer" ], "description": "The buffer to copy into" }, { "name": "targetStart", "types": [ "Number" ], "description": "The offset to start at for the buffer you're copying into" }, { "name": "sourceStart", "types": [ "Number" ], "description": "The offset to start at for the buffer you're copying from" }, { "name": "sourceEnd", "types": [ "Number" ], "description": "The number of bytes to read from the originating buffer. Defaults to the length of the buffer" } ], "description": "Performs a copy between buffers. The source and target regions can overlap.\n\n#### Example: Building two buffers\n\n", "short_description": "Performs a copy between buffers. The source and target regions can overlap.\n", "ellipsis_description": "Performs a copy between buffers. The source and target regions can overlap.\n ...", "line": 100, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.copy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L100", "name": "copy", "path": "Buffer.copy" }, { "id": "Buffer.fill", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "offset", "default_value": 0, "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value to use to fill the buffer" }, { "name": "offset", "types": [ "Number" ], "description": "The position in the buffer to start filling at" }, { "name": "end", "types": [ "Number" ], "description": "The position in the buffer to stop filling at" } ], "description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n\n#### Example\n\n", "short_description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n", "ellipsis_description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n ...", "line": 115, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.fill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L115", "name": "fill", "path": "Buffer.fill" }, { "id": "Buffer.index", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is between `0x00` and `0xFF` hex or `0` and\n`255`.\n\n#### Example: Copy an ASCII string into a buffer, one byte at a time\n\n", "short_description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is between `0x00` and `0xFF` hex or `0` and\n`255`.\n", "ellipsis_description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is b...", "line": 647, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.index", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L647", "name": "index", "path": "Buffer.index" }, { "id": "Buffer.INSPECT_MAX_BYTES", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user modules.", "short_description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user modules.", "ellipsis_description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user mo...", "line": 677, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.INSPECT_MAX_BYTES", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L677", "name": "INSPECT_MAX_BYTES", "path": "Buffer.INSPECT_MAX_BYTES" }, { "id": "Buffer.isBuffer", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "The object to check" } ], "description": "Returns `true` if `obj` is a `Buffer`.", "short_description": "Returns `true` if `obj` is a `Buffer`.", "ellipsis_description": "Returns `true` if `obj` is a `Buffer`. ...", "line": 124, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.isBuffer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L124", "name": "isBuffer", "path": "Buffer.isBuffer" }, { "id": "Buffer.length", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the amount of memory allocated for the buffer\nobject. It does not change when the contents of the buffer are changed.\n\n#### Example\n\n", "short_description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the amount of memory allocated for the buffer\nobject. It does not change when the contents of the buffer are changed.\n", "ellipsis_description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the...", "line": 668, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.length", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L668", "name": "length", "path": "Buffer.length" }, { "id": "new Buffer", "type": "constructor", "signatures": [ {} ], "description": "Allocates a new buffer object.\n\nYou can use either:\n\n- an `array` of octects\n- allocation of a specific `size`\n- conversion from a `string` with the specified `encoding`\n\n#### Example\n\n var bBuffer = new Buffer(\"This is a Buffer.\", \"utf8\");\n\nBuffer.byteLength(string, encoding='utf8'), Number\n- string {String} The string to check\n- encoding {String} The encoding that the string is in\n\nGives the actual byte length of a string. This is not the same as\n`String.length` since that returns the number of _characters_ in a string.\n\n#### Example\n\n\n#### Returns\n\nReturns the byte length of a buffer", "short_description": "Allocates a new buffer object.\n", "ellipsis_description": "Allocates a new buffer object.\n ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L82", "name": "new", "path": "Buffer.new" }, { "id": "Buffer.readDoubleBE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n", "ellipsis_description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n ...", "line": 139, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readDoubleBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L139", "name": "readDoubleBE", "path": "Buffer.readDoubleBE" }, { "id": "Buffer.readDoubleLE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n", "ellipsis_description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n ...", "line": 155, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readDoubleLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L155", "name": "readDoubleLE", "path": "Buffer.readDoubleLE" }, { "id": "Buffer.readFloatBE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position noAssert {Boolean} If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n", "ellipsis_description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n ...", "line": 171, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readFloatBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L171", "name": "readFloatBE", "path": "Buffer.readFloatBE" }, { "id": "Buffer.readFloatLE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n\n\n#### Example\n\n", "short_description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n", "ellipsis_description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n ...", "line": 187, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readFloatLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L187", "name": "readFloatLE", "path": "Buffer.readFloatLE" }, { "id": "Buffer.readInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n\nThis function also works as [[Buffer.readUInt16BE `buffer.readUInt16BE()`]],\nexcept buffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n", "ellipsis_description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n ...", "line": 218, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L218", "name": "readInt16BE", "path": "Buffer.readInt16BE" }, { "id": "Buffer.readInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n\nThis function also works as [[Buffer.readUInt16LE `buffer.readUInt16LE()`]],\nexcept buffer contents are treated as a two'scomplement signed values.", "short_description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n", "ellipsis_description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n ...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L233", "name": "readInt16LE", "path": "Buffer.readInt16LE" }, { "id": "Buffer.readInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n\nThis function works like [[Buffer.readUInt32BE `buffer.readUInt32BE()`]], except\nbuffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n", "ellipsis_description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n ...", "line": 248, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L248", "name": "readInt32BE", "path": "Buffer.readInt32BE" }, { "id": "Buffer.readInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n\nThis function works like [[Buffer.readUInt32LE `buffer.readUInt32LE()`]], except\nbuffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n", "ellipsis_description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n ...", "line": 265, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L265", "name": "readInt32LE", "path": "Buffer.readInt32LE" }, { "id": "Buffer.readInt8", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n\nThis function also works as [[Buffer.readUInt8 `buffer.readUInt8()`]], except\nbuffer contents are treated as two's complement signed values.", "short_description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n", "ellipsis_description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L202", "name": "readInt8", "path": "Buffer.readInt8" }, { "id": "Buffer.readUInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n", "ellipsis_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L297", "name": "readUInt16BE", "path": "Buffer.readUInt16BE" }, { "id": "Buffer.readUInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n", "ellipsis_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n ...", "line": 312, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L312", "name": "readUInt16LE", "path": "Buffer.readUInt16LE" }, { "id": "Buffer.readUInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n", "ellipsis_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n ...", "line": 328, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L328", "name": "readUInt32BE", "path": "Buffer.readUInt32BE" }, { "id": "Buffer.readUInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n\n\n#### Example\n\n", "short_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n", "ellipsis_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n ...", "line": 345, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L345", "name": "readUInt32LE", "path": "Buffer.readUInt32LE" }, { "id": "Buffer.readUInt8", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n\n#### Example\n\n", "short_description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n", "ellipsis_description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n ...", "line": 281, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L281", "name": "readUInt8", "path": "Buffer.readUInt8" }, { "id": "Buffer.slice", "type": "class method", "signatures": [ { "args": [ { "name": "start", "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ], "returns": [ { "type": "Buffer" } ] } ], "arguments": [ { "name": "start", "types": [ "Number" ], "description": "The offset in the buffer to start from" }, { "name": "end", "types": [ "Number" ], "description": "The position of the last byte to slice. Defaults to the length of the buffer" } ], "description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` indexes.\n\nNote: Modifying the new buffer slice modifies memory in the original buffer!\n\n#### Example\n\nBuilding a `Buffer` with the ASCII alphabet, taking a slice, then modifying one\nbyte from the original `Buffer`:\n\n", "short_description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` indexes.\n", "ellipsis_description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` ind...", "line": 364, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.slice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L364", "name": "slice", "path": "Buffer.slice" }, { "id": "Buffer.toString", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "utf8", "types": [ "String" ] }, { "name": "start", "default_value": 0, "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" }, { "name": "start", "types": [ "Number" ], "description": "The starting byte offset; defaults to `0`" }, { "name": "end", "types": [ "Number" ], "description": "The number of bytes to write; defaults to the length of the buffer (related to: buffer.write)" } ], "description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`.", "short_description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`.", "ellipsis_description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`. ...", "line": 378, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.toString", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L378", "name": "toString", "path": "Buffer.toString" }, { "id": "Buffer.write", "type": "class method", "signatures": [ { "args": [ { "name": "string", "types": [ "String" ] }, { "name": "offset", "default_value": 0, "types": [ "Number" ] }, { "name": "length", "default_value": "startPos", "types": [ "Number" ] }, { "name": "encoding", "default_value": "utf8", "types": [ "String" ] } ], "returns": [ { "type": "Number" } ] } ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The string to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting byte offset" }, { "name": "length", "types": [ "Number" ], "description": "The number of bytes to write; defaults to the length of the buffer minus any offset (`buffer.length` - `buffer.offset`)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" } ], "description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `buffer` does not contain enough space to\nfit the entire string, it instead writes a partial amount of the string. The\nmethod doesn't write partial characters.\n\n\n#### Example\n\nWriting a utf8 string into a buffer, then printing it:\n\n\n\n#### Returns\n\nReturns number of octets written.", "short_description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `buffer` does not contain enough space to\nfit the entire string, it instead writes a partial amount of the string. The\nmethod doesn't write partial characters.\n", "ellipsis_description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L404", "name": "write", "path": "Buffer.write" }, { "id": "Buffer.writeDoubleBE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 bit double.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 bit double.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 ...", "line": 421, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeDoubleBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L421", "name": "writeDoubleBE", "path": "Buffer.writeDoubleBE" }, { "id": "Buffer.writeDoubleLE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 64 bit double.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 64 bit double.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 438, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeDoubleLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L438", "name": "writeDoubleLE", "path": "Buffer.writeDoubleLE" }, { "id": "Buffer.writeFloatBE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 bit float.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 bit float.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 ...", "line": 454, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeFloatBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L454", "name": "writeFloatBE", "path": "Buffer.writeFloatBE" }, { "id": "Buffer.writeFloatLE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 32 bit float.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 32 bit float.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 471, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeFloatLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L471", "name": "writeFloatLE", "path": "Buffer.writeFloatLE" }, { "id": "Buffer.writeInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 16 bit integer.\n\nThis function also works as `buffer.writeUInt16*()`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid sig...", "line": 504, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L504", "name": "writeInt16BE", "path": "Buffer.writeInt16BE" }, { "id": "Buffer.writeInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": "alse", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 16 bit integer.\n\nThis function also works as `buffer.writeUInt16*()`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 521, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L521", "name": "writeInt16LE", "path": "Buffer.writeInt16LE" }, { "id": "Buffer.writeInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 32 bit integer.\n\nThis function also works as `buffer.writeUInt32*`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid sig...", "line": 537, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L537", "name": "writeInt32BE", "path": "Buffer.writeInt32BE" }, { "id": "Buffer.writeInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 32 bit integer.\n\nThis function also works as `buffer.writeUInt32*`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 554, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L554", "name": "writeInt32LE", "path": "Buffer.writeInt32LE" }, { "id": "Buffer.writeInt8", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n\nWorks as `buffer.writeUInt8()`, except value is written out as a two's\ncomplement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n ...", "line": 487, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L487", "name": "writeInt8", "path": "Buffer.writeInt8" }, { "id": "Buffer.writeUInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 16 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid uns...", "line": 588, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L588", "name": "writeUInt16BE", "path": "Buffer.writeUInt16BE" }, { "id": "Buffer.writeUInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset" } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 16 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 603, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L603", "name": "writeUInt16LE", "path": "Buffer.writeUInt16LE" }, { "id": "Buffer.writeUInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 32 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid uns...", "line": 620, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L620", "name": "writeUInt32BE", "path": "Buffer.writeUInt32BE" }, { "id": "Buffer.writeUInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset" } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 32 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 634, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L634", "name": "writeUInt32LE", "path": "Buffer.writeUInt32LE" }, { "id": "Buffer.writeUInt8", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n ...", "line": 571, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L571", "name": "writeUInt8", "path": "Buffer.writeUInt8" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L49", "name": "Buffer", "path": "Buffer" }, "Buffer.new": { "id": "new Buffer", "type": "constructor", "signatures": [ {} ], "description": "Allocates a new buffer object.\n\nYou can use either:\n\n- an `array` of octects\n- allocation of a specific `size`\n- conversion from a `string` with the specified `encoding`\n\n#### Example\n\n var bBuffer = new Buffer(\"This is a Buffer.\", \"utf8\");\n\nBuffer.byteLength(string, encoding='utf8'), Number\n- string {String} The string to check\n- encoding {String} The encoding that the string is in\n\nGives the actual byte length of a string. This is not the same as\n`String.length` since that returns the number of _characters_ in a string.\n\n#### Example\n\n\n#### Returns\n\nReturns the byte length of a buffer", "short_description": "Allocates a new buffer object.\n", "ellipsis_description": "Allocates a new buffer object.\n ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L82", "name": "new", "path": "Buffer.new" }, "Buffer.copy": { "id": "Buffer.copy", "type": "class method", "signatures": [ { "args": [ { "name": "targetBuffer", "types": [ "Buffer" ] }, { "name": "targetStart", "default_value": 0, "types": [ "Number" ] }, { "name": "sourceStart", "default_value": 0, "types": [ "Number" ] }, { "name": "sourceEnd", "default_value": "buffer.length", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "targetBuffer", "types": [ "Buffer" ], "description": "The buffer to copy into" }, { "name": "targetStart", "types": [ "Number" ], "description": "The offset to start at for the buffer you're copying into" }, { "name": "sourceStart", "types": [ "Number" ], "description": "The offset to start at for the buffer you're copying from" }, { "name": "sourceEnd", "types": [ "Number" ], "description": "The number of bytes to read from the originating buffer. Defaults to the length of the buffer" } ], "description": "Performs a copy between buffers. The source and target regions can overlap.\n\n#### Example: Building two buffers\n\n", "short_description": "Performs a copy between buffers. The source and target regions can overlap.\n", "ellipsis_description": "Performs a copy between buffers. The source and target regions can overlap.\n ...", "line": 100, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.copy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L100", "name": "copy", "path": "Buffer.copy" }, "Buffer.fill": { "id": "Buffer.fill", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "offset", "default_value": 0, "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value to use to fill the buffer" }, { "name": "offset", "types": [ "Number" ], "description": "The position in the buffer to start filling at" }, { "name": "end", "types": [ "Number" ], "description": "The position in the buffer to stop filling at" } ], "description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n\n#### Example\n\n", "short_description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n", "ellipsis_description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n ...", "line": 115, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.fill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L115", "name": "fill", "path": "Buffer.fill" }, "Buffer.isBuffer": { "id": "Buffer.isBuffer", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "The object to check" } ], "description": "Returns `true` if `obj` is a `Buffer`.", "short_description": "Returns `true` if `obj` is a `Buffer`.", "ellipsis_description": "Returns `true` if `obj` is a `Buffer`. ...", "line": 124, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.isBuffer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L124", "name": "isBuffer", "path": "Buffer.isBuffer" }, "Buffer.readDoubleBE": { "id": "Buffer.readDoubleBE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n", "ellipsis_description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n ...", "line": 139, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readDoubleBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L139", "name": "readDoubleBE", "path": "Buffer.readDoubleBE" }, "Buffer.readDoubleLE": { "id": "Buffer.readDoubleLE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n", "ellipsis_description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n ...", "line": 155, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readDoubleLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L155", "name": "readDoubleLE", "path": "Buffer.readDoubleLE" }, "Buffer.readFloatBE": { "id": "Buffer.readFloatBE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position noAssert {Boolean} If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n", "ellipsis_description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n ...", "line": 171, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readFloatBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L171", "name": "readFloatBE", "path": "Buffer.readFloatBE" }, "Buffer.readFloatLE": { "id": "Buffer.readFloatLE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n\n\n#### Example\n\n", "short_description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n", "ellipsis_description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n ...", "line": 187, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readFloatLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L187", "name": "readFloatLE", "path": "Buffer.readFloatLE" }, "Buffer.readInt8": { "id": "Buffer.readInt8", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n\nThis function also works as [[Buffer.readUInt8 `buffer.readUInt8()`]], except\nbuffer contents are treated as two's complement signed values.", "short_description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n", "ellipsis_description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L202", "name": "readInt8", "path": "Buffer.readInt8" }, "Buffer.readInt16BE": { "id": "Buffer.readInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n\nThis function also works as [[Buffer.readUInt16BE `buffer.readUInt16BE()`]],\nexcept buffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n", "ellipsis_description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n ...", "line": 218, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L218", "name": "readInt16BE", "path": "Buffer.readInt16BE" }, "Buffer.readInt16LE": { "id": "Buffer.readInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n\nThis function also works as [[Buffer.readUInt16LE `buffer.readUInt16LE()`]],\nexcept buffer contents are treated as a two'scomplement signed values.", "short_description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n", "ellipsis_description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n ...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L233", "name": "readInt16LE", "path": "Buffer.readInt16LE" }, "Buffer.readInt32BE": { "id": "Buffer.readInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n\nThis function works like [[Buffer.readUInt32BE `buffer.readUInt32BE()`]], except\nbuffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n", "ellipsis_description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n ...", "line": 248, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L248", "name": "readInt32BE", "path": "Buffer.readInt32BE" }, "Buffer.readInt32LE": { "id": "Buffer.readInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n\nThis function works like [[Buffer.readUInt32LE `buffer.readUInt32LE()`]], except\nbuffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n", "ellipsis_description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n ...", "line": 265, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L265", "name": "readInt32LE", "path": "Buffer.readInt32LE" }, "Buffer.readUInt8": { "id": "Buffer.readUInt8", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n\n#### Example\n\n", "short_description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n", "ellipsis_description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n ...", "line": 281, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L281", "name": "readUInt8", "path": "Buffer.readUInt8" }, "Buffer.readUInt16BE": { "id": "Buffer.readUInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n", "ellipsis_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L297", "name": "readUInt16BE", "path": "Buffer.readUInt16BE" }, "Buffer.readUInt16LE": { "id": "Buffer.readUInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n", "ellipsis_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n ...", "line": 312, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L312", "name": "readUInt16LE", "path": "Buffer.readUInt16LE" }, "Buffer.readUInt32BE": { "id": "Buffer.readUInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n", "ellipsis_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n ...", "line": 328, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L328", "name": "readUInt32BE", "path": "Buffer.readUInt32BE" }, "Buffer.readUInt32LE": { "id": "Buffer.readUInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n\n\n#### Example\n\n", "short_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n", "ellipsis_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n ...", "line": 345, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L345", "name": "readUInt32LE", "path": "Buffer.readUInt32LE" }, "Buffer.slice": { "id": "Buffer.slice", "type": "class method", "signatures": [ { "args": [ { "name": "start", "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ], "returns": [ { "type": "Buffer" } ] } ], "arguments": [ { "name": "start", "types": [ "Number" ], "description": "The offset in the buffer to start from" }, { "name": "end", "types": [ "Number" ], "description": "The position of the last byte to slice. Defaults to the length of the buffer" } ], "description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` indexes.\n\nNote: Modifying the new buffer slice modifies memory in the original buffer!\n\n#### Example\n\nBuilding a `Buffer` with the ASCII alphabet, taking a slice, then modifying one\nbyte from the original `Buffer`:\n\n", "short_description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` indexes.\n", "ellipsis_description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` ind...", "line": 364, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.slice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L364", "name": "slice", "path": "Buffer.slice" }, "Buffer.toString": { "id": "Buffer.toString", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "utf8", "types": [ "String" ] }, { "name": "start", "default_value": 0, "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" }, { "name": "start", "types": [ "Number" ], "description": "The starting byte offset; defaults to `0`" }, { "name": "end", "types": [ "Number" ], "description": "The number of bytes to write; defaults to the length of the buffer (related to: buffer.write)" } ], "description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`.", "short_description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`.", "ellipsis_description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`. ...", "line": 378, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.toString", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L378", "name": "toString", "path": "Buffer.toString" }, "Buffer.write": { "id": "Buffer.write", "type": "class method", "signatures": [ { "args": [ { "name": "string", "types": [ "String" ] }, { "name": "offset", "default_value": 0, "types": [ "Number" ] }, { "name": "length", "default_value": "startPos", "types": [ "Number" ] }, { "name": "encoding", "default_value": "utf8", "types": [ "String" ] } ], "returns": [ { "type": "Number" } ] } ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The string to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting byte offset" }, { "name": "length", "types": [ "Number" ], "description": "The number of bytes to write; defaults to the length of the buffer minus any offset (`buffer.length` - `buffer.offset`)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" } ], "description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `buffer` does not contain enough space to\nfit the entire string, it instead writes a partial amount of the string. The\nmethod doesn't write partial characters.\n\n\n#### Example\n\nWriting a utf8 string into a buffer, then printing it:\n\n\n\n#### Returns\n\nReturns number of octets written.", "short_description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `buffer` does not contain enough space to\nfit the entire string, it instead writes a partial amount of the string. The\nmethod doesn't write partial characters.\n", "ellipsis_description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L404", "name": "write", "path": "Buffer.write" }, "Buffer.writeDoubleBE": { "id": "Buffer.writeDoubleBE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 bit double.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 bit double.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 ...", "line": 421, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeDoubleBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L421", "name": "writeDoubleBE", "path": "Buffer.writeDoubleBE" }, "Buffer.writeDoubleLE": { "id": "Buffer.writeDoubleLE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 64 bit double.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 64 bit double.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 438, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeDoubleLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L438", "name": "writeDoubleLE", "path": "Buffer.writeDoubleLE" }, "Buffer.writeFloatBE": { "id": "Buffer.writeFloatBE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 bit float.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 bit float.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 ...", "line": 454, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeFloatBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L454", "name": "writeFloatBE", "path": "Buffer.writeFloatBE" }, "Buffer.writeFloatLE": { "id": "Buffer.writeFloatLE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 32 bit float.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 32 bit float.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 471, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeFloatLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L471", "name": "writeFloatLE", "path": "Buffer.writeFloatLE" }, "Buffer.writeInt8": { "id": "Buffer.writeInt8", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n\nWorks as `buffer.writeUInt8()`, except value is written out as a two's\ncomplement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n ...", "line": 487, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L487", "name": "writeInt8", "path": "Buffer.writeInt8" }, "Buffer.writeInt16BE": { "id": "Buffer.writeInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 16 bit integer.\n\nThis function also works as `buffer.writeUInt16*()`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid sig...", "line": 504, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L504", "name": "writeInt16BE", "path": "Buffer.writeInt16BE" }, "Buffer.writeInt16LE": { "id": "Buffer.writeInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": "alse", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 16 bit integer.\n\nThis function also works as `buffer.writeUInt16*()`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 521, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L521", "name": "writeInt16LE", "path": "Buffer.writeInt16LE" }, "Buffer.writeInt32BE": { "id": "Buffer.writeInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 32 bit integer.\n\nThis function also works as `buffer.writeUInt32*`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid sig...", "line": 537, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L537", "name": "writeInt32BE", "path": "Buffer.writeInt32BE" }, "Buffer.writeInt32LE": { "id": "Buffer.writeInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 32 bit integer.\n\nThis function also works as `buffer.writeUInt32*`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 554, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L554", "name": "writeInt32LE", "path": "Buffer.writeInt32LE" }, "Buffer.writeUInt8": { "id": "Buffer.writeUInt8", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n ...", "line": 571, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L571", "name": "writeUInt8", "path": "Buffer.writeUInt8" }, "Buffer.writeUInt16BE": { "id": "Buffer.writeUInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 16 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid uns...", "line": 588, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L588", "name": "writeUInt16BE", "path": "Buffer.writeUInt16BE" }, "Buffer.writeUInt16LE": { "id": "Buffer.writeUInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset" } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 16 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 603, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L603", "name": "writeUInt16LE", "path": "Buffer.writeUInt16LE" }, "Buffer.writeUInt32BE": { "id": "Buffer.writeUInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 32 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid uns...", "line": 620, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L620", "name": "writeUInt32BE", "path": "Buffer.writeUInt32BE" }, "Buffer.writeUInt32LE": { "id": "Buffer.writeUInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset" } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 32 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 634, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L634", "name": "writeUInt32LE", "path": "Buffer.writeUInt32LE" }, "Buffer.index": { "id": "Buffer.index", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is between `0x00` and `0xFF` hex or `0` and\n`255`.\n\n#### Example: Copy an ASCII string into a buffer, one byte at a time\n\n", "short_description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is between `0x00` and `0xFF` hex or `0` and\n`255`.\n", "ellipsis_description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is b...", "line": 647, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.index", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L647", "name": "index", "path": "Buffer.index" }, "Buffer._charsWritten": { "id": "Buffer._charsWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.write()` is called.", "short_description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.write()` is called.", "ellipsis_description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.w...", "line": 655, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer._charsWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L655", "name": "_charsWritten", "path": "Buffer._charsWritten" }, "Buffer.length": { "id": "Buffer.length", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the amount of memory allocated for the buffer\nobject. It does not change when the contents of the buffer are changed.\n\n#### Example\n\n", "short_description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the amount of memory allocated for the buffer\nobject. It does not change when the contents of the buffer are changed.\n", "ellipsis_description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the...", "line": 668, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.length", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L668", "name": "length", "path": "Buffer.length" }, "Buffer.INSPECT_MAX_BYTES": { "id": "Buffer.INSPECT_MAX_BYTES", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user modules.", "short_description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user modules.", "ellipsis_description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user mo...", "line": 677, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.INSPECT_MAX_BYTES", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L677", "name": "INSPECT_MAX_BYTES", "path": "Buffer.INSPECT_MAX_BYTES" }, "child_process": { "id": "child_process", "type": "class", "description": "\nNode.js provides a tri-directional\n[`popen(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/popen.3.html)\nfacility through the `child_process` module. It's possible to stream data\nthrough the child's `stdin`, `stdout`, and `stderr` in a fully non-blocking way.\n\nTo create a child process object, use `require('child_process')` in your code.\n\nChild processes always have three streams associated with them. They are:\n\n* `child.stdin`, the standard input stream\n* `child.stdout`, the standard output stream\n* `child.stderr`, the standard error stream\n\n#### Example: Running ls in a child process\n\n", "stability": "3 - Stable", "short_description": "\nNode.js provides a tri-directional\n[`popen(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/popen.3.html)\nfacility through the `child_process` module. It's possible to stream data\nthrough the child's `stdin`, `stdout`, and `stderr` in a fully non-blocking way.\n", "ellipsis_description": "\nNode.js provides a tri-directional\n[`popen(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/popen.3.html)...", "line": 24, "aliases": [], "children": [ { "id": "child_process.exec", "type": "class method", "signatures": [ { "args": [ { "name": "command", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "command", "types": [ "String" ], "description": "The Unix command to run" }, { "name": "options", "types": [ "Object" ], "description": "The options to pass to the command", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to run after the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard `Error` object; `err.code` is the exit code of the child process and `err.signal` is set to the signal that terminated the process" }, { "name": "stdout", "types": [ "streams.ReadableStream" ], "description": "The standard output stream" }, { "name": "stderr", "types": [ "streams.ReadableStream" ], "description": "The standard error stream (related to: child_process.spawn)" } ], "description": "Runs a Unix command in a shell and buffers the output.\n\nThere is a second optional argument to specify several options. The default\noptions are:\n\n {\n encoding: 'utf8',\n timeout: 0,\n maxBuffer: 200*1024,\n killSignal: 'SIGTERM',\n cwd: null,\n env: null\n }\n\nThese refer to:\n\n* `encoding` is the current encoding the output is defined with\n* `timeout` is an integer, which, if greater than `0`, kills the child process\nif it runs longer than `timeout` milliseconds\n* `maxBuffer` specifies the largest amount of data allowed on stdout or stderr;\nif this value is exceeded then the child process is killed.\n* `killSignal` defines [a kill\nsignal](http://kernel.org/doc/man-pages/online/pages/man7/signal.7.html) to kill\nthe child process with\n* `cwd` is a string defining the current working directory\n* `env` is an object with the current environment options\n\n#### Example\n\n\n\n* `modulePath` {String} The module to run in the child\n* `args` {Array} List of string arguments\n* `options` {Object}\n * `cwd` {String} Current working directory of the child process\n * `customFds` {Array} **Deprecated** File descriptors for the child to use\n for stdio. (See below)\n * `env` {Object} Environment key-value pairs\n * `encoding` {String} (Default: 'utf8')\n * `timeout` {Number} (Default: 0)\n* `callback` {Function} called with the output when process terminates\n * `code` {Integer} Exit code\n * `stdout` {Buffer}\n * `stderr` {Buffer}\n* Return: ChildProcess object\n\nAn object containing the three standard streams, plus other parameters like the\nPID, signal code, and exit code", "short_description": "Runs a Unix command in a shell and buffers the output.\n", "ellipsis_description": "Runs a Unix command in a shell and buffers the output.\n ...", "line": 180, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.exec", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L180", "name": "exec", "path": "child_process.exec" }, { "id": "child_process.execFile", "type": "class method", "signatures": [ { "args": [ { "name": "file", "types": [ "String" ] }, { "name": "args", "types": [ "String" ] }, { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "file", "types": [ "String" ], "description": "The file location with the commands to run" }, { "name": "args", "types": [ "String" ], "description": "The command line arguments to pass" }, { "name": "options", "types": [ "Object" ], "description": "The options to pass to the `exec` call" }, { "name": "callback", "types": [ "Function" ], "description": "The function to run after the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard `Error` object, except `err.code` is the exit code of the child process, and `err.signal is set to the signal that terminated the process" }, { "name": "stdout", "types": [ "streams.ReadableStream" ], "description": "is the standard output stream" }, { "name": "stderr", "types": [ "streams.ReadableStream" ], "description": "is the standard error stream" } ], "description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly. This makes it slightly leaner than\n`child.exec`. It has the same options and callback.", "short_description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly. This makes it slightly leaner than\n`child.exec`. It has the same options and callback.", "ellipsis_description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.execFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L198", "name": "execFile", "path": "child_process.execFile" }, { "id": "child_process.fork", "type": "class method", "signatures": [ { "args": [ { "name": "modulePath", "types": [ "String" ] }, { "name": "arguments", "types": [ "Array" ] }, { "name": "options", "types": [ "Object" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "modulePath", "types": [ "String" ], "description": "The location of the module" }, { "name": "arguments", "types": [ "Array" ], "description": "A list of string arguments to use" }, { "name": "options", "types": [ "Object" ], "description": "Any additional options to pass `cwd` {String} Current working directory of the child process `customFds` {Array} Deprecated File descriptors for the child to use for stdio. (See below) `env` {Object} Environment key-value pairs `encoding` {String} (Default: 'utf8') `timeout` {Number} (Default: 0) (related to: child_process.spawn)" } ], "description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js processes. In addition to having all the\nmethods in a normal ChildProcess instance, the returned object has a\ncommunication channel built-in. The channel is written with `child.send(message,\n[sendHandle])`, and messages are recieved by a `'message'` event on the child.\n\nBy default the spawned Node.js process will have the `stdin`, `stdout`, `stderr`\nassociated with the parent's.\n\nThese child nodes are still whole new instances of V8. Assume at least 30ms\nstartup and 10mb memory for each new node. That is, you can't create many\nthousands of them.\n\n#### Example\n\n\n\nThe child script, `'sub.js'`, might look like this:\n\n\n\nIn the child, the `process` object has a `send()` method, and `process` emits\nobjects each time it receives a message on its channel.\n\nThe `sendHandle` option on `child.send()` is for sending a handle object to\nanother process. The child receives the handle as as second argument to the\n`message` event. Here's an example of sending a handle:\n\n var server = require('net').createServer();\n var child = require('child_process').fork(__dirname + '/child.js');\n // Open up the server object and send the handle.\n server.listen(1337, function() {\n child.send({ server: true }, server._handle);\n });\n\nHere's an example of receiving the server handle and sharing it between\nprocesses:\n\n process.on('message', function(m, serverHandle) {\n if (serverHandle) {\n var server = require('net').createServer();\n server.listen(serverHandle);\n }\n });", "short_description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js processes. In addition to having all the\nmethods in a normal ChildProcess instance, the returned object has a\ncommunication channel built-in. The channel is written with `child.send(message,\n[sendHandle])`, and messages are recieved by a `'message'` event on the child.\n", "ellipsis_description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js pro...", "line": 259, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L259", "name": "fork", "path": "child_process.fork" }, { "id": "child_process.kill", "type": "class method", "signatures": [ { "args": [ { "name": "signal", "default_value": "SIGTERM", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "signal", "types": [ "String" ], "description": "The kill signal to send", "optional": true } ], "description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.htm\nl) for a list of available signals.\n\nNote that while the function is called `kill`, the signal delivered to the child\nprocess may not actually kill it. `kill` really just sends a signal to a\nprocess.\n\nFor more information, see\n[`kill(2)`](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n\n#### Example\n\n", "short_description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.htm\nl) for a list of available signals.\n", "ellipsis_description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal....", "line": 279, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.kill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L279", "name": "kill", "path": "child_process.kill" }, { "id": "child_process.pid", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The PID of the child process.\n\n#### Example\n\n", "short_description": "The PID of the child process.\n", "ellipsis_description": "The PID of the child process.\n ...", "line": 65, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.pid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L65", "name": "pid", "path": "child_process.pid" }, { "id": "child_process.spawn", "type": "class method", "signatures": [ { "args": [ { "name": "command", "types": [ "String" ] }, { "name": "args", "optional": true, "types": [ "String", "Array" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "command", "types": [ "String" ], "description": "The Unix command to spawn" }, { "name": "args", "types": [ "String", "Array" ], "description": "The command line arguments to pass", "optional": true }, { "name": "options", "types": [ "Object" ], "description": "Any additional options you want to transfer (related to: child_process.exec)", "optional": true } ], "description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` specifies additional options, which default\nto:\n\n {\n\t\t\tcwd: undefined,\n \tenv: process.env\n }\n\nThey refer to:\n\n* `cwd` specifies the working directory from which the process is spawned\n* `env` specifies environment variables that will be visible to the new process\n\nNote that if `spawn()` receives an empty `options` object, it spawns the process\nwith an empty environment rather than using [[process.env `process.env`]]. This\nis due to backwards compatibility issues with a deprecated API.\n\n##### Undocumented Options\n\nThere are several internal options—in particular: `stdinStream`, `stdoutStream`,\nand `stderrStream`. They are for INTERNAL USE ONLY. As with all undocumented\nAPIs in Node.js, they shouldn't be used.\n\nThere is also a deprecated option called `customFds`, which allows one to\nspecify specific file descriptors for the `stdio` of the child process. This API\nwas not portable to all platforms and therefore removed. With `customFds`, it\nwas possible to hook up the new process' [stdin, stdout, stderr] to existing\nstream; `-1` meant that a new stream should be created. **Use this functionality\nat your own risk.**\n\n#### Example: Running `ls -lh /usr`, capturing `stdout`, `stderr`, and the exit\ncode\n\n\n\n#### Example: A very elaborate way to run `'ps ax | grep ssh'`:\n\n\n\n#### Example: Checking for a failed `exec`:\n\n", "short_description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` specifies additional options, which default\nto:\n", "ellipsis_description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` s...", "line": 118, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.spawn", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L118", "name": "spawn", "path": "child_process.spawn" }, { "id": "child_process.stdin", "type": "class property", "signatures": [ { "returns": [ { "type": "streams.WritableStream" } ] } ], "description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via [[streams.WritableStream.end\n`streams.WritableStream.end()`]] often causes the child process to terminate.", "short_description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via [[streams.WritableStream.end\n`streams.WritableStream.end()`]] often causes the child process to terminate.", "ellipsis_description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via ...", "line": 46, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.stdin", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L46", "name": "stdin", "path": "child_process.stdin" }, { "id": "child_process.stdout", "type": "class property", "signatures": [ { "returns": [ { "type": "streams.ReadableStream" } ] } ], "description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`.", "short_description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`.", "ellipsis_description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`. ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.stdout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L54", "name": "stdout", "path": "child_process.stdout" }, { "id": "child_process@exit", "type": "event", "signatures": [ { "args": [ { "name": "code", "types": [ "Number" ] }, { "name": "signal", "types": [ "String" ] } ] } ], "arguments": [ { "name": "code", "types": [ "Number" ], "description": "The final exit code of the process (otherwise, `null`)" }, { "name": "signal", "types": [ "String" ], "description": "The string name of the signal (otherwise, `null`)" } ], "description": "This event is emitted after the child process ends.\n\nFor more information, see\n[waitpid(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/wait.2.html).", "short_description": "This event is emitted after the child process ends.\n", "ellipsis_description": "This event is emitted after the child process ends.\n ...", "line": 37, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process@exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L37", "name": "exit", "path": "child_process.event.exit" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L24", "name": "child_process", "path": "child_process" }, "child_process@exit": { "id": "child_process@exit", "type": "event", "signatures": [ { "args": [ { "name": "code", "types": [ "Number" ] }, { "name": "signal", "types": [ "String" ] } ] } ], "arguments": [ { "name": "code", "types": [ "Number" ], "description": "The final exit code of the process (otherwise, `null`)" }, { "name": "signal", "types": [ "String" ], "description": "The string name of the signal (otherwise, `null`)" } ], "description": "This event is emitted after the child process ends.\n\nFor more information, see\n[waitpid(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/wait.2.html).", "short_description": "This event is emitted after the child process ends.\n", "ellipsis_description": "This event is emitted after the child process ends.\n ...", "line": 37, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process@exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L37", "name": "exit", "path": "child_process.event.exit" }, "child_process.stdin": { "id": "child_process.stdin", "type": "class property", "signatures": [ { "returns": [ { "type": "streams.WritableStream" } ] } ], "description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via [[streams.WritableStream.end\n`streams.WritableStream.end()`]] often causes the child process to terminate.", "short_description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via [[streams.WritableStream.end\n`streams.WritableStream.end()`]] often causes the child process to terminate.", "ellipsis_description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via ...", "line": 46, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.stdin", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L46", "name": "stdin", "path": "child_process.stdin" }, "child_process.stdout": { "id": "child_process.stdout", "type": "class property", "signatures": [ { "returns": [ { "type": "streams.ReadableStream" } ] } ], "description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`.", "short_description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`.", "ellipsis_description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`. ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.stdout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L54", "name": "stdout", "path": "child_process.stdout" }, "child_process.pid": { "id": "child_process.pid", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The PID of the child process.\n\n#### Example\n\n", "short_description": "The PID of the child process.\n", "ellipsis_description": "The PID of the child process.\n ...", "line": 65, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.pid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L65", "name": "pid", "path": "child_process.pid" }, "child_process.spawn": { "id": "child_process.spawn", "type": "class method", "signatures": [ { "args": [ { "name": "command", "types": [ "String" ] }, { "name": "args", "optional": true, "types": [ "String", "Array" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "command", "types": [ "String" ], "description": "The Unix command to spawn" }, { "name": "args", "types": [ "String", "Array" ], "description": "The command line arguments to pass", "optional": true }, { "name": "options", "types": [ "Object" ], "description": "Any additional options you want to transfer (related to: child_process.exec)", "optional": true } ], "description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` specifies additional options, which default\nto:\n\n {\n\t\t\tcwd: undefined,\n \tenv: process.env\n }\n\nThey refer to:\n\n* `cwd` specifies the working directory from which the process is spawned\n* `env` specifies environment variables that will be visible to the new process\n\nNote that if `spawn()` receives an empty `options` object, it spawns the process\nwith an empty environment rather than using [[process.env `process.env`]]. This\nis due to backwards compatibility issues with a deprecated API.\n\n##### Undocumented Options\n\nThere are several internal options—in particular: `stdinStream`, `stdoutStream`,\nand `stderrStream`. They are for INTERNAL USE ONLY. As with all undocumented\nAPIs in Node.js, they shouldn't be used.\n\nThere is also a deprecated option called `customFds`, which allows one to\nspecify specific file descriptors for the `stdio` of the child process. This API\nwas not portable to all platforms and therefore removed. With `customFds`, it\nwas possible to hook up the new process' [stdin, stdout, stderr] to existing\nstream; `-1` meant that a new stream should be created. **Use this functionality\nat your own risk.**\n\n#### Example: Running `ls -lh /usr`, capturing `stdout`, `stderr`, and the exit\ncode\n\n\n\n#### Example: A very elaborate way to run `'ps ax | grep ssh'`:\n\n\n\n#### Example: Checking for a failed `exec`:\n\n", "short_description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` specifies additional options, which default\nto:\n", "ellipsis_description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` s...", "line": 118, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.spawn", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L118", "name": "spawn", "path": "child_process.spawn" }, "child_process.exec": { "id": "child_process.exec", "type": "class method", "signatures": [ { "args": [ { "name": "command", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "command", "types": [ "String" ], "description": "The Unix command to run" }, { "name": "options", "types": [ "Object" ], "description": "The options to pass to the command", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to run after the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard `Error` object; `err.code` is the exit code of the child process and `err.signal` is set to the signal that terminated the process" }, { "name": "stdout", "types": [ "streams.ReadableStream" ], "description": "The standard output stream" }, { "name": "stderr", "types": [ "streams.ReadableStream" ], "description": "The standard error stream (related to: child_process.spawn)" } ], "description": "Runs a Unix command in a shell and buffers the output.\n\nThere is a second optional argument to specify several options. The default\noptions are:\n\n {\n encoding: 'utf8',\n timeout: 0,\n maxBuffer: 200*1024,\n killSignal: 'SIGTERM',\n cwd: null,\n env: null\n }\n\nThese refer to:\n\n* `encoding` is the current encoding the output is defined with\n* `timeout` is an integer, which, if greater than `0`, kills the child process\nif it runs longer than `timeout` milliseconds\n* `maxBuffer` specifies the largest amount of data allowed on stdout or stderr;\nif this value is exceeded then the child process is killed.\n* `killSignal` defines [a kill\nsignal](http://kernel.org/doc/man-pages/online/pages/man7/signal.7.html) to kill\nthe child process with\n* `cwd` is a string defining the current working directory\n* `env` is an object with the current environment options\n\n#### Example\n\n\n\n* `modulePath` {String} The module to run in the child\n* `args` {Array} List of string arguments\n* `options` {Object}\n * `cwd` {String} Current working directory of the child process\n * `customFds` {Array} **Deprecated** File descriptors for the child to use\n for stdio. (See below)\n * `env` {Object} Environment key-value pairs\n * `encoding` {String} (Default: 'utf8')\n * `timeout` {Number} (Default: 0)\n* `callback` {Function} called with the output when process terminates\n * `code` {Integer} Exit code\n * `stdout` {Buffer}\n * `stderr` {Buffer}\n* Return: ChildProcess object\n\nAn object containing the three standard streams, plus other parameters like the\nPID, signal code, and exit code", "short_description": "Runs a Unix command in a shell and buffers the output.\n", "ellipsis_description": "Runs a Unix command in a shell and buffers the output.\n ...", "line": 180, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.exec", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L180", "name": "exec", "path": "child_process.exec" }, "child_process.execFile": { "id": "child_process.execFile", "type": "class method", "signatures": [ { "args": [ { "name": "file", "types": [ "String" ] }, { "name": "args", "types": [ "String" ] }, { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "file", "types": [ "String" ], "description": "The file location with the commands to run" }, { "name": "args", "types": [ "String" ], "description": "The command line arguments to pass" }, { "name": "options", "types": [ "Object" ], "description": "The options to pass to the `exec` call" }, { "name": "callback", "types": [ "Function" ], "description": "The function to run after the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard `Error` object, except `err.code` is the exit code of the child process, and `err.signal is set to the signal that terminated the process" }, { "name": "stdout", "types": [ "streams.ReadableStream" ], "description": "is the standard output stream" }, { "name": "stderr", "types": [ "streams.ReadableStream" ], "description": "is the standard error stream" } ], "description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly. This makes it slightly leaner than\n`child.exec`. It has the same options and callback.", "short_description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly. This makes it slightly leaner than\n`child.exec`. It has the same options and callback.", "ellipsis_description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.execFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L198", "name": "execFile", "path": "child_process.execFile" }, "child_process.fork": { "id": "child_process.fork", "type": "class method", "signatures": [ { "args": [ { "name": "modulePath", "types": [ "String" ] }, { "name": "arguments", "types": [ "Array" ] }, { "name": "options", "types": [ "Object" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "modulePath", "types": [ "String" ], "description": "The location of the module" }, { "name": "arguments", "types": [ "Array" ], "description": "A list of string arguments to use" }, { "name": "options", "types": [ "Object" ], "description": "Any additional options to pass `cwd` {String} Current working directory of the child process `customFds` {Array} Deprecated File descriptors for the child to use for stdio. (See below) `env` {Object} Environment key-value pairs `encoding` {String} (Default: 'utf8') `timeout` {Number} (Default: 0) (related to: child_process.spawn)" } ], "description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js processes. In addition to having all the\nmethods in a normal ChildProcess instance, the returned object has a\ncommunication channel built-in. The channel is written with `child.send(message,\n[sendHandle])`, and messages are recieved by a `'message'` event on the child.\n\nBy default the spawned Node.js process will have the `stdin`, `stdout`, `stderr`\nassociated with the parent's.\n\nThese child nodes are still whole new instances of V8. Assume at least 30ms\nstartup and 10mb memory for each new node. That is, you can't create many\nthousands of them.\n\n#### Example\n\n\n\nThe child script, `'sub.js'`, might look like this:\n\n\n\nIn the child, the `process` object has a `send()` method, and `process` emits\nobjects each time it receives a message on its channel.\n\nThe `sendHandle` option on `child.send()` is for sending a handle object to\nanother process. The child receives the handle as as second argument to the\n`message` event. Here's an example of sending a handle:\n\n var server = require('net').createServer();\n var child = require('child_process').fork(__dirname + '/child.js');\n // Open up the server object and send the handle.\n server.listen(1337, function() {\n child.send({ server: true }, server._handle);\n });\n\nHere's an example of receiving the server handle and sharing it between\nprocesses:\n\n process.on('message', function(m, serverHandle) {\n if (serverHandle) {\n var server = require('net').createServer();\n server.listen(serverHandle);\n }\n });", "short_description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js processes. In addition to having all the\nmethods in a normal ChildProcess instance, the returned object has a\ncommunication channel built-in. The channel is written with `child.send(message,\n[sendHandle])`, and messages are recieved by a `'message'` event on the child.\n", "ellipsis_description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js pro...", "line": 259, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L259", "name": "fork", "path": "child_process.fork" }, "child_process.kill": { "id": "child_process.kill", "type": "class method", "signatures": [ { "args": [ { "name": "signal", "default_value": "SIGTERM", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "signal", "types": [ "String" ], "description": "The kill signal to send", "optional": true } ], "description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.htm\nl) for a list of available signals.\n\nNote that while the function is called `kill`, the signal delivered to the child\nprocess may not actually kill it. `kill` really just sends a signal to a\nprocess.\n\nFor more information, see\n[`kill(2)`](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n\n#### Example\n\n", "short_description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.htm\nl) for a list of available signals.\n", "ellipsis_description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal....", "line": 279, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.kill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L279", "name": "kill", "path": "child_process.kill" }, "cluster": { "id": "cluster", "type": "class", "description": "\nA single instance of Node runs in a single thread. To take advantage of\nmulti-core systems the user will sometimes want to launch a cluster of Node\nprocesses to handle the load.\n\nTo use this module, add `require('cluster')` to your code.\n\nNote: This feature was introduced recently, and may change in future versions. Please try it out and provide feedback.\n\n#### Example: Launching one cluster working for each CPU\n\nThe cluster module allows you to easily create a network of processes that all\nshare server ports.\n\nCreate a file called _server.js_ and paste the following code:\n\n\n\nBy launching _server.js_ with the Node.js REPL, you can see that the workers are\nsharing the HTTP port 8000:\n\n % node server.js\n Worker 2438 online\n Worker 2437 online\n\n\n#### Example: Message passing between clusters and the master process\n\n", "stability": "1 - Experimental", "short_description": "\nA single instance of Node runs in a single thread. To take advantage of\nmulti-core systems the user will sometimes want to launch a cluster of Node\nprocesses to handle the load.\n", "ellipsis_description": "\nA single instance of Node runs in a single thread. To take advantage of\nmulti-core systems the user will sometimes ...", "line": 36, "aliases": [], "children": [ { "id": "cluster.disconnect", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "Called when all workers are disconnected and handlers are closed", "optional": true } ], "description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal handlers will be closed, allowing the master\nprocess to die graceful if no other event is waiting.", "short_description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal handlers will be closed, allowing the master\nprocess to die graceful if no other event is waiting.", "ellipsis_description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal hand...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L233", "name": "disconnect", "path": "cluster.disconnect" }, { "id": "cluster.fork", "type": "class method", "signatures": [ { "args": [ { "name": "env", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "worker" } ] } ], "arguments": [ { "name": "env", "types": [ "Object" ], "description": "Additional key/value pairs to add to child process environment.", "optional": true } ], "description": "Spawns a new worker process. This can only be called from the master process.\n\n `cluster.fork` is actually implemented on top of [[child_process.fork\n`child_process.fork()`]]. The difference between `cluster.fork()` and\n`child_process.fork` is simply that `cluster` allows TCP servers to be shared\nbetween workers. The message passing API that is available on\n`child_process.fork` is available with `cluster` as well.", "short_description": "Spawns a new worker process. This can only be called from the master process.\n", "ellipsis_description": "Spawns a new worker process. This can only be called from the master process.\n ...", "line": 83, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L83", "name": "fork", "path": "cluster.fork" }, { "id": "cluster.isMaster", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NODE_WORKER_ID` is undefined.", "short_description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NODE_WORKER_ID` is undefined.", "ellipsis_description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NOD...", "line": 101, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.isMaster", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L101", "name": "isMaster", "path": "cluster.isMaster" }, { "id": "cluster.isWorker", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NODE_WORKER_ID` is defined.", "short_description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NODE_WORKER_ID` is defined.", "ellipsis_description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NOD...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.isWorker", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L92", "name": "isWorker", "path": "cluster.isWorker" }, { "id": "cluster.settings", "type": "class method", "signatures": [ { "args": [ { "name": "settings", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "settings", "types": [ "Object" ], "description": "Various settings to configure. The properties on this parameter are: `exec`, the [[String `String`]] file path to worker file. The default is `__filename`. `args`, an [[Array `Array`]] of string arguments passed to worker. The default is `process.argv.slice(2)`. `silent`, [[Boolean `Boolean`]] specifying whether or not to send output to parent's stdio. The default is `false`." } ], "description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not supposed to be change or set manually by\nyou.", "short_description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not supposed to be change or set manually by\nyou.", "ellipsis_description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.settings", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L53", "name": "settings", "path": "cluster.settings" }, { "id": "cluster.setupMaster", "type": "class method", "signatures": [ { "args": [ { "name": "settings", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "settings", "types": [ "Object" ], "description": "Various settings to configure. The properties on this parameter are: `exec`, the [[String `String`]] file path to worker file. The default is `__filename`. `args`, an [[Array `Array`]] of string arguments passed to worker. The default is `process.argv.slice(2)`. `silent`, [[Boolean `Boolean`]] specifying whether or not to send output to parent's stdio. The default is `false`.", "optional": true } ], "description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n\n#### Example\n\n var cluster = require(\"cluster\");\n cluster.setupMaster({\n exec : \"worker.js\",\n args : [\"--use\", \"https\"],\n silent : true\n });\n cluster.autoFork();", "short_description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n", "ellipsis_description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n ...", "line": 222, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.setupMaster", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L222", "name": "setupMaster", "path": "cluster.setupMaster" }, { "id": "cluster.workers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it easy to loop through all living workers,\nlike this:\n\n // Go through all workers\n function eachWorker(callback) {\n for (var uniqueID in cluster.workers) {\n callback(cluster.workers[uniqueID]);\n }\n }\n eachWorker(function (worker) {\n worker.send('big announcement to all workers');\n });\n\nShould you wish to reference a worker over a communication channel, using the\nworker's uniqueID is the easiest way to find the worker:\n\n socket.on('data', function (uniqueID) {\n var worker = cluster.workers[uniqueID];\n });", "short_description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it easy to loop through all living workers,\nlike this:\n", "ellipsis_description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it ea...", "line": 259, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.workers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L259", "name": "workers", "path": "cluster.workers" }, { "id": "cluster@death", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "cluster" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "cluster" ], "description": "The dying worker in the cluster" } ], "description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling [[cluster.fork `cluster.fork()`]] again.\n\nDifferent techniques can be used to restart the worker, depending on the\napplication.\n\n#### Example\n\n", "short_description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling [[cluster.fork `cluster.fork()`]] again.\n", "ellipsis_description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling ...", "line": 69, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@death", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L69", "name": "death", "path": "cluster.event.death" }, { "id": "cluster@disconnect", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that disconnected" } ], "description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually after calling [[worker.destroy\n`worker.destroy()`]].\n\nWhen calling `disconnect()`, there may be a delay between the `disconnect` and\n`death` events. This event can be used to detect if the process is stuck in a\ncleanup or if there are long-living connections.\n\n#### Example\n\n cluster.on('disconnect', function(worker) {\n console.log('The worker #' + worker.uniqueID + ' has disconnected');\n });", "short_description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually after calling [[worker.destroy\n`worker.destroy()`]].\n", "ellipsis_description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually afte...", "line": 186, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L186", "name": "disconnect", "path": "cluster.event.disconnect" }, { "id": "cluster@fork", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that was forked" } ], "description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, and create you own timeout.\n\n#### Example\n\n var timeouts = [];\n var errorMsg = function () {\n console.error(\"Something must be wrong with the connection ...\");\n });\n\n cluster.on('fork', function (worker) {\n timeouts[worker.uniqueID] = setTimeout(errorMsg, 2000);\n });\n cluster.on('listening', function (worker) {\n clearTimeout(timeouts[worker.uniqueID]);\n });\n cluster.on('death', function (worker) {\n clearTimeout(timeouts[worker.uniqueID]);\n errorMsg();\n });", "short_description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, and create you own timeout.\n", "ellipsis_description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, an...", "line": 128, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L128", "name": "fork", "path": "cluster.event.fork" }, { "id": "cluster@listening", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] }, { "name": "address", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker to listen for" }, { "name": "address", "types": [ "Object" ], "description": "" } ], "description": "#### Example\n\nThe event handler is executed with two arguments, the `worker` contains the\nworker\nobject and the `address` object contains the following connection properties:\n`address`, `port` and `addressType`. This is very useful if the worker is\nlistening on more than one address.\n\n cluster.on('listening', function (worker, address) {\n console.log(\"A worker is now connected to \" + address.address + \":\" + address.port);\n });", "short_description": "#### Example\n", "ellipsis_description": "#### Example\n ...", "line": 166, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L166", "name": "listening", "path": "cluster.event.listening" }, { "id": "cluster@online", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that becomes online" } ], "description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it emits this event.\n\nThe difference between `'fork'` and `'online'` is that fork is emitted when the\nmaster tries to fork a worker, and `'online'` is emitted when the worker is\nbeing executed.\n\n#### Example\n\n cluster.on('online', function (worker) {\n console.log(\"Yay, the worker responded after it was forked\");\n });", "short_description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it emits this event.\n", "ellipsis_description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online messa...", "line": 147, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@online", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L147", "name": "online", "path": "cluster.event.online" }, { "id": "cluster@setup", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that executed" } ], "description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` was not executed before `fork()`, this function\ncalls `setupMaster()` with no arguments.", "short_description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` was not executed before `fork()`, this function\ncalls `setupMaster()` with no arguments.", "ellipsis_description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` wa...", "line": 196, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@setup", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L196", "name": "setup", "path": "cluster.event.setup" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster", "subclasses": [ "worker" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L36", "name": "cluster", "path": "cluster" }, "cluster.settings": { "id": "cluster.settings", "type": "class method", "signatures": [ { "args": [ { "name": "settings", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "settings", "types": [ "Object" ], "description": "Various settings to configure. The properties on this parameter are: `exec`, the [[String `String`]] file path to worker file. The default is `__filename`. `args`, an [[Array `Array`]] of string arguments passed to worker. The default is `process.argv.slice(2)`. `silent`, [[Boolean `Boolean`]] specifying whether or not to send output to parent's stdio. The default is `false`." } ], "description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not supposed to be change or set manually by\nyou.", "short_description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not supposed to be change or set manually by\nyou.", "ellipsis_description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.settings", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L53", "name": "settings", "path": "cluster.settings" }, "cluster@death": { "id": "cluster@death", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "cluster" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "cluster" ], "description": "The dying worker in the cluster" } ], "description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling [[cluster.fork `cluster.fork()`]] again.\n\nDifferent techniques can be used to restart the worker, depending on the\napplication.\n\n#### Example\n\n", "short_description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling [[cluster.fork `cluster.fork()`]] again.\n", "ellipsis_description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling ...", "line": 69, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@death", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L69", "name": "death", "path": "cluster.event.death" }, "cluster.fork": { "id": "cluster.fork", "type": "class method", "signatures": [ { "args": [ { "name": "env", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "worker" } ] } ], "arguments": [ { "name": "env", "types": [ "Object" ], "description": "Additional key/value pairs to add to child process environment.", "optional": true } ], "description": "Spawns a new worker process. This can only be called from the master process.\n\n `cluster.fork` is actually implemented on top of [[child_process.fork\n`child_process.fork()`]]. The difference between `cluster.fork()` and\n`child_process.fork` is simply that `cluster` allows TCP servers to be shared\nbetween workers. The message passing API that is available on\n`child_process.fork` is available with `cluster` as well.", "short_description": "Spawns a new worker process. This can only be called from the master process.\n", "ellipsis_description": "Spawns a new worker process. This can only be called from the master process.\n ...", "line": 83, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L83", "name": "fork", "path": "cluster.fork" }, "cluster.isWorker": { "id": "cluster.isWorker", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NODE_WORKER_ID` is defined.", "short_description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NODE_WORKER_ID` is defined.", "ellipsis_description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NOD...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.isWorker", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L92", "name": "isWorker", "path": "cluster.isWorker" }, "cluster.isMaster": { "id": "cluster.isMaster", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NODE_WORKER_ID` is undefined.", "short_description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NODE_WORKER_ID` is undefined.", "ellipsis_description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NOD...", "line": 101, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.isMaster", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L101", "name": "isMaster", "path": "cluster.isMaster" }, "cluster@fork": { "id": "cluster@fork", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that was forked" } ], "description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, and create you own timeout.\n\n#### Example\n\n var timeouts = [];\n var errorMsg = function () {\n console.error(\"Something must be wrong with the connection ...\");\n });\n\n cluster.on('fork', function (worker) {\n timeouts[worker.uniqueID] = setTimeout(errorMsg, 2000);\n });\n cluster.on('listening', function (worker) {\n clearTimeout(timeouts[worker.uniqueID]);\n });\n cluster.on('death', function (worker) {\n clearTimeout(timeouts[worker.uniqueID]);\n errorMsg();\n });", "short_description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, and create you own timeout.\n", "ellipsis_description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, an...", "line": 128, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L128", "name": "fork", "path": "cluster.event.fork" }, "cluster@online": { "id": "cluster@online", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that becomes online" } ], "description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it emits this event.\n\nThe difference between `'fork'` and `'online'` is that fork is emitted when the\nmaster tries to fork a worker, and `'online'` is emitted when the worker is\nbeing executed.\n\n#### Example\n\n cluster.on('online', function (worker) {\n console.log(\"Yay, the worker responded after it was forked\");\n });", "short_description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it emits this event.\n", "ellipsis_description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online messa...", "line": 147, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@online", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L147", "name": "online", "path": "cluster.event.online" }, "cluster@listening": { "id": "cluster@listening", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] }, { "name": "address", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker to listen for" }, { "name": "address", "types": [ "Object" ], "description": "" } ], "description": "#### Example\n\nThe event handler is executed with two arguments, the `worker` contains the\nworker\nobject and the `address` object contains the following connection properties:\n`address`, `port` and `addressType`. This is very useful if the worker is\nlistening on more than one address.\n\n cluster.on('listening', function (worker, address) {\n console.log(\"A worker is now connected to \" + address.address + \":\" + address.port);\n });", "short_description": "#### Example\n", "ellipsis_description": "#### Example\n ...", "line": 166, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L166", "name": "listening", "path": "cluster.event.listening" }, "cluster@disconnect": { "id": "cluster@disconnect", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that disconnected" } ], "description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually after calling [[worker.destroy\n`worker.destroy()`]].\n\nWhen calling `disconnect()`, there may be a delay between the `disconnect` and\n`death` events. This event can be used to detect if the process is stuck in a\ncleanup or if there are long-living connections.\n\n#### Example\n\n cluster.on('disconnect', function(worker) {\n console.log('The worker #' + worker.uniqueID + ' has disconnected');\n });", "short_description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually after calling [[worker.destroy\n`worker.destroy()`]].\n", "ellipsis_description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually afte...", "line": 186, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L186", "name": "disconnect", "path": "cluster.event.disconnect" }, "cluster@setup": { "id": "cluster@setup", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that executed" } ], "description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` was not executed before `fork()`, this function\ncalls `setupMaster()` with no arguments.", "short_description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` was not executed before `fork()`, this function\ncalls `setupMaster()` with no arguments.", "ellipsis_description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` wa...", "line": 196, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@setup", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L196", "name": "setup", "path": "cluster.event.setup" }, "cluster.setupMaster": { "id": "cluster.setupMaster", "type": "class method", "signatures": [ { "args": [ { "name": "settings", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "settings", "types": [ "Object" ], "description": "Various settings to configure. The properties on this parameter are: `exec`, the [[String `String`]] file path to worker file. The default is `__filename`. `args`, an [[Array `Array`]] of string arguments passed to worker. The default is `process.argv.slice(2)`. `silent`, [[Boolean `Boolean`]] specifying whether or not to send output to parent's stdio. The default is `false`.", "optional": true } ], "description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n\n#### Example\n\n var cluster = require(\"cluster\");\n cluster.setupMaster({\n exec : \"worker.js\",\n args : [\"--use\", \"https\"],\n silent : true\n });\n cluster.autoFork();", "short_description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n", "ellipsis_description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n ...", "line": 222, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.setupMaster", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L222", "name": "setupMaster", "path": "cluster.setupMaster" }, "cluster.disconnect": { "id": "cluster.disconnect", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "Called when all workers are disconnected and handlers are closed", "optional": true } ], "description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal handlers will be closed, allowing the master\nprocess to die graceful if no other event is waiting.", "short_description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal handlers will be closed, allowing the master\nprocess to die graceful if no other event is waiting.", "ellipsis_description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal hand...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L233", "name": "disconnect", "path": "cluster.disconnect" }, "cluster.workers": { "id": "cluster.workers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it easy to loop through all living workers,\nlike this:\n\n // Go through all workers\n function eachWorker(callback) {\n for (var uniqueID in cluster.workers) {\n callback(cluster.workers[uniqueID]);\n }\n }\n eachWorker(function (worker) {\n worker.send('big announcement to all workers');\n });\n\nShould you wish to reference a worker over a communication channel, using the\nworker's uniqueID is the easiest way to find the worker:\n\n socket.on('data', function (uniqueID) {\n var worker = cluster.workers[uniqueID];\n });", "short_description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it easy to loop through all living workers,\nlike this:\n", "ellipsis_description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it ea...", "line": 259, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.workers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L259", "name": "workers", "path": "cluster.workers" }, "worker": { "id": "worker", "type": "class", "superclass": "cluster", "description": "A `Worker` object contains all public information and methods about a worker. In\nthe master, it can be obtained using `cluster.workers`. In a worker it can be\nobtained using `cluster.worker`.", "short_description": "A `Worker` object contains all public information and methods about a worker. In\nthe master, it can be obtained using `cluster.workers`. In a worker it can be\nobtained using `cluster.worker`.", "ellipsis_description": "A `Worker` object contains all public information and methods about a worker. In\nthe master, it can be obtained usin...", "line": 268, "aliases": [], "children": [ { "id": "worker.destroy", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Void" } ] } ], "description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suicide and accidentally death, a suicide boolean\nis set to `true`.\n\n cluster.on('death', function (worker) {\n if (worker.suicide === true) {\n console.log('Oh, it was just suicide\\' – no need to worry').\n }\n });\n\n // destroy worker\n worker.destroy();", "short_description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suicide and accidentally death, a suicide boolean\nis set to `true`.\n", "ellipsis_description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suic...", "line": 339, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L339", "name": "destroy", "path": "worker.destroy" }, { "id": "worker.disconnect", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Void" } ] } ], "description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other listening worker. Existing connection will be\nallowed to exit as usual. When no more connections exist, the IPC channel to the\nworker will close allowing it to die graceful. When the IPC channel is closed\nthe `disconnect` event will emit, this is then followed by the `death` event,\nthere is emitted when the worker finally die.\n\nBecause there might be long living connections, it is useful to implement a\ntimeout. This example ask the worker to disconnect and after two seconds it will\ndestroy the server. An alternative wound be to execute `worker.destroy()` after\n2 seconds, but that would normally not allow the worker to do any cleanup if\nneeded.\n\n#### Example\n\n if (cluster.isMaster) {\n var worker = cluser.fork();\n var timeout;\n\n worker.on('listening', function () {\n worker.disconnect();\n timeout = setTimeout(function () {\n worker.send('force kill');\n }, 2000);\n });\n\n worker.on('disconnect', function () {\n clearTimeout(timeout);\n });\n\n } else if (cluster.isWorker) {\n var net = require('net');\n var server = net.createServer(function (socket) {\n // connection never end\n });\n\n server.listen(8000);\n\n server.on('close', function () {\n // cleanup\n });\n\n process.on('message', function (msg) {\n if (msg === 'force kill') {\n server.destroy();\n }\n });\n }", "short_description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other listening worker. Existing connection will be\nallowed to exit as usual. When no more connections exist, the IPC channel to the\nworker will close allowing it to die graceful. When the IPC channel is closed\nthe `disconnect` event will emit, this is then followed by the `death` event,\nthere is emitted when the worker finally die.\n", "ellipsis_description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other l...", "line": 393, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L393", "name": "disconnect", "path": "worker.disconnect" }, { "id": "worker.process", "type": "class property", "signatures": [ { "returns": [ { "type": "child_process" } ] } ], "description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that function is stored in\n`process`.\n\nFor more information, see the [[`child_process` module](child_process.html).", "short_description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that function is stored in\n`process`.\n", "ellipsis_description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that fun...", "line": 288, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.process", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L288", "name": "process", "path": "worker.process" }, { "id": "worker.send", "type": "class method", "signatures": [ { "args": [ { "name": "message", "types": [ "Object" ] }, { "name": "sendHandle", "optional": true } ], "returns": [ { "type": "Void" } ] } ], "arguments": [ { "name": "message", "types": [ "Object" ], "description": "A message to send" } ], "description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this function to\nsend a message to a specific worker. However, in a worker you can also use\n`process.send(message)`, since this is the same function.\n\n#### Example: Echoing Back Messages from the Master\n\n if (cluster.isMaster) {\n var worker = cluster.fork();\n worker.send('hi there');\n\n } else if (cluster.isWorker) {\n process.on('message', function (msg) {\n process.send(msg);\n });\n }", "short_description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this function to\nsend a message to a specific worker. However, in a worker you can also use\n`process.send(message)`, since this is the same function.\n", "ellipsis_description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this fu...", "line": 320, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.send", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L320", "name": "send", "path": "worker.send" }, { "id": "worker.suicide", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the `disconnect()` method. Until then,\nit is `undefined`.", "short_description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the `disconnect()` method. Until then,\nit is `undefined`.", "ellipsis_description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.suicide", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L297", "name": "suicide", "path": "worker.suicide" }, { "id": "worker.uniqueID", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n\nWhile a worker is alive, this is the key that indexes it in `cluster.workers`.", "short_description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n", "ellipsis_description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n ...", "line": 277, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.uniqueID", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L277", "name": "uniqueID", "path": "worker.uniqueID" }, { "id": "worker@death", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The dead worker" } ], "description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n\n#### Example\n\n cluster.fork().on('death', function (worker) {\n // Worker has died\n };", "short_description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n", "ellipsis_description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n ...", "line": 500, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@death", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L500", "name": "death", "path": "worker.event.death" }, { "id": "worker@disconnect", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The disconnected worker" } ], "description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n\n cluster.fork().on('disconnect', function (worker) {\n // Worker has disconnected\n };", "short_description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n", "ellipsis_description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n ...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L485", "name": "disconnect", "path": "worker.event.disconnect" }, { "id": "worker@listening", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that's being listened" } ], "description": "#### Example\n\n cluster.fork().on('listening', function (worker, address) {\n // Worker is listening\n };", "short_description": "#### Example\n", "ellipsis_description": "#### Example\n ...", "line": 471, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L471", "name": "listening", "path": "worker.event.listening" }, { "id": "worker@message", "type": "event", "signatures": [ { "args": [ { "name": "message", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "message", "types": [ "Object" ], "description": "The message to send" } ], "description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, however in a worker you can also use\n`process.on('message')`\n\n#### Example\n\nHere is a cluster that keeps count of the number of requests in the master\nprocess using the message system:\n\n var cluster = require('cluster');\n var http = require('http');\n\n if (cluster.isMaster) {\n\n // Keep track of http requests\n var numReqs = 0;\n setInterval(function() {\n console.log(\"numReqs =\", numReqs);\n }, 1000);\n\n // Count requestes\n var messageHandler = function (msg) {\n if (msg.cmd && msg.cmd == 'notifyRequest') {\n numReqs += 1;\n }\n };\n\n // Start workers and listen for messages containing notifyRequest\n cluster.autoFork();\n Object.keys(cluster.workers).forEach(function (uniqueID) {\n cluster.workers[uniqueID].on('message', messageHandler);\n });\n\n } else {\n\n // Worker processes have a http server.\n http.Server(function(req, res) {\n res.writeHead(200);\n res.end(\"hello world\\n\");\n\n // notify master about the request\n process.send({ cmd: 'notifyRequest' });\n }).listen(8000);\n }", "short_description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, however in a worker you can also use\n`process.on('message')`\n", "ellipsis_description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, howev...", "line": 444, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@message", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L444", "name": "message", "path": "worker.event.message" }, { "id": "worker@online", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that came online" } ], "description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n\n#### Example\n\n cluster.fork().on('online', function (worker) {\n // Worker is online\n };", "short_description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n", "ellipsis_description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n ...", "line": 459, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@online", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L459", "name": "online", "path": "worker.event.online" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L268", "name": "worker", "path": "worker" }, "worker.uniqueID": { "id": "worker.uniqueID", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n\nWhile a worker is alive, this is the key that indexes it in `cluster.workers`.", "short_description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n", "ellipsis_description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n ...", "line": 277, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.uniqueID", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L277", "name": "uniqueID", "path": "worker.uniqueID" }, "worker.process": { "id": "worker.process", "type": "class property", "signatures": [ { "returns": [ { "type": "child_process" } ] } ], "description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that function is stored in\n`process`.\n\nFor more information, see the [[`child_process` module](child_process.html).", "short_description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that function is stored in\n`process`.\n", "ellipsis_description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that fun...", "line": 288, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.process", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L288", "name": "process", "path": "worker.process" }, "worker.suicide": { "id": "worker.suicide", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the `disconnect()` method. Until then,\nit is `undefined`.", "short_description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the `disconnect()` method. Until then,\nit is `undefined`.", "ellipsis_description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.suicide", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L297", "name": "suicide", "path": "worker.suicide" }, "worker.send": { "id": "worker.send", "type": "class method", "signatures": [ { "args": [ { "name": "message", "types": [ "Object" ] }, { "name": "sendHandle", "optional": true } ], "returns": [ { "type": "Void" } ] } ], "arguments": [ { "name": "message", "types": [ "Object" ], "description": "A message to send" } ], "description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this function to\nsend a message to a specific worker. However, in a worker you can also use\n`process.send(message)`, since this is the same function.\n\n#### Example: Echoing Back Messages from the Master\n\n if (cluster.isMaster) {\n var worker = cluster.fork();\n worker.send('hi there');\n\n } else if (cluster.isWorker) {\n process.on('message', function (msg) {\n process.send(msg);\n });\n }", "short_description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this function to\nsend a message to a specific worker. However, in a worker you can also use\n`process.send(message)`, since this is the same function.\n", "ellipsis_description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this fu...", "line": 320, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.send", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L320", "name": "send", "path": "worker.send" }, "worker.destroy": { "id": "worker.destroy", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Void" } ] } ], "description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suicide and accidentally death, a suicide boolean\nis set to `true`.\n\n cluster.on('death', function (worker) {\n if (worker.suicide === true) {\n console.log('Oh, it was just suicide\\' – no need to worry').\n }\n });\n\n // destroy worker\n worker.destroy();", "short_description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suicide and accidentally death, a suicide boolean\nis set to `true`.\n", "ellipsis_description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suic...", "line": 339, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L339", "name": "destroy", "path": "worker.destroy" }, "worker.disconnect": { "id": "worker.disconnect", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Void" } ] } ], "description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other listening worker. Existing connection will be\nallowed to exit as usual. When no more connections exist, the IPC channel to the\nworker will close allowing it to die graceful. When the IPC channel is closed\nthe `disconnect` event will emit, this is then followed by the `death` event,\nthere is emitted when the worker finally die.\n\nBecause there might be long living connections, it is useful to implement a\ntimeout. This example ask the worker to disconnect and after two seconds it will\ndestroy the server. An alternative wound be to execute `worker.destroy()` after\n2 seconds, but that would normally not allow the worker to do any cleanup if\nneeded.\n\n#### Example\n\n if (cluster.isMaster) {\n var worker = cluser.fork();\n var timeout;\n\n worker.on('listening', function () {\n worker.disconnect();\n timeout = setTimeout(function () {\n worker.send('force kill');\n }, 2000);\n });\n\n worker.on('disconnect', function () {\n clearTimeout(timeout);\n });\n\n } else if (cluster.isWorker) {\n var net = require('net');\n var server = net.createServer(function (socket) {\n // connection never end\n });\n\n server.listen(8000);\n\n server.on('close', function () {\n // cleanup\n });\n\n process.on('message', function (msg) {\n if (msg === 'force kill') {\n server.destroy();\n }\n });\n }", "short_description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other listening worker. Existing connection will be\nallowed to exit as usual. When no more connections exist, the IPC channel to the\nworker will close allowing it to die graceful. When the IPC channel is closed\nthe `disconnect` event will emit, this is then followed by the `death` event,\nthere is emitted when the worker finally die.\n", "ellipsis_description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other l...", "line": 393, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L393", "name": "disconnect", "path": "worker.disconnect" }, "worker@message": { "id": "worker@message", "type": "event", "signatures": [ { "args": [ { "name": "message", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "message", "types": [ "Object" ], "description": "The message to send" } ], "description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, however in a worker you can also use\n`process.on('message')`\n\n#### Example\n\nHere is a cluster that keeps count of the number of requests in the master\nprocess using the message system:\n\n var cluster = require('cluster');\n var http = require('http');\n\n if (cluster.isMaster) {\n\n // Keep track of http requests\n var numReqs = 0;\n setInterval(function() {\n console.log(\"numReqs =\", numReqs);\n }, 1000);\n\n // Count requestes\n var messageHandler = function (msg) {\n if (msg.cmd && msg.cmd == 'notifyRequest') {\n numReqs += 1;\n }\n };\n\n // Start workers and listen for messages containing notifyRequest\n cluster.autoFork();\n Object.keys(cluster.workers).forEach(function (uniqueID) {\n cluster.workers[uniqueID].on('message', messageHandler);\n });\n\n } else {\n\n // Worker processes have a http server.\n http.Server(function(req, res) {\n res.writeHead(200);\n res.end(\"hello world\\n\");\n\n // notify master about the request\n process.send({ cmd: 'notifyRequest' });\n }).listen(8000);\n }", "short_description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, however in a worker you can also use\n`process.on('message')`\n", "ellipsis_description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, howev...", "line": 444, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@message", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L444", "name": "message", "path": "worker.event.message" }, "worker@online": { "id": "worker@online", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that came online" } ], "description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n\n#### Example\n\n cluster.fork().on('online', function (worker) {\n // Worker is online\n };", "short_description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n", "ellipsis_description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n ...", "line": 459, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@online", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L459", "name": "online", "path": "worker.event.online" }, "worker@listening": { "id": "worker@listening", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that's being listened" } ], "description": "#### Example\n\n cluster.fork().on('listening', function (worker, address) {\n // Worker is listening\n };", "short_description": "#### Example\n", "ellipsis_description": "#### Example\n ...", "line": 471, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L471", "name": "listening", "path": "worker.event.listening" }, "worker@disconnect": { "id": "worker@disconnect", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The disconnected worker" } ], "description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n\n cluster.fork().on('disconnect', function (worker) {\n // Worker has disconnected\n };", "short_description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n", "ellipsis_description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n ...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L485", "name": "disconnect", "path": "worker.event.disconnect" }, "worker@death": { "id": "worker@death", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The dead worker" } ], "description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n\n#### Example\n\n cluster.fork().on('death', function (worker) {\n // Worker has died\n };", "short_description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n", "ellipsis_description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n ...", "line": 500, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@death", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L500", "name": "death", "path": "worker.event.death" }, "crypto": { "id": "crypto", "type": "class", "description": "\nThe `crypto` module offers a way of encapsulating secure credentials to be used\nas part of a secure HTTPS net or HTTP connection. To access this module, add\n`require('crypto')` to your code.\n\n The module also offers a set of wrappers for OpenSSL's methods, which actually\ncontains these objects:\n\n* [[crypto.cipher Cipher]]\n* [[crypto.decipher Decipher]]\n* [[crypto.diffieHellman Diffie-Hellman]]\n* [[crypto.hash Hash]]\n* [[crypto.hmac HMAC]]\n* [[crypto.signer Signer]]\n* [[crypto.verifier Verifier]]\n\nThis documentation is organized to describe those objects within their own\nsections.\n\nNote: All `algorithm` parameter implementations below are dependent on the OpenSSL version installed on the platform. Some common examples of these algoritihms are `'sha1'`, `'md5'`, `'sha256'`, and `'sha512'`. On recent Node.js releases, `openssl list-message-digest-algorithms` displays the available digest algorithms.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThe `crypto` module offers a way of encapsulating secure credentials to be used\nas part of a secure HTTPS net or HTTP connection. To access this module, add\n`require('crypto')` to your code.\n", "ellipsis_description": "\nThe `crypto` module offers a way of encapsulating secure credentials to be used\nas part of a secure HTTPS net or HT...", "line": 31, "aliases": [], "children": [ { "id": "crypto.createCipher", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "password", "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "password", "types": [ "String" ], "description": "The password to use" } ], "description": "Creates and returns a cipher object with the given algorithm and password.\n\nThe `password` is used to derive both the key and IV, which must be a\nbinary-encoded string. For more information, see the section on [[Buffer\nbuffers]].", "short_description": "Creates and returns a cipher object with the given algorithm and password.\n", "ellipsis_description": "Creates and returns a cipher object with the given algorithm and password.\n ...", "line": 44, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCipher", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L44", "name": "createCipher", "path": "crypto.createCipher" }, { "id": "crypto.createCipheriv", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] }, { "name": "iv", "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "A raw key used in the algorithm" }, { "name": "iv", "types": [ "String" ], "description": "The [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector)" } ], "description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n\nBoth `key` and `iv` must be a binary-encoded string. For more information, see\nthe section on [[Buffer buffers]].", "short_description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n", "ellipsis_description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n ...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCipheriv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L59", "name": "createCipheriv", "path": "crypto.createCipheriv" }, { "id": "crypto.createCredentials", "type": "class method", "signatures": [ { "args": [ { "name": "details", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "details", "types": [ "String" ], "description": "A dictionary of fields to populate the credential with", "optional": true } ], "description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n\n- `pfx`: A string or buffer holding the PFX or PKCS12 encoded private key,\ncertificate, and CA certificates\n- `key`: A string holding the PEM encoded private key file\n- `cert`: A string holding the PEM encoded certificate file\n- `passphrase`: A string of passphrases for the private key or pfx\n- `ca`: Either a string or list of strings of PEM encoded CA certificates\nto trust\n- `ciphers`: A string describing the ciphers to use or exclude. Consult\n[OpenSSL.org](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT)\nfor details on the format\n\nIf no `ca` details are given, then Node.js uses the default publicly trusted\nlist of CAs as given by\n[Mozilla](http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/c\nertdata.txt).\n\n#### Example\n\n", "short_description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n", "ellipsis_description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n ...", "line": 88, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCredentials", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L88", "name": "createCredentials", "path": "crypto.createCredentials" }, { "id": "crypto.createDecipher", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "password", "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "password", "types": [ "String" ], "description": "The password to use" } ], "description": "Creates and returns a decipher object, with the given algorithm and key.", "short_description": "Creates and returns a decipher object, with the given algorithm and key.", "ellipsis_description": "Creates and returns a decipher object, with the given algorithm and key. ...", "line": 97, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDecipher", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L97", "name": "createDecipher", "path": "crypto.createDecipher" }, { "id": "crypto.createDecipheriv", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] }, { "name": "iv", "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "A raw key used in the algorithm" }, { "name": "iv", "types": [ "String" ], "description": "The [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector)" } ], "description": "Creates and returns a decipher object, with the given algorithm, key, and iv.", "short_description": "Creates and returns a decipher object, with the given algorithm, key, and iv.", "ellipsis_description": "Creates and returns a decipher object, with the given algorithm, key, and iv. ...", "line": 108, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDecipheriv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L108", "name": "createDecipheriv", "path": "crypto.createDecipheriv" }, { "id": "crypto.createDiffieHellman", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "prime_length", "types": [ "Number" ], "description": "The bit length to calculate with" }, { "name": "prime", "types": [ "Number" ], "description": "The prime to calculate with" }, { "name": "encoding", "types": [ "Number" ], "description": "The encoding to use; defaults to `'binary'`" } ], "description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n\n#### Example\n\n", "short_description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n", "ellipsis_description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n ...", "line": 124, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDiffieHellman", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L124", "name": "createDiffieHellman", "path": "crypto.createDiffieHellman" }, { "id": "crypto.createHash", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hash" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The hash algorithm to use" } ], "description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash digests.\n\n#### Examples\n\nTesting an MD5 Hash:\n\n\n\nThis program takes the sha1 sum of a file:\n\n var filename = \"my_secret_file.txt\";\n var crypto = require('crypto');\n var fs = require('fs');\n\n var shasum = crypto.createHash('sha1');\n\n var s = fs.ReadStream(filename);\n s.on('data', function(d) {\n shasum.update(d);\n });\n\n s.on('end', function() {\n var d = shasum.digest('hex');\n console.log(d + ' ' + filename);\n });", "short_description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash digests.\n", "ellipsis_description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash di...", "line": 204, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createHash", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L204", "name": "createHash", "path": "crypto.createHash" }, { "id": "crypto.createHmac", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hmac" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "The HMAC key to be used" } ], "description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see [this\narticle](http://en.wikipedia.org/wiki/HMAC).\n\n#### Example\n\n", "short_description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see [this\narticle](http://en.wikipedia.org/wiki/HMAC).\n", "ellipsis_description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see ...", "line": 228, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createHmac", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L228", "name": "createHmac", "path": "crypto.createHmac" }, { "id": "crypto.createSign", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] } ], "returns": [ { "type": "crypto.signer" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" } ], "description": "Creates and returns a signing object string, with the given `algorithm`.", "short_description": "Creates and returns a signing object string, with the given `algorithm`.", "ellipsis_description": "Creates and returns a signing object string, with the given `algorithm`. ...", "line": 213, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createSign", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L213", "name": "createSign", "path": "crypto.createSign" }, { "id": "crypto.createVerify", "type": "class method", "signatures": [ { "args": [ { "name": "algorithim", "types": [ "String" ] } ], "returns": [ { "type": "crypto.verifier" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" } ], "description": "Creates and returns a verification object, with the given algorithm.\n\nThis is the mirror of the [[crypto.signer `signer`]] object.", "short_description": "Creates and returns a verification object, with the given algorithm.\n", "ellipsis_description": "Creates and returns a verification object, with the given algorithm.\n ...", "line": 274, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createVerify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L274", "name": "createVerify", "path": "crypto.createVerify" }, { "id": "crypto.getDiffieHellman", "type": "class method", "signatures": [ { "args": [ { "name": "group_name", "types": [ "String" ] } ], "returns": [ { "type": "crypto.diffieHellman" } ] } ], "arguments": [ { "name": "group_name", "types": [ "String" ], "description": "One of the following group names: `'modp1'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp2'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp5'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp14'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp15'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp16'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp17'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp18'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt)" } ], "description": "Creates a predefined Diffie-Hellman key exchange object.\n\nThe returned object mimics the interface of objects created by\n[[crypto.createDiffieHellman `createDiffieHellman()`]], but will not allow you\nto change the keys (for example, with [[crypto.diffieHellman.setPublicKey `diffieHellman.setPublicKey()`]]).\n\nThe advantage of using this routine is that the parties don't have to generate\nnor exchange group modulus beforehand, saving both processor and communication\ntime.\n\n#### Example: Obtaining a shared secret:\n\n var crypto = require('crypto');\n var alice = crypto.getDiffieHellman('modp5');\n var bob = crypto.getDiffieHellman('modp5');\n\n alice.generateKeys();\n bob.generateKeys();\n\n var alice_secret = alice.computeSecret(bob.getPublicKey(), 'binary', 'hex');\n var bob_secret = bob.computeSecret(alice.getPublicKey(), 'binary', 'hex');\n\n /* alice_secret and bob_secret should be the same */\n console.log(alice_secret == bob_secret);", "short_description": "Creates a predefined Diffie-Hellman key exchange object.\n", "ellipsis_description": "Creates a predefined Diffie-Hellman key exchange object.\n ...", "line": 171, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.getDiffieHellman", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L171", "name": "getDiffieHellman", "path": "crypto.getDiffieHellman" }, { "id": "crypto.pbkdf2", "type": "class method", "signatures": [ { "args": [ { "name": "password", "types": [ "String" ] }, { "name": "salt", "types": [ "String" ] }, { "name": "iterations", "types": [ "String" ] }, { "name": "keylen", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "derivedKey", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "derivedKey", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "password", "types": [ "String" ], "description": "The password to use" }, { "name": "salt", "types": [ "String" ], "description": "The salt to use" }, { "name": "iterations", "types": [ "String" ], "description": "The number of iterations to use" }, { "name": "keylen", "types": [ "String" ], "description": "The final key length" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute when finished" }, { "name": "err", "types": [ "Error" ], "description": "The error object" }, { "name": "derivedKey", "types": [ "String" ], "description": "The resulting key" } ], "description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length from the given password, salt, and number of\niterations.\n\n#### Example\n\n", "short_description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length from the given password, salt, and number of\niterations.\n", "ellipsis_description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length fro...", "line": 248, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.pbkdf2", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L248", "name": "pbkdf2", "path": "crypto.pbkdf2" }, { "id": "crypto.randomBytes", "type": "class method", "signatures": [ { "args": [ { "name": "size", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "ex", "type": [ "Error" ] }, { "name": "buf", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "ex", "type": [ "Error" ] }, { "name": "buf", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "String" }, { "type": "Void" } ] } ], "arguments": [ { "name": "size", "types": [ "Number" ], "description": "The size of the cryptographic data" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute when finished", "optional": true }, { "name": "ex", "types": [ "Error" ], "description": "The error object" }, { "name": "buf", "types": [ "String" ], "description": "The resulting crypto data" } ], "description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n\n#### Example\n\n", "short_description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n", "ellipsis_description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n ...", "line": 264, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.randomBytes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L264", "name": "randomBytes", "path": "crypto.randomBytes" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto", "subclasses": [ "crypto.cipher", "crypto.decipher", "crypto.diffieHellman", "crypto.hash", "crypto.hmac", "crypto.signer", "crypto.verifier" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L31", "name": "crypto", "path": "crypto" }, "crypto.createCipher": { "id": "crypto.createCipher", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "password", "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "password", "types": [ "String" ], "description": "The password to use" } ], "description": "Creates and returns a cipher object with the given algorithm and password.\n\nThe `password` is used to derive both the key and IV, which must be a\nbinary-encoded string. For more information, see the section on [[Buffer\nbuffers]].", "short_description": "Creates and returns a cipher object with the given algorithm and password.\n", "ellipsis_description": "Creates and returns a cipher object with the given algorithm and password.\n ...", "line": 44, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCipher", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L44", "name": "createCipher", "path": "crypto.createCipher" }, "crypto.createCipheriv": { "id": "crypto.createCipheriv", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] }, { "name": "iv", "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "A raw key used in the algorithm" }, { "name": "iv", "types": [ "String" ], "description": "The [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector)" } ], "description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n\nBoth `key` and `iv` must be a binary-encoded string. For more information, see\nthe section on [[Buffer buffers]].", "short_description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n", "ellipsis_description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n ...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCipheriv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L59", "name": "createCipheriv", "path": "crypto.createCipheriv" }, "crypto.createCredentials": { "id": "crypto.createCredentials", "type": "class method", "signatures": [ { "args": [ { "name": "details", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "details", "types": [ "String" ], "description": "A dictionary of fields to populate the credential with", "optional": true } ], "description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n\n- `pfx`: A string or buffer holding the PFX or PKCS12 encoded private key,\ncertificate, and CA certificates\n- `key`: A string holding the PEM encoded private key file\n- `cert`: A string holding the PEM encoded certificate file\n- `passphrase`: A string of passphrases for the private key or pfx\n- `ca`: Either a string or list of strings of PEM encoded CA certificates\nto trust\n- `ciphers`: A string describing the ciphers to use or exclude. Consult\n[OpenSSL.org](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT)\nfor details on the format\n\nIf no `ca` details are given, then Node.js uses the default publicly trusted\nlist of CAs as given by\n[Mozilla](http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/c\nertdata.txt).\n\n#### Example\n\n", "short_description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n", "ellipsis_description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n ...", "line": 88, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCredentials", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L88", "name": "createCredentials", "path": "crypto.createCredentials" }, "crypto.createDecipher": { "id": "crypto.createDecipher", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "password", "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "password", "types": [ "String" ], "description": "The password to use" } ], "description": "Creates and returns a decipher object, with the given algorithm and key.", "short_description": "Creates and returns a decipher object, with the given algorithm and key.", "ellipsis_description": "Creates and returns a decipher object, with the given algorithm and key. ...", "line": 97, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDecipher", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L97", "name": "createDecipher", "path": "crypto.createDecipher" }, "crypto.createDecipheriv": { "id": "crypto.createDecipheriv", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] }, { "name": "iv", "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "A raw key used in the algorithm" }, { "name": "iv", "types": [ "String" ], "description": "The [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector)" } ], "description": "Creates and returns a decipher object, with the given algorithm, key, and iv.", "short_description": "Creates and returns a decipher object, with the given algorithm, key, and iv.", "ellipsis_description": "Creates and returns a decipher object, with the given algorithm, key, and iv. ...", "line": 108, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDecipheriv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L108", "name": "createDecipheriv", "path": "crypto.createDecipheriv" }, "crypto.createDiffieHellman": { "id": "crypto.createDiffieHellman", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "prime_length", "types": [ "Number" ], "description": "The bit length to calculate with" }, { "name": "prime", "types": [ "Number" ], "description": "The prime to calculate with" }, { "name": "encoding", "types": [ "Number" ], "description": "The encoding to use; defaults to `'binary'`" } ], "description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n\n#### Example\n\n", "short_description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n", "ellipsis_description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n ...", "line": 124, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDiffieHellman", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L124", "name": "createDiffieHellman", "path": "crypto.createDiffieHellman" }, "crypto.getDiffieHellman": { "id": "crypto.getDiffieHellman", "type": "class method", "signatures": [ { "args": [ { "name": "group_name", "types": [ "String" ] } ], "returns": [ { "type": "crypto.diffieHellman" } ] } ], "arguments": [ { "name": "group_name", "types": [ "String" ], "description": "One of the following group names: `'modp1'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp2'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp5'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp14'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp15'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp16'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp17'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp18'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt)" } ], "description": "Creates a predefined Diffie-Hellman key exchange object.\n\nThe returned object mimics the interface of objects created by\n[[crypto.createDiffieHellman `createDiffieHellman()`]], but will not allow you\nto change the keys (for example, with [[crypto.diffieHellman.setPublicKey `diffieHellman.setPublicKey()`]]).\n\nThe advantage of using this routine is that the parties don't have to generate\nnor exchange group modulus beforehand, saving both processor and communication\ntime.\n\n#### Example: Obtaining a shared secret:\n\n var crypto = require('crypto');\n var alice = crypto.getDiffieHellman('modp5');\n var bob = crypto.getDiffieHellman('modp5');\n\n alice.generateKeys();\n bob.generateKeys();\n\n var alice_secret = alice.computeSecret(bob.getPublicKey(), 'binary', 'hex');\n var bob_secret = bob.computeSecret(alice.getPublicKey(), 'binary', 'hex');\n\n /* alice_secret and bob_secret should be the same */\n console.log(alice_secret == bob_secret);", "short_description": "Creates a predefined Diffie-Hellman key exchange object.\n", "ellipsis_description": "Creates a predefined Diffie-Hellman key exchange object.\n ...", "line": 171, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.getDiffieHellman", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L171", "name": "getDiffieHellman", "path": "crypto.getDiffieHellman" }, "crypto.createHash": { "id": "crypto.createHash", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hash" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The hash algorithm to use" } ], "description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash digests.\n\n#### Examples\n\nTesting an MD5 Hash:\n\n\n\nThis program takes the sha1 sum of a file:\n\n var filename = \"my_secret_file.txt\";\n var crypto = require('crypto');\n var fs = require('fs');\n\n var shasum = crypto.createHash('sha1');\n\n var s = fs.ReadStream(filename);\n s.on('data', function(d) {\n shasum.update(d);\n });\n\n s.on('end', function() {\n var d = shasum.digest('hex');\n console.log(d + ' ' + filename);\n });", "short_description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash digests.\n", "ellipsis_description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash di...", "line": 204, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createHash", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L204", "name": "createHash", "path": "crypto.createHash" }, "crypto.createSign": { "id": "crypto.createSign", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] } ], "returns": [ { "type": "crypto.signer" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" } ], "description": "Creates and returns a signing object string, with the given `algorithm`.", "short_description": "Creates and returns a signing object string, with the given `algorithm`.", "ellipsis_description": "Creates and returns a signing object string, with the given `algorithm`. ...", "line": 213, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createSign", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L213", "name": "createSign", "path": "crypto.createSign" }, "crypto.createHmac": { "id": "crypto.createHmac", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hmac" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "The HMAC key to be used" } ], "description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see [this\narticle](http://en.wikipedia.org/wiki/HMAC).\n\n#### Example\n\n", "short_description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see [this\narticle](http://en.wikipedia.org/wiki/HMAC).\n", "ellipsis_description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see ...", "line": 228, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createHmac", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L228", "name": "createHmac", "path": "crypto.createHmac" }, "crypto.pbkdf2": { "id": "crypto.pbkdf2", "type": "class method", "signatures": [ { "args": [ { "name": "password", "types": [ "String" ] }, { "name": "salt", "types": [ "String" ] }, { "name": "iterations", "types": [ "String" ] }, { "name": "keylen", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "derivedKey", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "derivedKey", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "password", "types": [ "String" ], "description": "The password to use" }, { "name": "salt", "types": [ "String" ], "description": "The salt to use" }, { "name": "iterations", "types": [ "String" ], "description": "The number of iterations to use" }, { "name": "keylen", "types": [ "String" ], "description": "The final key length" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute when finished" }, { "name": "err", "types": [ "Error" ], "description": "The error object" }, { "name": "derivedKey", "types": [ "String" ], "description": "The resulting key" } ], "description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length from the given password, salt, and number of\niterations.\n\n#### Example\n\n", "short_description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length from the given password, salt, and number of\niterations.\n", "ellipsis_description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length fro...", "line": 248, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.pbkdf2", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L248", "name": "pbkdf2", "path": "crypto.pbkdf2" }, "crypto.randomBytes": { "id": "crypto.randomBytes", "type": "class method", "signatures": [ { "args": [ { "name": "size", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "ex", "type": [ "Error" ] }, { "name": "buf", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "ex", "type": [ "Error" ] }, { "name": "buf", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "String" }, { "type": "Void" } ] } ], "arguments": [ { "name": "size", "types": [ "Number" ], "description": "The size of the cryptographic data" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute when finished", "optional": true }, { "name": "ex", "types": [ "Error" ], "description": "The error object" }, { "name": "buf", "types": [ "String" ], "description": "The resulting crypto data" } ], "description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n\n#### Example\n\n", "short_description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n", "ellipsis_description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n ...", "line": 264, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.randomBytes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L264", "name": "randomBytes", "path": "crypto.randomBytes" }, "crypto.createVerify": { "id": "crypto.createVerify", "type": "class method", "signatures": [ { "args": [ { "name": "algorithim", "types": [ "String" ] } ], "returns": [ { "type": "crypto.verifier" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" } ], "description": "Creates and returns a verification object, with the given algorithm.\n\nThis is the mirror of the [[crypto.signer `signer`]] object.", "short_description": "Creates and returns a verification object, with the given algorithm.\n", "ellipsis_description": "Creates and returns a verification object, with the given algorithm.\n ...", "line": 274, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createVerify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L274", "name": "createVerify", "path": "crypto.createVerify" }, "crypto.cipher": { "id": "crypto.cipher", "type": "class", "superclass": "crypto", "description": "A class for encrypting data. It's a representation of the [OpenSSL\nimplementation of cipher](http://www.openssl.org/docs/apps/ciphers.html). It can\nbe created as a returned value from [[crypto.createCipher\n`crypto.createCipher()`]] or [[crypto.createCipheriv\n`crypto.createCipheriv()`]].\n\n#### Example\n\n", "short_description": "A class for encrypting data. It's a representation of the [OpenSSL\nimplementation of cipher](http://www.openssl.org/docs/apps/ciphers.html). It can\nbe created as a returned value from [[crypto.createCipher\n`crypto.createCipher()`]] or [[crypto.createCipheriv\n`crypto.createCipheriv()`]].\n", "ellipsis_description": "A class for encrypting data. It's a representation of the [OpenSSL\nimplementation of cipher](http://www.openssl.org/...", "line": 289, "aliases": [], "children": [ { "id": "crypto.cipher.final", "type": "class method", "signatures": [ { "args": [ { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "output_encoding", "types": [ "String" ], "description": "The encoding to use for the output; defaults to binary", "optional": true } ], "description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n\nNote: The `cipher` object can't be used after the `final()` method has been called.", "short_description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n", "ellipsis_description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n ...", "line": 301, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.final", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L301", "name": "final", "path": "crypto.cipher.final" }, { "id": "crypto.cipher.setAutoPadding", "type": "class method", "signatures": [ { "args": [ { "name": "auto_padding", "default_value": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "auto_padding", "types": [ "Boolean" ], "description": "Specifies wheter automatic padding is on, or not" } ], "description": "You can disable automatic padding of the input data to block size.\n\nIf `auto_padding` is false, the length of the entire input data must be a\nmultiple of the cipher's block size or `final` will fail.\n\nThis is useful for non-standard padding, _e.g._ using `0x0` instead of PKCS\npadding. You must call this before `cipher.final`.", "short_description": "You can disable automatic padding of the input data to block size.\n", "ellipsis_description": "You can disable automatic padding of the input data to block size.\n ...", "line": 330, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.setAutoPadding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L330", "name": "setAutoPadding", "path": "crypto.cipher.setAutoPadding" }, { "id": "crypto.cipher.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "Defines how the input is encoded; can be `'utf8'`, `'ascii'` or `'binary'`", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "Defines how the output is encoded; can be `'binary'`, `'base64'` or `'hex'` (chainable)", "optional": true } ], "description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as it is streamed.", "short_description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as it is streamed.", "ellipsis_description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as ...", "line": 316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L316", "name": "update", "path": "crypto.cipher.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L289", "name": "cipher", "path": "crypto.cipher" }, "crypto.cipher.final": { "id": "crypto.cipher.final", "type": "class method", "signatures": [ { "args": [ { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "output_encoding", "types": [ "String" ], "description": "The encoding to use for the output; defaults to binary", "optional": true } ], "description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n\nNote: The `cipher` object can't be used after the `final()` method has been called.", "short_description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n", "ellipsis_description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n ...", "line": 301, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.final", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L301", "name": "final", "path": "crypto.cipher.final" }, "crypto.cipher.update": { "id": "crypto.cipher.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "Defines how the input is encoded; can be `'utf8'`, `'ascii'` or `'binary'`", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "Defines how the output is encoded; can be `'binary'`, `'base64'` or `'hex'` (chainable)", "optional": true } ], "description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as it is streamed.", "short_description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as it is streamed.", "ellipsis_description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as ...", "line": 316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L316", "name": "update", "path": "crypto.cipher.update" }, "crypto.cipher.setAutoPadding": { "id": "crypto.cipher.setAutoPadding", "type": "class method", "signatures": [ { "args": [ { "name": "auto_padding", "default_value": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "auto_padding", "types": [ "Boolean" ], "description": "Specifies wheter automatic padding is on, or not" } ], "description": "You can disable automatic padding of the input data to block size.\n\nIf `auto_padding` is false, the length of the entire input data must be a\nmultiple of the cipher's block size or `final` will fail.\n\nThis is useful for non-standard padding, _e.g._ using `0x0` instead of PKCS\npadding. You must call this before `cipher.final`.", "short_description": "You can disable automatic padding of the input data to block size.\n", "ellipsis_description": "You can disable automatic padding of the input data to block size.\n ...", "line": 330, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.setAutoPadding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L330", "name": "setAutoPadding", "path": "crypto.cipher.setAutoPadding" }, "crypto.decipher": { "id": "crypto.decipher", "type": "class", "superclass": "crypto", "description": "A class for decrypting data. It's used to decipher previously created\n[[crypto.cipher `cipher`]] objects. It can be created as a returned value from\n[[crypto.createDecipher `crypto.createDeipher()`]] or [[crypto.createDecipheriv\n`crypto.createDecipheriv()`]].\n\n#### Example\n\n", "short_description": "A class for decrypting data. It's used to decipher previously created\n[[crypto.cipher `cipher`]] objects. It can be created as a returned value from\n[[crypto.createDecipher `crypto.createDeipher()`]] or [[crypto.createDecipheriv\n`crypto.createDecipheriv()`]].\n", "ellipsis_description": "A class for decrypting data. It's used to decipher previously created\n[[crypto.cipher `cipher`]] objects. It can be ...", "line": 344, "aliases": [], "children": [ { "id": "crypto.decipher.final", "type": "class method", "signatures": [ { "args": [ { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "output_encoding", "types": [ "String" ], "description": "The encoding to use for the output; can be either `'binary'`, `'ascii'`, or `'utf8'`", "optional": true } ], "description": "Returns any remaining plaintext which is deciphered.\n\nNote: The `decipher` object can't be used after the `final()` method been called.", "short_description": "Returns any remaining plaintext which is deciphered.\n", "ellipsis_description": "Returns any remaining plaintext which is deciphered.\n ...", "line": 370, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.final", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L370", "name": "final", "path": "crypto.decipher.final" }, { "id": "crypto.decipher.setAutoPadding", "type": "class method", "signatures": [ { "args": [ { "name": "auto_padding", "default_value": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "auto_padding", "types": [ "Boolean" ], "description": "Specifies wheter automatic padding is on, or not" } ], "description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.final` from checking and removing it. Can only work if the input\ndata's length is a multiple of the\nciphers block size. You must call this before streaming data to\n`decipher.update`.", "short_description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.final` from checking and removing it. Can only work if the input\ndata's length is a multiple of the\nciphers block size. You must call this before streaming data to\n`decipher.update`.", "ellipsis_description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.fina...", "line": 383, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.setAutoPadding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L383", "name": "setAutoPadding", "path": "crypto.decipher.setAutoPadding" }, { "id": "crypto.decipher.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "Defines how the input is encoded", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "Defines how the output is encoded (chainable)", "optional": true } ], "description": "Updates the decipher with `data`.\n\nThe `input_encoding` can be `'binary'`, `'base64'` or `'hex'`.\nThe `output_encoding` can be `'binary'`, `'ascii'` or `'utf8'`.", "short_description": "Updates the decipher with `data`.\n", "ellipsis_description": "Updates the decipher with `data`.\n ...", "line": 359, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L359", "name": "update", "path": "crypto.decipher.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L344", "name": "decipher", "path": "crypto.decipher" }, "crypto.decipher.update": { "id": "crypto.decipher.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "Defines how the input is encoded", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "Defines how the output is encoded (chainable)", "optional": true } ], "description": "Updates the decipher with `data`.\n\nThe `input_encoding` can be `'binary'`, `'base64'` or `'hex'`.\nThe `output_encoding` can be `'binary'`, `'ascii'` or `'utf8'`.", "short_description": "Updates the decipher with `data`.\n", "ellipsis_description": "Updates the decipher with `data`.\n ...", "line": 359, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L359", "name": "update", "path": "crypto.decipher.update" }, "crypto.decipher.final": { "id": "crypto.decipher.final", "type": "class method", "signatures": [ { "args": [ { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "output_encoding", "types": [ "String" ], "description": "The encoding to use for the output; can be either `'binary'`, `'ascii'`, or `'utf8'`", "optional": true } ], "description": "Returns any remaining plaintext which is deciphered.\n\nNote: The `decipher` object can't be used after the `final()` method been called.", "short_description": "Returns any remaining plaintext which is deciphered.\n", "ellipsis_description": "Returns any remaining plaintext which is deciphered.\n ...", "line": 370, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.final", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L370", "name": "final", "path": "crypto.decipher.final" }, "crypto.decipher.setAutoPadding": { "id": "crypto.decipher.setAutoPadding", "type": "class method", "signatures": [ { "args": [ { "name": "auto_padding", "default_value": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "auto_padding", "types": [ "Boolean" ], "description": "Specifies wheter automatic padding is on, or not" } ], "description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.final` from checking and removing it. Can only work if the input\ndata's length is a multiple of the\nciphers block size. You must call this before streaming data to\n`decipher.update`.", "short_description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.final` from checking and removing it. Can only work if the input\ndata's length is a multiple of the\nciphers block size. You must call this before streaming data to\n`decipher.update`.", "ellipsis_description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.fina...", "line": 383, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.setAutoPadding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L383", "name": "setAutoPadding", "path": "crypto.decipher.setAutoPadding" }, "crypto.diffieHellman": { "id": "crypto.diffieHellman", "type": "class", "superclass": "crypto", "description": "This is a class for creating Diffie-Hellman key exchanges. It's a representation\nof the [OpenSSL implementation of\ndiffie-Hellman](http://www.openssl.org/docs/crypto/dh.html#). It can be created\nas a returned value from [[crypto.createDiffieHellman\n`crypto.createDiffieHellman()`]].\n\n#### Example\n\n", "short_description": "This is a class for creating Diffie-Hellman key exchanges. It's a representation\nof the [OpenSSL implementation of\ndiffie-Hellman](http://www.openssl.org/docs/crypto/dh.html#). It can be created\nas a returned value from [[crypto.createDiffieHellman\n`crypto.createDiffieHellman()`]].\n", "ellipsis_description": "This is a class for creating Diffie-Hellman key exchanges. It's a representation\nof the [OpenSSL implementation of\nd...", "line": 398, "aliases": [], "children": [ { "id": "crypto.diffieHellman.computeSecret", "type": "class method", "signatures": [ { "args": [ { "name": "other_public_key", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "input_encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "other_public_key", "types": [ "String" ], "description": "The other party's public key" }, { "name": "input_encoding", "types": [ "String" ], "description": "The encoding used to interprate the public key; can be `'binary'`, `'base64'`, or `'hex'`.", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "The encoding of the returned computation; defaults to the `input_encoding`", "optional": true } ], "description": "Computes the shared secret and returns the computed shared secret.", "short_description": "Computes the shared secret and returns the computed shared secret.", "ellipsis_description": "Computes the shared secret and returns the computed shared secret. ...", "line": 411, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.computeSecret", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L411", "name": "computeSecret", "path": "crypto.diffieHellman.computeSecret" }, { "id": "crypto.diffieHellman.generateKeys", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This key should be transferred to the other\nparty.", "short_description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This key should be transferred to the other\nparty.", "ellipsis_description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This k...", "line": 466, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.generateKeys", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L466", "name": "generateKeys", "path": "crypto.diffieHellman.generateKeys" }, { "id": "crypto.diffieHellman.getGenerator", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman prime in the specified encoding.\n\n#### Example\n\n", "short_description": "Returns the Diffie-Hellman prime in the specified encoding.\n", "ellipsis_description": "Returns the Diffie-Hellman prime in the specified encoding.\n ...", "line": 424, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getGenerator", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L424", "name": "getGenerator", "path": "crypto.diffieHellman.getGenerator" }, { "id": "crypto.diffieHellman.getPrime", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman prime in the specified encoding.\n\n#### Example\n\n", "short_description": "Returns the Diffie-Hellman prime in the specified encoding.\n", "ellipsis_description": "Returns the Diffie-Hellman prime in the specified encoding.\n ...", "line": 437, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPrime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L437", "name": "getPrime", "path": "crypto.diffieHellman.getPrime" }, { "id": "crypto.diffieHellman.getPrivateKey", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman private key in the specified encoding.", "short_description": "Returns the Diffie-Hellman private key in the specified encoding.", "ellipsis_description": "Returns the Diffie-Hellman private key in the specified encoding. ...", "line": 446, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPrivateKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L446", "name": "getPrivateKey", "path": "crypto.diffieHellman.getPrivateKey" }, { "id": "crypto.diffieHellman.getPublicKey", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman public key in the specified encoding.", "short_description": "Returns the Diffie-Hellman public key in the specified encoding.", "ellipsis_description": "Returns the Diffie-Hellman public key in the specified encoding. ...", "line": 455, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPublicKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L455", "name": "getPublicKey", "path": "crypto.diffieHellman.getPublicKey" }, { "id": "crypto.diffieHellman.setPrivateKey", "type": "class method", "signatures": [ { "args": [ { "name": "public_key", "types": [ "String" ] }, { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "public_key", "types": [ "String" ], "description": "The public key that's shared" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Sets the Diffie-Hellman private key.", "short_description": "Sets the Diffie-Hellman private key.", "ellipsis_description": "Sets the Diffie-Hellman private key. ...", "line": 476, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.setPrivateKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L476", "name": "setPrivateKey", "path": "crypto.diffieHellman.setPrivateKey" }, { "id": "crypto.diffieHellman.setPublicKey", "type": "class method", "signatures": [ { "args": [ { "name": "public_key", "types": [ "String" ] }, { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "public_key", "types": [ "String" ], "description": "The public key that's shared" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Sets the Diffie-Hellman public key.", "short_description": "Sets the Diffie-Hellman public key.", "ellipsis_description": "Sets the Diffie-Hellman public key. ...", "line": 486, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.setPublicKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L486", "name": "setPublicKey", "path": "crypto.diffieHellman.setPublicKey" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L398", "name": "diffieHellman", "path": "crypto.diffieHellman" }, "crypto.diffieHellman.computeSecret": { "id": "crypto.diffieHellman.computeSecret", "type": "class method", "signatures": [ { "args": [ { "name": "other_public_key", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "input_encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "other_public_key", "types": [ "String" ], "description": "The other party's public key" }, { "name": "input_encoding", "types": [ "String" ], "description": "The encoding used to interprate the public key; can be `'binary'`, `'base64'`, or `'hex'`.", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "The encoding of the returned computation; defaults to the `input_encoding`", "optional": true } ], "description": "Computes the shared secret and returns the computed shared secret.", "short_description": "Computes the shared secret and returns the computed shared secret.", "ellipsis_description": "Computes the shared secret and returns the computed shared secret. ...", "line": 411, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.computeSecret", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L411", "name": "computeSecret", "path": "crypto.diffieHellman.computeSecret" }, "crypto.diffieHellman.getGenerator": { "id": "crypto.diffieHellman.getGenerator", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman prime in the specified encoding.\n\n#### Example\n\n", "short_description": "Returns the Diffie-Hellman prime in the specified encoding.\n", "ellipsis_description": "Returns the Diffie-Hellman prime in the specified encoding.\n ...", "line": 424, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getGenerator", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L424", "name": "getGenerator", "path": "crypto.diffieHellman.getGenerator" }, "crypto.diffieHellman.getPrime": { "id": "crypto.diffieHellman.getPrime", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman prime in the specified encoding.\n\n#### Example\n\n", "short_description": "Returns the Diffie-Hellman prime in the specified encoding.\n", "ellipsis_description": "Returns the Diffie-Hellman prime in the specified encoding.\n ...", "line": 437, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPrime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L437", "name": "getPrime", "path": "crypto.diffieHellman.getPrime" }, "crypto.diffieHellman.getPrivateKey": { "id": "crypto.diffieHellman.getPrivateKey", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman private key in the specified encoding.", "short_description": "Returns the Diffie-Hellman private key in the specified encoding.", "ellipsis_description": "Returns the Diffie-Hellman private key in the specified encoding. ...", "line": 446, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPrivateKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L446", "name": "getPrivateKey", "path": "crypto.diffieHellman.getPrivateKey" }, "crypto.diffieHellman.getPublicKey": { "id": "crypto.diffieHellman.getPublicKey", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman public key in the specified encoding.", "short_description": "Returns the Diffie-Hellman public key in the specified encoding.", "ellipsis_description": "Returns the Diffie-Hellman public key in the specified encoding. ...", "line": 455, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPublicKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L455", "name": "getPublicKey", "path": "crypto.diffieHellman.getPublicKey" }, "crypto.diffieHellman.generateKeys": { "id": "crypto.diffieHellman.generateKeys", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This key should be transferred to the other\nparty.", "short_description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This key should be transferred to the other\nparty.", "ellipsis_description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This k...", "line": 466, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.generateKeys", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L466", "name": "generateKeys", "path": "crypto.diffieHellman.generateKeys" }, "crypto.diffieHellman.setPrivateKey": { "id": "crypto.diffieHellman.setPrivateKey", "type": "class method", "signatures": [ { "args": [ { "name": "public_key", "types": [ "String" ] }, { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "public_key", "types": [ "String" ], "description": "The public key that's shared" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Sets the Diffie-Hellman private key.", "short_description": "Sets the Diffie-Hellman private key.", "ellipsis_description": "Sets the Diffie-Hellman private key. ...", "line": 476, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.setPrivateKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L476", "name": "setPrivateKey", "path": "crypto.diffieHellman.setPrivateKey" }, "crypto.diffieHellman.setPublicKey": { "id": "crypto.diffieHellman.setPublicKey", "type": "class method", "signatures": [ { "args": [ { "name": "public_key", "types": [ "String" ] }, { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "public_key", "types": [ "String" ], "description": "The public key that's shared" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Sets the Diffie-Hellman public key.", "short_description": "Sets the Diffie-Hellman public key.", "ellipsis_description": "Sets the Diffie-Hellman public key. ...", "line": 486, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.setPublicKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L486", "name": "setPublicKey", "path": "crypto.diffieHellman.setPublicKey" }, "crypto.hash": { "id": "crypto.hash", "type": "class", "superclass": "crypto", "description": "The class for creating hash digests of data. It's class a representation of the\n[OpenSSL implementation of\nhash](http://www.openssl.org/docs/crypto/crypto.html#item_AUTHENTICATION)\nalgorithms. It can be created as a returned value from [[crypto.createHash\n`crypto.createHash()`]].\n\n#### Example\n\n", "short_description": "The class for creating hash digests of data. It's class a representation of the\n[OpenSSL implementation of\nhash](http://www.openssl.org/docs/crypto/crypto.html#item_AUTHENTICATION)\nalgorithms. It can be created as a returned value from [[crypto.createHash\n`crypto.createHash()`]].\n", "ellipsis_description": "The class for creating hash digests of data. It's class a representation of the\n[OpenSSL implementation of\nhash](htt...", "line": 501, "aliases": [], "children": [ { "id": "crypto.hash.digest", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Calculates the digest of all of the passed data to be hashed.\n\nNote: The `hash` object can't be used after the `digest()` method been called.", "short_description": "Calculates the digest of all of the passed data to be hashed.\n", "ellipsis_description": "Calculates the digest of all of the passed data to be hashed.\n ...", "line": 512, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash.digest", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L512", "name": "digest", "path": "crypto.hash.digest" }, { "id": "crypto.hash.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'` (chainable)", "optional": true } ], "description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed.", "short_description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed.", "ellipsis_description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed. ...", "line": 524, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L524", "name": "update", "path": "crypto.hash.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L501", "name": "hash", "path": "crypto.hash" }, "crypto.hash.digest": { "id": "crypto.hash.digest", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Calculates the digest of all of the passed data to be hashed.\n\nNote: The `hash` object can't be used after the `digest()` method been called.", "short_description": "Calculates the digest of all of the passed data to be hashed.\n", "ellipsis_description": "Calculates the digest of all of the passed data to be hashed.\n ...", "line": 512, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash.digest", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L512", "name": "digest", "path": "crypto.hash.digest" }, "crypto.hash.update": { "id": "crypto.hash.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'` (chainable)", "optional": true } ], "description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed.", "short_description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed.", "ellipsis_description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed. ...", "line": 524, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L524", "name": "update", "path": "crypto.hash.update" }, "crypto.hmac": { "id": "crypto.hmac", "type": "class", "superclass": "crypto", "description": "A class for creating cryptographic hmac content. It's a representation of the\n[OpenSSL implementation of hmac](http://www.openssl.org/docs/crypto/hmac.html#)\nalgorithms. It can be created as a returned value from [[crypto.createHmac\n`crypto.createHmac()`]].\n\n#### Example\n\n", "short_description": "A class for creating cryptographic hmac content. It's a representation of the\n[OpenSSL implementation of hmac](http://www.openssl.org/docs/crypto/hmac.html#)\nalgorithms. It can be created as a returned value from [[crypto.createHmac\n`crypto.createHmac()`]].\n", "ellipsis_description": "A class for creating cryptographic hmac content. It's a representation of the\n[OpenSSL implementation of hmac](http:...", "line": 538, "aliases": [], "children": [ { "id": "crypto.hmac.digest", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'hex'`, `'binary'` or `'base64'`", "optional": true } ], "description": "Calculates the digest of all of the passed data to the hmac.\n\nNote: The `hmac` object can't be used after the `digest()` method been called.", "short_description": "Calculates the digest of all of the passed data to the hmac.\n", "ellipsis_description": "Calculates the digest of all of the passed data to the hmac.\n ...", "line": 549, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac.digest", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L549", "name": "digest", "path": "crypto.hmac.digest" }, { "id": "crypto.hmac.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hmac" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed.", "short_description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed.", "ellipsis_description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed. ...", "line": 559, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L559", "name": "update", "path": "crypto.hmac.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L538", "name": "hmac", "path": "crypto.hmac" }, "crypto.hmac.digest": { "id": "crypto.hmac.digest", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'hex'`, `'binary'` or `'base64'`", "optional": true } ], "description": "Calculates the digest of all of the passed data to the hmac.\n\nNote: The `hmac` object can't be used after the `digest()` method been called.", "short_description": "Calculates the digest of all of the passed data to the hmac.\n", "ellipsis_description": "Calculates the digest of all of the passed data to the hmac.\n ...", "line": 549, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac.digest", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L549", "name": "digest", "path": "crypto.hmac.digest" }, "crypto.hmac.update": { "id": "crypto.hmac.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hmac" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed.", "short_description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed.", "ellipsis_description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed. ...", "line": 559, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L559", "name": "update", "path": "crypto.hmac.update" }, "crypto.signer": { "id": "crypto.signer", "type": "class", "superclass": "crypto", "description": "This class is used to generate certificates for OpenSSL. It can be created as a\nreturned value from [[crypto.createSign `crypto.createSign()`]].\n\n#### Example\n\n\n var s1 = crypto.createSign('RSA-SHA1')\n .update('Test123')\n .sign(keyPem, 'base64');\n var verified = crypto.createVerify('RSA-SHA1')\n .update('Test')\n .update('123')\n .verify(certPem, s1, 'base64');\n assert.strictEqual(verified, true, 'sign and verify (base 64)');", "short_description": "This class is used to generate certificates for OpenSSL. It can be created as a\nreturned value from [[crypto.createSign `crypto.createSign()`]].\n", "ellipsis_description": "This class is used to generate certificates for OpenSSL. It can be created as a\nreturned value from [[crypto.createS...", "line": 579, "aliases": [], "children": [ { "id": "crypto.signer.sign", "type": "class method", "signatures": [ { "args": [ { "name": "private_key", "types": [ "String" ] }, { "name": "output_format", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "private_key", "types": [ "String" ], "description": "A string containing the PEM encoded private key for signing" }, { "name": "output_format", "types": [ "String" ], "description": "The output encoding format; can be `'binary'`, `'hex'` or `'base64'`", "optional": true } ], "description": "Calculates the signature on all the updated data passed through the signer.\n\nNote: The `signer` object can not be used after the `sign()` method has been called.\n\n#### Returns\n\n The signature in a format defined by `output_format`.", "short_description": "Calculates the signature on all the updated data passed through the signer.\n", "ellipsis_description": "Calculates the signature on all the updated data passed through the signer.\n ...", "line": 596, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer.sign", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L596", "name": "sign", "path": "crypto.signer.sign" }, { "id": "crypto.signer.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.signer" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed.", "short_description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed.", "ellipsis_description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed. ...", "line": 606, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L606", "name": "update", "path": "crypto.signer.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L579", "name": "signer", "path": "crypto.signer" }, "crypto.signer.sign": { "id": "crypto.signer.sign", "type": "class method", "signatures": [ { "args": [ { "name": "private_key", "types": [ "String" ] }, { "name": "output_format", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "private_key", "types": [ "String" ], "description": "A string containing the PEM encoded private key for signing" }, { "name": "output_format", "types": [ "String" ], "description": "The output encoding format; can be `'binary'`, `'hex'` or `'base64'`", "optional": true } ], "description": "Calculates the signature on all the updated data passed through the signer.\n\nNote: The `signer` object can not be used after the `sign()` method has been called.\n\n#### Returns\n\n The signature in a format defined by `output_format`.", "short_description": "Calculates the signature on all the updated data passed through the signer.\n", "ellipsis_description": "Calculates the signature on all the updated data passed through the signer.\n ...", "line": 596, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer.sign", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L596", "name": "sign", "path": "crypto.signer.sign" }, "crypto.signer.update": { "id": "crypto.signer.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.signer" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed.", "short_description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed.", "ellipsis_description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed. ...", "line": 606, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L606", "name": "update", "path": "crypto.signer.update" }, "crypto.verifier": { "id": "crypto.verifier", "type": "class", "superclass": "crypto", "description": "This class is used to verify signed certificates for OpenSSL. It can be created\nas a returned value from [[crypto.createVerify `crypto.createVerify()`]].\n\n#### Example\n\n\n var s1 = crypto.createSign('RSA-SHA1')\n .update('Test123')\n .sign(keyPem, 'base64');\n var verified = crypto.createVerify('RSA-SHA1')\n .update('Test')\n .update('123')\n .verify(certPem, s1, 'base64');\n assert.strictEqual(verified, true, 'sign and verify (base 64)');", "short_description": "This class is used to verify signed certificates for OpenSSL. It can be created\nas a returned value from [[crypto.createVerify `crypto.createVerify()`]].\n", "ellipsis_description": "This class is used to verify signed certificates for OpenSSL. It can be created\nas a returned value from [[crypto.cr...", "line": 626, "aliases": [], "children": [ { "id": "crypto.verifier.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.verifier" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed.", "short_description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed.", "ellipsis_description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed. ...", "line": 651, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L651", "name": "update", "path": "crypto.verifier.update" }, { "id": "crypto.verifier.verify", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "String" ] }, { "name": "signature", "types": [ "String" ] }, { "name": "signature_format", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "String" ], "description": "A string containing a PEM encoded object, which can be one of the following: an RSA public key, a DSA public key or an X.509 certificate" }, { "name": "signature", "types": [ "String" ], "description": "The previously calculated signature for the data" }, { "name": "signature_format", "types": [ "String" ], "description": "The format of the signature; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n\nNote: The `verifier` object can't be used after the `verify()` method has been called.", "short_description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n", "ellipsis_description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n ...", "line": 641, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier.verify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L641", "name": "verify", "path": "crypto.verifier.verify" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L626", "name": "verifier", "path": "crypto.verifier" }, "crypto.verifier.verify": { "id": "crypto.verifier.verify", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "String" ] }, { "name": "signature", "types": [ "String" ] }, { "name": "signature_format", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "String" ], "description": "A string containing a PEM encoded object, which can be one of the following: an RSA public key, a DSA public key or an X.509 certificate" }, { "name": "signature", "types": [ "String" ], "description": "The previously calculated signature for the data" }, { "name": "signature_format", "types": [ "String" ], "description": "The format of the signature; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n\nNote: The `verifier` object can't be used after the `verify()` method has been called.", "short_description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n", "ellipsis_description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n ...", "line": 641, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier.verify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L641", "name": "verify", "path": "crypto.verifier.verify" }, "crypto.verifier.update": { "id": "crypto.verifier.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.verifier" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed.", "short_description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed.", "ellipsis_description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed. ...", "line": 651, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L651", "name": "update", "path": "crypto.verifier.update" }, "Debugger": { "id": "Debugger", "type": "class", "description": "\nV8 comes with an extensive debugger which is accessible out-of-process via a\nsimple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).\n\nNode.js has a built-in client for this debugger. To use this, start Node.js with\nthe `debug` argument; a prompt appears, ready to take your command:\n\n % node debug myscript.js\n < debugger listening on port 5858\n connecting... ok\n break in /home/indutny/Code/git/indutny/myscript.js:1\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n debug>\n\nNode's debugger client doesn't support the full range of commands, but simple\nstep and inspection is possible. By putting the statement `debugger;` into the\nsource code of your script, you will enable a breakpoint.\n\nFor example, suppose `myscript.js` looked like this:\n\n // myscript.js\n x = 5;\n setTimeout(function () {\n debugger;\n console.log(\"world\");\n }, 1000);\n console.log(\"hello\");\n\nThen once the debugger is run, it will break on line 4.\n\n % node debug myscript.js\n < debugger listening on port 5858\n connecting... ok\n break in /home/indutny/Code/git/indutny/myscript.js:1\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n debug> cont\n < hello\n break in /home/indutny/Code/git/indutny/myscript.js:3\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n 4 console.log(\"world\");\n 5 }, 1000);\n debug> next\n break in /home/indutny/Code/git/indutny/myscript.js:4\n 2 setTimeout(function () {\n 3 debugger;\n 4 console.log(\"world\");\n 5 }, 1000);\n 6 console.log(\"hello\");\n debug> repl\n Press Ctrl + C to leave debug repl\n > x\n 5\n > 2+2\n 4\n debug> next\n < world\n break in /home/indutny/Code/git/indutny/myscript.js:5\n 3 debugger;\n 4 console.log(\"world\");\n 5 }, 1000);\n 6 console.log(\"hello\");\n 7\n debug> quit\n %\n\n\nThe `repl` command allows you to evaluate code remotely. The `next` command\nsteps over to the next line. There are a few other commands available and more\nto come. Type `help` to see others.\n\nThere are some online JavaScript IDEs, like [Cloud9](http://www.c9.io),\nwhich provide the Node.js standard debugging mechanisms, as well as more.\n\n## Watchers\n\nYou can watch expressions and variable values while debugging your code.\n\nOn every breakpoint each expression from the watchers list will be evaluated in\nthe current context and displayed just before the breakpoint's source code\nlisting.\n\nTo start watching an expression, type `watch(\"my_expression\")`. `watchers`\nprints the active watchers. To remove a watcher, type\n`unwatch(\"my_expression\")`.\n\n## Commands Reference\n\n### Stepping\n\n* `cont`, `c`: Continue\n* `next`, `n`: Step next\n* `step`, `s`: Step in\n* `out`, `o`: Step out\n\n### Breakpoints\n\n* `setBreakpoint()`, `sb()`: Sets a breakpoint on the current line\n* `setBreakpoint('fn()')`, `sb(...)`: Sets a breakpoint on the first statement\nin the function's body\n* `setBreakpoint('script.js', 1)`, `sb(...)`: Sets a breakpoint on the first\nline of `script.js`\n* `clearBreakpoint`, `cb(...)`: Clears a breakpoint\n\n### Info\n\n* `backtrace`, `bt`: Prints a backtrace of the current execution frame\n* `list(c)`: Lists the script's source code with a five line context (five lines\nbefore and after)\n* `watch(expr)`: Adds an expression to the watch list\n* `unwatch(expr)`: Removes am expression from the watch list\n* `watchers`: Lists all the watchers and their values (automatically listed on\neach breakpoint)\n* `repl`: Open the debugger's REPL for evaluation in debugging a script's\ncontext\n\n### Execution control\n\n* `run`: Run a script (automatically runs on debugger's start)\n* `restart`: Restart a script\n* `kill`: Kill a script\n\n### Various\n\n* `scripts`: List all the loaded scripts\n* `version`: Display the V8 version\n\n## Advanced Usage\n\nThe V8 debugger can be enabled and accessed either by starting Node.js with the\n`--debug` command-line flag or by signaling an existing Node.js process with\n`SIGUSR1`.", "stability": "3 - Stable", "short_description": "\nV8 comes with an extensive debugger which is accessible out-of-process via a\nsimple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).\n", "ellipsis_description": "\nV8 comes with an extensive debugger which is accessible out-of-process via a\nsimple [TCP protocol](http://code.goog...", "line": 145, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/debugger.markdown", "fileName": "debugger", "resultingFile": "debugger.html#Debugger", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/debugger.markdown#L145", "name": "Debugger", "path": "Debugger" }, "dgram": { "id": "dgram", "type": "class", "description": "\nA datagram socket is a type of connectionless Internet socket, for the sending\nor receiving point for packet delivery services. Datagram sockets are available\nin Node.js by adding `require('dgram')` to your code.\n\n#### Some Notes About UDP Datagram Size\n\nThe maximum size of an `IPv4/v6` datagram depends on the `MTU` (_Maximum\nTransmission Unit_) and on the `Payload Length` field size.\n\nThe `Payload Length` field is `16 bits` wide, which means that a normal payload\ncan't be larger than 64K octets, including internet header and data: (65,507\nbytes = 65,535 − 8 bytes UDP header − 20 bytes IP header). This is generally\ntrue for loopback interfaces, but such long datagrams are impractical for most\nhosts and networks.\n\nThe `MTU` is the largest size a given link layer technology can support for\ndatagrams. For any link, IPv4 mandates a minimum `MTU` of `68` octets, while the\nrecommended `MTU` for IPv4 is `576` (typically recommended as the `MTU` for\ndial-up type applications), whether they arrive whole or in fragments.\n\nFor `IPv6`, the minimum `MTU` is `1280` octets; however, the mandatory minimum\nfragment reassembly buffer size is `1500` octets. The value of `68` octets is\nvery small, since most current link layer technologies have a minimum `MTU` of\n`1500` (like Ethernet).\n\nNote: It's impossible to know in advance the MTU of each link through which a packet might travel, and that generally sending a datagram greater than the (receiver) `MTU` won't work (the packet gets silently dropped, without informing the source that the data did not reach its intended recipient).\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nA datagram socket is a type of connectionless Internet socket, for the sending\nor receiving point for packet delivery services. Datagram sockets are available\nin Node.js by adding `require('dgram')` to your code.\n", "ellipsis_description": "\nA datagram socket is a type of connectionless Internet socket, for the sending\nor receiving point for packet delive...", "line": 38, "aliases": [], "children": [ { "id": "dgram.addMembership", "type": "class method", "signatures": [ { "args": [ { "name": "multicastAddress", "types": [ "String" ] }, { "name": "multicastInterface", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "multicastAddress", "types": [ "String" ], "description": "The address to add" }, { "name": "multicastInterface", "types": [ "String" ], "description": "The interface to use", "optional": true } ], "description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n\nIf `multicastInterface` is not specified, the OS will try to add membership to\nall valid interfaces.\n\n#### Example\n\n", "short_description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n", "ellipsis_description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n ...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.addMembership", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L178", "name": "addMembership", "path": "dgram.addMembership" }, { "id": "dgram.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the properties `address` and `port`.", "short_description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the properties `address` and `port`.", "ellipsis_description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the proper...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L113", "name": "address", "path": "dgram.address" }, { "id": "dgram.bind", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "address", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to bind to" }, { "name": "address", "types": [ "String" ], "description": "The address to attach to", "optional": true } ], "description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS tries to listen on all addresses.\n\n#### Example: A UDP server listening on port 41234:\n\n", "short_description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS tries to listen on all addresses.\n", "ellipsis_description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS...", "line": 98, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.bind", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L98", "name": "bind", "path": "dgram.bind" }, { "id": "dgram.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Close the underlying socket and stop listening for data on it.", "short_description": "Close the underlying socket and stop listening for data on it.", "ellipsis_description": "Close the underlying socket and stop listening for data on it. ...", "line": 105, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L105", "name": "close", "path": "dgram.close" }, { "id": "dgram.createSocket", "type": "class method", "signatures": [ { "args": [ { "name": "type", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "dgram" } ] } ], "arguments": [ { "name": "type", "types": [ "String" ], "description": "The type of socket to create; valid types are `udp4` and `udp6`" }, { "name": "callback", "types": [ "Function" ], "description": "A callback that's added as a listener for `message` events", "optional": true } ], "description": "Creates a datagram socket of the specified types.\n\nIf you want to receive datagrams, call `socket.bind()`. `socket.bind()` binds to\nthe \"all interfaces\" address on a random port (it does the right thing for both\n`udp4` and `udp6` sockets). You can then retrieve the address and port with\n`socket.address().address` and `socket.address().port`.", "short_description": "Creates a datagram socket of the specified types.\n", "ellipsis_description": "Creates a datagram socket of the specified types.\n ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.createSocket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L54", "name": "createSocket", "path": "dgram.createSocket" }, { "id": "dgram.dropMembership", "type": "class method", "signatures": [ { "args": [ { "name": "multicastAddress", "types": [ "String" ] }, { "name": "multicastInterface", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "multicastAddress", "types": [ "String" ], "description": "The address to drop" }, { "name": "multicastInterface", "types": [ "String" ], "description": "The interface to use", "optional": true } ], "description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket option. This is automatically called by the\nkernel when the socket is closed or process terminates, so most apps will never\nneed to call this.\n\nIf `multicastInterface` is not specified, the OS will try to drop membership to\nall valid interfaces.", "short_description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket option. This is automatically called by the\nkernel when the socket is closed or process terminates, so most apps will never\nneed to call this.\n", "ellipsis_description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket op...", "line": 193, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.dropMembership", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L193", "name": "dropMembership", "path": "dgram.dropMembership" }, { "id": "dgram.send", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "port", "types": [ "Number" ] }, { "name": "address", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The data buffer to send" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use (its number of bytes)" }, { "name": "port", "types": [ "Number" ], "description": "The port to send to" }, { "name": "address", "types": [ "String" ], "description": "The address to send to" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method completes that may be used to detect any DNS errors and when `buf` may be reused", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The standard `Error` object" } ], "description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be specified.\n\nA string may be supplied for the `address` parameter, and it will be resolved\nwith DNS. Note that DNS lookups delay the time that a send takes place, at least\nuntil the next tick. The only way to know for sure that a send has taken place\nis to use the callback.\n\nIf the socket has not been previously bound with a call to [[dgram.bind\n`dgram.bind()`]], it's assigned a random port number and bound to the \"all\ninterfaces\" address (0.0.0.0 for `udp4` sockets, ::0 for `udp6` sockets).\n\n#### Example: Sending a UDP packet to a random port on `localhost`;\n\n", "short_description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be specified.\n", "ellipsis_description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be s...", "line": 84, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.send", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L84", "name": "send", "path": "dgram.send" }, { "id": "dgram.setBroadcast", "type": "class method", "signatures": [ { "args": [ { "name": "flag", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "flag", "types": [ "Boolean" ], "description": "The value of `SO_BROADCAST`" } ], "description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a local interface's broadcast address.", "short_description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a local interface's broadcast address.", "ellipsis_description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a lo...", "line": 122, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setBroadcast", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L122", "name": "setBroadcast", "path": "dgram.setBroadcast" }, { "id": "dgram.setMulticastLoopback", "type": "class method", "signatures": [ { "args": [ { "name": "flag", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "flag", "types": [ "Boolean" ], "description": "The value of `IP_MULTICAST_LOOP`" } ], "description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be received on the local interface.", "short_description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be received on the local interface.", "ellipsis_description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be re...", "line": 161, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setMulticastLoopback", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L161", "name": "setMulticastLoopback", "path": "dgram.setMulticastLoopback" }, { "id": "dgram.setMulticastTTL", "type": "class method", "signatures": [ { "args": [ { "name": "ttl", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "ttl", "types": [ "Number" ], "description": "The value of `IP_MULTICAST_TTL`" } ], "description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the number of IP hops that a packet is allowed to\ngo through, specifically for multicast traffic. Each router or gateway that\nforwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded.\n\nThe argument to `setMulticastTTL()` is a number of hops between 0 and 255. The\ndefault on most systems is 64.", "short_description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the number of IP hops that a packet is allowed to\ngo through, specifically for multicast traffic. Each router or gateway that\nforwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded.\n", "ellipsis_description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the numb...", "line": 152, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setMulticastTTL", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L152", "name": "setMulticastTTL", "path": "dgram.setMulticastTTL" }, { "id": "dgram.setTTL", "type": "class method", "signatures": [ { "args": [ { "name": "ttl", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "ttl", "types": [ "Number" ], "description": "The value of `IP_TTL`" } ], "description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP hops that a packet is allowed to go\nthrough. Each router or gateway that forwards a packet decrements the TTL. If\nthe TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL\nvalues is typically done for network probes or when multicasting.\n\nThe argument to `setTTL()` is a number of hops between 1 and 255. The default\non most systems is 64.", "short_description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP hops that a packet is allowed to go\nthrough. Each router or gateway that forwards a packet decrements the TTL. If\nthe TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL\nvalues is typically done for network probes or when multicasting.\n", "ellipsis_description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP ho...", "line": 137, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setTTL", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L137", "name": "setTTL", "path": "dgram.setTTL" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram", "subclasses": [ "socket" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L38", "name": "dgram", "path": "dgram" }, "dgram.createSocket": { "id": "dgram.createSocket", "type": "class method", "signatures": [ { "args": [ { "name": "type", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "dgram" } ] } ], "arguments": [ { "name": "type", "types": [ "String" ], "description": "The type of socket to create; valid types are `udp4` and `udp6`" }, { "name": "callback", "types": [ "Function" ], "description": "A callback that's added as a listener for `message` events", "optional": true } ], "description": "Creates a datagram socket of the specified types.\n\nIf you want to receive datagrams, call `socket.bind()`. `socket.bind()` binds to\nthe \"all interfaces\" address on a random port (it does the right thing for both\n`udp4` and `udp6` sockets). You can then retrieve the address and port with\n`socket.address().address` and `socket.address().port`.", "short_description": "Creates a datagram socket of the specified types.\n", "ellipsis_description": "Creates a datagram socket of the specified types.\n ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.createSocket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L54", "name": "createSocket", "path": "dgram.createSocket" }, "dgram.send": { "id": "dgram.send", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "port", "types": [ "Number" ] }, { "name": "address", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The data buffer to send" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use (its number of bytes)" }, { "name": "port", "types": [ "Number" ], "description": "The port to send to" }, { "name": "address", "types": [ "String" ], "description": "The address to send to" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method completes that may be used to detect any DNS errors and when `buf` may be reused", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The standard `Error` object" } ], "description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be specified.\n\nA string may be supplied for the `address` parameter, and it will be resolved\nwith DNS. Note that DNS lookups delay the time that a send takes place, at least\nuntil the next tick. The only way to know for sure that a send has taken place\nis to use the callback.\n\nIf the socket has not been previously bound with a call to [[dgram.bind\n`dgram.bind()`]], it's assigned a random port number and bound to the \"all\ninterfaces\" address (0.0.0.0 for `udp4` sockets, ::0 for `udp6` sockets).\n\n#### Example: Sending a UDP packet to a random port on `localhost`;\n\n", "short_description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be specified.\n", "ellipsis_description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be s...", "line": 84, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.send", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L84", "name": "send", "path": "dgram.send" }, "dgram.bind": { "id": "dgram.bind", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "address", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to bind to" }, { "name": "address", "types": [ "String" ], "description": "The address to attach to", "optional": true } ], "description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS tries to listen on all addresses.\n\n#### Example: A UDP server listening on port 41234:\n\n", "short_description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS tries to listen on all addresses.\n", "ellipsis_description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS...", "line": 98, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.bind", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L98", "name": "bind", "path": "dgram.bind" }, "dgram.close": { "id": "dgram.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Close the underlying socket and stop listening for data on it.", "short_description": "Close the underlying socket and stop listening for data on it.", "ellipsis_description": "Close the underlying socket and stop listening for data on it. ...", "line": 105, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L105", "name": "close", "path": "dgram.close" }, "dgram.address": { "id": "dgram.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the properties `address` and `port`.", "short_description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the properties `address` and `port`.", "ellipsis_description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the proper...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L113", "name": "address", "path": "dgram.address" }, "dgram.setBroadcast": { "id": "dgram.setBroadcast", "type": "class method", "signatures": [ { "args": [ { "name": "flag", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "flag", "types": [ "Boolean" ], "description": "The value of `SO_BROADCAST`" } ], "description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a local interface's broadcast address.", "short_description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a local interface's broadcast address.", "ellipsis_description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a lo...", "line": 122, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setBroadcast", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L122", "name": "setBroadcast", "path": "dgram.setBroadcast" }, "dgram.setTTL": { "id": "dgram.setTTL", "type": "class method", "signatures": [ { "args": [ { "name": "ttl", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "ttl", "types": [ "Number" ], "description": "The value of `IP_TTL`" } ], "description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP hops that a packet is allowed to go\nthrough. Each router or gateway that forwards a packet decrements the TTL. If\nthe TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL\nvalues is typically done for network probes or when multicasting.\n\nThe argument to `setTTL()` is a number of hops between 1 and 255. The default\non most systems is 64.", "short_description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP hops that a packet is allowed to go\nthrough. Each router or gateway that forwards a packet decrements the TTL. If\nthe TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL\nvalues is typically done for network probes or when multicasting.\n", "ellipsis_description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP ho...", "line": 137, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setTTL", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L137", "name": "setTTL", "path": "dgram.setTTL" }, "dgram.setMulticastTTL": { "id": "dgram.setMulticastTTL", "type": "class method", "signatures": [ { "args": [ { "name": "ttl", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "ttl", "types": [ "Number" ], "description": "The value of `IP_MULTICAST_TTL`" } ], "description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the number of IP hops that a packet is allowed to\ngo through, specifically for multicast traffic. Each router or gateway that\nforwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded.\n\nThe argument to `setMulticastTTL()` is a number of hops between 0 and 255. The\ndefault on most systems is 64.", "short_description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the number of IP hops that a packet is allowed to\ngo through, specifically for multicast traffic. Each router or gateway that\nforwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded.\n", "ellipsis_description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the numb...", "line": 152, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setMulticastTTL", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L152", "name": "setMulticastTTL", "path": "dgram.setMulticastTTL" }, "dgram.setMulticastLoopback": { "id": "dgram.setMulticastLoopback", "type": "class method", "signatures": [ { "args": [ { "name": "flag", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "flag", "types": [ "Boolean" ], "description": "The value of `IP_MULTICAST_LOOP`" } ], "description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be received on the local interface.", "short_description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be received on the local interface.", "ellipsis_description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be re...", "line": 161, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setMulticastLoopback", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L161", "name": "setMulticastLoopback", "path": "dgram.setMulticastLoopback" }, "dgram.addMembership": { "id": "dgram.addMembership", "type": "class method", "signatures": [ { "args": [ { "name": "multicastAddress", "types": [ "String" ] }, { "name": "multicastInterface", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "multicastAddress", "types": [ "String" ], "description": "The address to add" }, { "name": "multicastInterface", "types": [ "String" ], "description": "The interface to use", "optional": true } ], "description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n\nIf `multicastInterface` is not specified, the OS will try to add membership to\nall valid interfaces.\n\n#### Example\n\n", "short_description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n", "ellipsis_description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n ...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.addMembership", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L178", "name": "addMembership", "path": "dgram.addMembership" }, "dgram.dropMembership": { "id": "dgram.dropMembership", "type": "class method", "signatures": [ { "args": [ { "name": "multicastAddress", "types": [ "String" ] }, { "name": "multicastInterface", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "multicastAddress", "types": [ "String" ], "description": "The address to drop" }, { "name": "multicastInterface", "types": [ "String" ], "description": "The interface to use", "optional": true } ], "description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket option. This is automatically called by the\nkernel when the socket is closed or process terminates, so most apps will never\nneed to call this.\n\nIf `multicastInterface` is not specified, the OS will try to drop membership to\nall valid interfaces.", "short_description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket option. This is automatically called by the\nkernel when the socket is closed or process terminates, so most apps will never\nneed to call this.\n", "ellipsis_description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket op...", "line": 193, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.dropMembership", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L193", "name": "dropMembership", "path": "dgram.dropMembership" }, "socket": { "id": "socket", "type": "class", "superclass": "dgram", "description": "The dgram Socket class encapsulates the datagram functionality. It should be\ncreated via `dgram.createSocket(type, [callback])`.", "short_description": "The dgram Socket class encapsulates the datagram functionality. It should be\ncreated via `dgram.createSocket(type, [callback])`.", "ellipsis_description": "The dgram Socket class encapsulates the datagram functionality. It should be\ncreated via `dgram.createSocket(type, ...", "line": 201, "aliases": [], "children": [ { "id": "socket@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this socket.", "short_description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this socket.", "ellipsis_description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this s...", "line": 227, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L227", "name": "close", "path": "socket.event.close" }, { "id": "socket@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The error that was encountered" } ], "description": "Emitted when an error occurs.", "short_description": "Emitted when an error occurs.", "ellipsis_description": "Emitted when an error occurs. ...", "line": 235, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L235", "name": "error", "path": "socket.event.error" }, { "id": "socket@listening", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created.", "short_description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created.", "ellipsis_description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created. ...", "line": 219, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L219", "name": "listening", "path": "socket.event.listening" }, { "id": "socket@message", "type": "event", "signatures": [ { "args": [ { "name": "msg", "types": [ "Buffer" ] }, { "name": "rinfo", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "msg", "types": [ "Buffer" ], "description": "A `Buffer` of information" }, { "name": "rinfo", "types": [ "Object" ], "description": "An object with the sender's address information and the number of bytes in the datagram." } ], "description": "Emitted when a new datagram is available on a socket.", "short_description": "Emitted when a new datagram is available on a socket.", "ellipsis_description": "Emitted when a new datagram is available on a socket. ...", "line": 211, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@message", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L211", "name": "message", "path": "socket.event.message" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L201", "name": "socket", "path": "socket" }, "socket@message": { "id": "socket@message", "type": "event", "signatures": [ { "args": [ { "name": "msg", "types": [ "Buffer" ] }, { "name": "rinfo", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "msg", "types": [ "Buffer" ], "description": "A `Buffer` of information" }, { "name": "rinfo", "types": [ "Object" ], "description": "An object with the sender's address information and the number of bytes in the datagram." } ], "description": "Emitted when a new datagram is available on a socket.", "short_description": "Emitted when a new datagram is available on a socket.", "ellipsis_description": "Emitted when a new datagram is available on a socket. ...", "line": 211, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@message", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L211", "name": "message", "path": "socket.event.message" }, "socket@listening": { "id": "socket@listening", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created.", "short_description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created.", "ellipsis_description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created. ...", "line": 219, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L219", "name": "listening", "path": "socket.event.listening" }, "socket@close": { "id": "socket@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this socket.", "short_description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this socket.", "ellipsis_description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this s...", "line": 227, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L227", "name": "close", "path": "socket.event.close" }, "socket@error": { "id": "socket@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The error that was encountered" } ], "description": "Emitted when an error occurs.", "short_description": "Emitted when an error occurs.", "ellipsis_description": "Emitted when an error occurs. ...", "line": 235, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L235", "name": "error", "path": "socket.event.error" }, "dns": { "id": "dns", "type": "class", "description": "\nDNS is the backbone of all operations on the Internet. To access this module,\ninclude `require('dns')` in your code.\n\nWhenever a Node.js developer does something like `net.connect(80, 'google.com')`\nor `http.get({ host: 'google.com' })`, the [[dns.lookup `dns.lookup()`]] method\nis used. All methods in the dns module use C-Ares—except for `dns.lookup()`\nwhich uses\n[`getaddrinfo(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/getaddr\ninfo.3.html) in a thread pool. C-Ares is much faster than `getaddrinfo`, but the\nsystem resolver is more constant with how other programs operate. Users who need\nto do a large number of look ups quickly should use the methods that go through\nC-Ares.\n\n#### Example: Resolving `'www.google.com'`, and then reverse resolving the IP\naddresses that are returned:\n\n", "stability": "3 - Stable", "short_description": "\nDNS is the backbone of all operations on the Internet. To access this module,\ninclude `require('dns')` in your code.\n", "ellipsis_description": "\nDNS is the backbone of all operations on the Internet. To access this module,\ninclude `require('dns')` in your code.\n ...", "line": 25, "aliases": [], "children": [ { "id": "dns.lookup", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "family", "default_value": "null", "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "address", "type": [ "String" ] }, { "name": "family", "type": [ "Number" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "address", "type": [ "String" ] }, { "name": "family", "type": [ "Number" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "family", "types": [ "Number" ], "description": "Indicates whether to use IPv4 (`4`) or IPv6 (`6`)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The error object" }, { "name": "address", "types": [ "String" ], "description": "A string representation of an IPv4 or IPv6 address" }, { "name": "family", "types": [ "Number" ], "description": "Either the integer `4` or `6`, and donates the address family--not necessarily the value initially passed to `lookup`", "optional": true } ], "description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n\n#### Example\n\n", "short_description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n", "ellipsis_description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n ...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.lookup", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L43", "name": "lookup", "path": "dns.lookup" }, { "id": "dns.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "rrtype", "default_value": "A", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "rrtype", "types": [ "String" ], "description": "The record type to use", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "String" ], "description": "Determined by the record type and described in each corresponding lookup method" } ], "description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n\n* `A` (IPV4 addresses)\n* `AAAA` (IPV6 addresses)\n* `MX` (mail exchange records)\n* `TXT` (text records)\n* `SRV` (SRV records)\n* `PTR` (used for reverse IP lookups)\n* `NS` (name server records)\n* `CNAME` (canonical name records)\n\n#### Example\n\n", "short_description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n", "ellipsis_description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n ...", "line": 70, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L70", "name": "resolve", "path": "dns.resolve" }, { "id": "dns.resolve4", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of IPv4 addresses (_e.g._ `['74.125.79.104', '74.125.79.105', '74.125.79.106']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords). ...", "line": 84, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve4", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L84", "name": "resolve4", "path": "dns.resolve4" }, { "id": "dns.resolve6", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of IPv6 addresses" } ], "description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery).", "short_description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery).", "ellipsis_description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery). ...", "line": 97, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve6", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L97", "name": "resolve6", "path": "dns.resolve6" }, { "id": "dns.resolveCname", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the canonical name records available for `domain` (e.g. `['bar.example.com']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n\nEach DNS query can return one of the following error codes:\n\n- `dns.TEMPFAIL`: timeout, SERVFAIL or similar.\n- `dns.PROTOCOL`: got garbled reply.\n- `dns.NXDOMAIN`: domain does not exists.\n- `dns.NODATA`: domain exists but no data of reqd type.\n- `dns.NOMEM`: out of memory while processing.\n- `dns.BADQUERY`: the query is malformed.", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n ...", "line": 188, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveCname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L188", "name": "resolveCname", "path": "dns.resolveCname" }, { "id": "dns.resolveMx", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of MX records, each with a priority and an exchange attribute (_e.g._ `[{'priority' : 10, 'exchange' : 'mx.example.com'},{...}]`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records). ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveMx", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L112", "name": "resolveMx", "path": "dns.resolveMx" }, { "id": "dns.resolveNs", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the name server records available for `domain`, _e.g_ `['ns1.example.com', 'ns2.example.com']`" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records). ...", "line": 166, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveNs", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L166", "name": "resolveNs", "path": "dns.resolveNs" }, { "id": "dns.resolveSrv", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the SRV records available for `domain`. Properties of SRV records are priority, weight, port, and name (_e.g._ `[{'priority' : 10, 'weight' : 5, 'port' : 21223, 'name' : 'service.example.com'}, {...}]`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords). ...", "line": 141, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveSrv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L141", "name": "resolveSrv", "path": "dns.resolveSrv" }, { "id": "dns.resolveTxt", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of text records available for `domain` (_e.g._ `['v=spf1 ip4 0.0.0.0 ~all']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords). ...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveTxt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L126", "name": "resolveTxt", "path": "dns.resolveTxt" }, { "id": "dns.reverse", "type": "class method", "signatures": [ { "args": [ { "name": "ip", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "ip", "types": [ "String" ], "description": "The IP address to reverse" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "domains", "types": [ "Array" ], "description": "An array of possible domain names" } ], "description": "Reverse resolves an IP address to an array of domain names.", "short_description": "Reverse resolves an IP address to an array of domain names.", "ellipsis_description": "Reverse resolves an IP address to an array of domain names. ...", "line": 152, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.reverse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L152", "name": "reverse", "path": "dns.reverse" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L25", "name": "dns", "path": "dns" }, "dns.lookup": { "id": "dns.lookup", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "family", "default_value": "null", "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "address", "type": [ "String" ] }, { "name": "family", "type": [ "Number" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "address", "type": [ "String" ] }, { "name": "family", "type": [ "Number" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "family", "types": [ "Number" ], "description": "Indicates whether to use IPv4 (`4`) or IPv6 (`6`)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The error object" }, { "name": "address", "types": [ "String" ], "description": "A string representation of an IPv4 or IPv6 address" }, { "name": "family", "types": [ "Number" ], "description": "Either the integer `4` or `6`, and donates the address family--not necessarily the value initially passed to `lookup`", "optional": true } ], "description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n\n#### Example\n\n", "short_description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n", "ellipsis_description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n ...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.lookup", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L43", "name": "lookup", "path": "dns.lookup" }, "dns.resolve": { "id": "dns.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "rrtype", "default_value": "A", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "rrtype", "types": [ "String" ], "description": "The record type to use", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "String" ], "description": "Determined by the record type and described in each corresponding lookup method" } ], "description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n\n* `A` (IPV4 addresses)\n* `AAAA` (IPV6 addresses)\n* `MX` (mail exchange records)\n* `TXT` (text records)\n* `SRV` (SRV records)\n* `PTR` (used for reverse IP lookups)\n* `NS` (name server records)\n* `CNAME` (canonical name records)\n\n#### Example\n\n", "short_description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n", "ellipsis_description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n ...", "line": 70, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L70", "name": "resolve", "path": "dns.resolve" }, "dns.resolve4": { "id": "dns.resolve4", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of IPv4 addresses (_e.g._ `['74.125.79.104', '74.125.79.105', '74.125.79.106']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords). ...", "line": 84, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve4", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L84", "name": "resolve4", "path": "dns.resolve4" }, "dns.resolve6": { "id": "dns.resolve6", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of IPv6 addresses" } ], "description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery).", "short_description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery).", "ellipsis_description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery). ...", "line": 97, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve6", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L97", "name": "resolve6", "path": "dns.resolve6" }, "dns.resolveMx": { "id": "dns.resolveMx", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of MX records, each with a priority and an exchange attribute (_e.g._ `[{'priority' : 10, 'exchange' : 'mx.example.com'},{...}]`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records). ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveMx", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L112", "name": "resolveMx", "path": "dns.resolveMx" }, "dns.resolveTxt": { "id": "dns.resolveTxt", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of text records available for `domain` (_e.g._ `['v=spf1 ip4 0.0.0.0 ~all']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords). ...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveTxt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L126", "name": "resolveTxt", "path": "dns.resolveTxt" }, "dns.resolveSrv": { "id": "dns.resolveSrv", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the SRV records available for `domain`. Properties of SRV records are priority, weight, port, and name (_e.g._ `[{'priority' : 10, 'weight' : 5, 'port' : 21223, 'name' : 'service.example.com'}, {...}]`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords). ...", "line": 141, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveSrv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L141", "name": "resolveSrv", "path": "dns.resolveSrv" }, "dns.reverse": { "id": "dns.reverse", "type": "class method", "signatures": [ { "args": [ { "name": "ip", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "ip", "types": [ "String" ], "description": "The IP address to reverse" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "domains", "types": [ "Array" ], "description": "An array of possible domain names" } ], "description": "Reverse resolves an IP address to an array of domain names.", "short_description": "Reverse resolves an IP address to an array of domain names.", "ellipsis_description": "Reverse resolves an IP address to an array of domain names. ...", "line": 152, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.reverse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L152", "name": "reverse", "path": "dns.reverse" }, "dns.resolveNs": { "id": "dns.resolveNs", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the name server records available for `domain`, _e.g_ `['ns1.example.com', 'ns2.example.com']`" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records). ...", "line": 166, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveNs", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L166", "name": "resolveNs", "path": "dns.resolveNs" }, "dns.resolveCname": { "id": "dns.resolveCname", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the canonical name records available for `domain` (e.g. `['bar.example.com']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n\nEach DNS query can return one of the following error codes:\n\n- `dns.TEMPFAIL`: timeout, SERVFAIL or similar.\n- `dns.PROTOCOL`: got garbled reply.\n- `dns.NXDOMAIN`: domain does not exists.\n- `dns.NODATA`: domain exists but no data of reqd type.\n- `dns.NOMEM`: out of memory while processing.\n- `dns.BADQUERY`: the query is malformed.", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n ...", "line": 188, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveCname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L188", "name": "resolveCname", "path": "dns.resolveCname" }, "Domain": { "id": "Domain", "type": "class", "description": "\nDomains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters or callbacks registered to a\ndomain emit an `error` event, or throw an error, then the domain object\nwill be notified, rather than losing the context of the error in the\n`process.on('uncaughtException')` handler, or causing the program to\nexit with an error code.\n\nThis feature is new in Node version 0.8. It is a first pass, and is\nexpected to change significantly in future versions. Please use it and\nprovide feedback.\n\nDue to their experimental nature, the Domains features are disabled unless\nthe `domain` module is loaded at least once. No domains are created or\nregistered by default. This is by design, to prevent adverse effects on\ncurrent programs. It is expected to be enabled by default in future\nNode.js versions.\n\n## Additions to Error objects\n\n\n\nAny time an Error object is routed through a domain, a few extra fields\nare added to it.\n\n* `error.domain` The domain that first handled the error.\n* `error.domain_emitter` The event emitter that emitted an 'error' event\n with the error object.\n* `error.domain_bound` The callback function which was bound to the\n domain, and passed an error as its first argument.\n* `error.domain_thrown` A boolean indicating whether the error was\n thrown, emitted, or passed to a bound callback function.\n\n## Implicit Binding\n\n\n\nIf domains are in use, then all new EventEmitter objects (including\nStream objects, requests, responses, etc.) will be implicitly bound to\nthe active domain at the time of their creation.\n\nAdditionally, callbacks passed to lowlevel event loop requests (such as\nto fs.open, or other callback-taking methods) will automatically be\nbound to the active domain. If they throw, then the domain will catch\nthe error.\n\nIn order to prevent excessive memory usage, Domain objects themselves\nare not implicitly added as children of the active domain. If they\nwere, then it would be too easy to prevent request and response objects\nfrom being properly garbage collected.\n\nIf you *want* to nest Domain objects as children of a parent Domain,\nthen you must explicitly add them, and then dispose of them later.\n\nImplicit binding routes thrown errors and `'error'` events to the\nDomain's `error` event, but does not register the EventEmitter on the\nDomain, so `domain.dispose()` will not shut down the EventEmitter.\nImplicit binding only takes care of thrown errors and `'error'` events.\n\n## Explicit Binding\n\n\n\nSometimes, the domain in use is not the one that ought to be used for a\nspecific event emitter. Or, the event emitter could have been created\nin the context of one domain, but ought to instead be bound to some\nother domain.\n\nFor example, there could be one domain in use for an HTTP server, but\nperhaps we would like to have a separate domain to use for each request.\n\nThat is possible via explicit binding.\n\nFor example:\n\n```\n// create a top-level domain for the server\nvar serverDomain = domain.create();\n\nserverDomain.run(function() {\n // server is created in the scope of serverDomain\n http.createServer(function(req, res) {\n // req and res are also created in the scope of serverDomain\n // however, we'd prefer to have a separate domain for each request.\n // create it first thing, and add req and res to it.\n var reqd = domain.create();\n reqd.add(req);\n reqd.add(res);\n reqd.on('error', function(er) {\n console.error('Error', er, req.url);\n try {\n res.writeHead(500);\n res.end('Error occurred, sorry.');\n res.on('close', function() {\n // forcibly shut down any other things added to this domain\n reqd.dispose();\n });\n } catch (er) {\n console.error('Error sending 500', er, req.url);\n // tried our best. clean up anything remaining.\n reqd.dispose();\n }\n });\n }).listen(1337);\n});\n```\n\n## domain.create()\n\n* return: {Domain}\n\nReturns a new Domain object.\n\n## Class: Domain\n\nThe Domain class encapsulates the functionality of routing errors and\nuncaught exceptions to the active Domain object.\n\nDomain is a child class of EventEmitter. To handle the errors that it\ncatches, listen to its `error` event.\n\n### domain.run(fn)\n\n* `fn` {Function}\n\nRun the supplied function in the context of the domain, implicitly\nbinding all event emitters, timers, and lowlevel requests that are\ncreated in that context.\n\nThis is the most basic way to use a domain.\n\nExample:\n\n```\nvar d = domain.create();\nd.on('error', function(er) {\n console.error('Caught error!', er);\n});\nd.run(function() {\n process.nextTick(function() {\n setTimeout(function() { // simulating some various async stuff\n fs.open('non-existent file', 'r', function(er, fd) {\n if (er) throw er;\n // proceed...\n });\n }, 100);\n });\n});\n```\n\nIn this example, the `d.on('error')` handler will be triggered, rather\nthan crashing the program.\n\n### domain.members\n\n* {Array}\n\nAn array of timers and event emitters that have been explicitly added\nto the domain.\n\n### domain.add(emitter)\n\n* `emitter` {EventEmitter | Timer} emitter or timer to be added to the domain\n\nExplicitly adds an emitter to the domain. If any event handlers called by\nthe emitter throw an error, or if the emitter emits an `error` event, it\nwill be routed to the domain's `error` event, just like with implicit\nbinding.\n\nThis also works with timers that are returned from `setInterval` and\n`setTimeout`. If their callback function throws, it will be caught by\nthe domain 'error' handler.\n\nIf the Timer or EventEmitter was already bound to a domain, it is removed\nfrom that one, and bound to this one instead.\n\n### domain.remove(emitter)\n\n* `emitter` {EventEmitter | Timer} emitter or timer to be removed from the\ndomain\n\nThe opposite of `domain.add(emitter)`. Removes domain handling from the\nspecified emitter.\n\n### domain.bind(cb)\n\n* `cb` {Function} The callback function\n* return: {Function} The bound function\n\nThe returned function will be a wrapper around the supplied callback\nfunction. When the returned function is called, any errors that are\nthrown will be routed to the domain's `error` event.\n\n#### Example\n\n var d = domain.create();\n\n function readSomeFile(filename, cb) {\n fs.readFile(filename, d.bind(function(er, data) {\n // if this throws, it will also be passed to the domain\n return cb(er, JSON.parse(data));\n }));\n }\n\n d.on('error', function(er) {\n // an error occurred somewhere.\n // if we throw it now, it will crash the program\n // with the normal line number and stack message.\n });\n\n### domain.intercept(cb)\n\n* `cb` {Function} The callback function\n* return: {Function} The intercepted function\n\nThis method is almost identical to `domain.bind(cb)`. However, in\naddition to catching thrown errors, it will also intercept `Error`\nobjects sent as the first argument to the function.\n\nIn this way, the common `if (er) return cb(er);` pattern can be replaced\nwith a single error handler in a single place.\n\n#### Example\n\n var d = domain.create();\n\n function readSomeFile(filename, cb) {\n fs.readFile(filename, d.intercept(function(er, data) {\n // if this throws, it will also be passed to the domain\n // additionally, we know that 'er' will always be null,\n // so the error-handling logic can be moved to the 'error'\n // event on the domain instead of being repeated throughout\n // the program.\n return cb(er, JSON.parse(data));\n }));\n }\n\n d.on('error', function(er) {\n // an error occurred somewhere.\n // if we throw it now, it will crash the program\n // with the normal line number and stack message.\n });\n\n### domain.dispose()\n\nThe dispose method destroys a domain, and makes a best effort attempt to\nclean up any and all IO that is associated with the domain. Streams are\naborted, ended, closed, and/or destroyed. Timers are cleared.\nExplicitly bound callbacks are no longer called. Any error events that\nare raised as a result of this are ignored.\n\nThe intention of calling `dispose` is generally to prevent cascading\nerrors when a critical part of the Domain context is found to be in an\nerror state.\n\nNote that IO might still be performed. However, to the highest degree\npossible, once a domain is disposed, further errors from the emitters in\nthat set will be ignored. So, even if some remaining actions are still\nin flight, Node.js will not communicate further about them.", "stability": "1 - Experimental", "short_description": "\nDomains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters or callbacks registered to a\ndomain emit an `error` event, or throw an error, then the domain object\nwill be notified, rather than losing the context of the error in the\n`process.on('uncaughtException')` handler, or causing the program to\nexit with an error code.\n", "ellipsis_description": "\nDomains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters o...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/domain.markdown", "fileName": "domain", "resultingFile": "domain.html#Domain", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/domain.markdown#L267", "name": "Domain", "path": "Domain" }, "eventemitter": { "id": "eventemitter", "type": "class", "description": "\nMany objects in Node.js emit events. Some examples include:\n\n* [[net.Server `net.Server`]], which emits an event each time a peer connects to\nit\n* [[fs.ReadStream `fs.ReadStream`]], which emits an event when the file is\nopened.\n\nAll objects that emit events are instances of `events.EventEmitter`.\n\nTypically, event names are represented by a camel-cased string. However, there\naren't any strict restrictions on that, as any string is accepted.\n\nThese functions can then be attached to objects, to be executed when an event is\nemitted. Such functions are called _listeners_.\n\nTo inherit from `EventEmitter`, add `require('events').EventEmitter` to your\ncode.\n\nWhen an `EventEmitter` instance experiences an error, the typical action is to\nemit an `'error'` event. Error events are treated as a special case in Node.js.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters automatically emit the event `'newListener'` when new\nlisteners are added.\n\n#### Example\n\n", "stability": "4 - API Frozen", "short_description": "\nMany objects in Node.js emit events. Some examples include:\n", "ellipsis_description": "\nMany objects in Node.js emit events. Some examples include:\n ...", "line": 37, "aliases": [], "children": [ { "id": "eventemitter.addListener", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute (alias of: eventemitter.on)" } ], "description": "Adds a listener to the end of the listeners array for the specified event.\n\n#### Example\n\n", "short_description": "Adds a listener to the end of the listeners array for the specified event.\n", "ellipsis_description": "Adds a listener to the end of the listeners array for the specified event.\n ...", "line": 61, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.addListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L61", "name": "addListener", "path": "eventemitter.addListener" }, { "id": "eventemitter.emit", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "arg", "types": [ "Object" ], "description": "Any optional arguments for the listeners", "optional": true } ], "description": "Execute each of the subscribed listeners in order with the supplied arguments.", "short_description": "Execute each of the subscribed listeners in order with the supplied arguments.", "ellipsis_description": "Execute each of the subscribed listeners in order with the supplied arguments. ...", "line": 70, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.emit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L70", "name": "emit", "path": "eventemitter.emit" }, { "id": "eventemitter.listeners", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event type to listen for" } ], "description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n\n#### Example\n\n", "short_description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n", "ellipsis_description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.listeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L82", "name": "listeners", "path": "eventemitter.listeners" }, { "id": "eventemitter.once", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute" } ], "description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after which it is removed.\n\n#### Example\n\n server.once('connection', function (stream) {\n console.log('Ah, we have our first user!');\n });", "short_description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after which it is removed.\n", "ellipsis_description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after wh...", "line": 98, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.once", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L98", "name": "once", "path": "eventemitter.once" }, { "id": "eventemitter.removeAllListeners", "type": "class method", "signatures": [ { "args": [ { "name": "event", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "An optional event type to remove", "optional": true } ], "description": "Removes all listeners, or those of the specified event.", "short_description": "Removes all listeners, or those of the specified event.", "ellipsis_description": "Removes all listeners, or those of the specified event. ...", "line": 106, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.removeAllListeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L106", "name": "removeAllListeners", "path": "eventemitter.removeAllListeners" }, { "id": "eventemitter.removeListener", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute" } ], "description": "Remove a listener from the listener array for the specified event.\n\nWarning: This can change array indices in the listener array behind the\nlistener.\n\n#### Example\n\n var callback = function(stream) {\n console.log('someone connected!');\n };\n server.on('connection', callback);\n // ...\n server.removeListener('connection', callback);", "short_description": "Remove a listener from the listener array for the specified event.\n", "ellipsis_description": "Remove a listener from the listener array for the specified event.\n ...", "line": 127, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.removeListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L127", "name": "removeListener", "path": "eventemitter.removeListener" }, { "id": "eventemitter.setMaxListeners", "type": "class method", "signatures": [ { "args": [ { "name": "n", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "n", "types": [ "Number" ], "description": "The maximum number of listeners" } ], "description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a useful default which helps finding memory\nleaks.\n\nObviously, not all Emitters should be limited to 10. This function allows that\nto be increased. Set it to `0` for unlimited listeners.\n\n#### Example\n\n", "short_description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a useful default which helps finding memory\nleaks.\n", "ellipsis_description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a usef...", "line": 143, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.setMaxListeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L143", "name": "setMaxListeners", "path": "eventemitter.setMaxListeners" }, { "id": "eventemitter@newListener", "type": "event", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to emit" }, { "name": "listener", "types": [ "Function" ], "description": "The attaching listener" } ], "description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached.", "short_description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached.", "ellipsis_description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached. ...", "line": 47, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter@newListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L47", "name": "newListener", "path": "eventemitter.event.newListener" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L37", "name": "eventemitter", "path": "eventemitter" }, "eventemitter@newListener": { "id": "eventemitter@newListener", "type": "event", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to emit" }, { "name": "listener", "types": [ "Function" ], "description": "The attaching listener" } ], "description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached.", "short_description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached.", "ellipsis_description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached. ...", "line": 47, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter@newListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L47", "name": "newListener", "path": "eventemitter.event.newListener" }, "eventemitter.addListener": { "id": "eventemitter.addListener", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute (alias of: eventemitter.on)" } ], "description": "Adds a listener to the end of the listeners array for the specified event.\n\n#### Example\n\n", "short_description": "Adds a listener to the end of the listeners array for the specified event.\n", "ellipsis_description": "Adds a listener to the end of the listeners array for the specified event.\n ...", "line": 61, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.addListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L61", "name": "addListener", "path": "eventemitter.addListener" }, "eventemitter.emit": { "id": "eventemitter.emit", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "arg", "types": [ "Object" ], "description": "Any optional arguments for the listeners", "optional": true } ], "description": "Execute each of the subscribed listeners in order with the supplied arguments.", "short_description": "Execute each of the subscribed listeners in order with the supplied arguments.", "ellipsis_description": "Execute each of the subscribed listeners in order with the supplied arguments. ...", "line": 70, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.emit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L70", "name": "emit", "path": "eventemitter.emit" }, "eventemitter.listeners": { "id": "eventemitter.listeners", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event type to listen for" } ], "description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n\n#### Example\n\n", "short_description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n", "ellipsis_description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.listeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L82", "name": "listeners", "path": "eventemitter.listeners" }, "eventemitter.once": { "id": "eventemitter.once", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute" } ], "description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after which it is removed.\n\n#### Example\n\n server.once('connection', function (stream) {\n console.log('Ah, we have our first user!');\n });", "short_description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after which it is removed.\n", "ellipsis_description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after wh...", "line": 98, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.once", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L98", "name": "once", "path": "eventemitter.once" }, "eventemitter.removeAllListeners": { "id": "eventemitter.removeAllListeners", "type": "class method", "signatures": [ { "args": [ { "name": "event", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "An optional event type to remove", "optional": true } ], "description": "Removes all listeners, or those of the specified event.", "short_description": "Removes all listeners, or those of the specified event.", "ellipsis_description": "Removes all listeners, or those of the specified event. ...", "line": 106, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.removeAllListeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L106", "name": "removeAllListeners", "path": "eventemitter.removeAllListeners" }, "eventemitter.removeListener": { "id": "eventemitter.removeListener", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute" } ], "description": "Remove a listener from the listener array for the specified event.\n\nWarning: This can change array indices in the listener array behind the\nlistener.\n\n#### Example\n\n var callback = function(stream) {\n console.log('someone connected!');\n };\n server.on('connection', callback);\n // ...\n server.removeListener('connection', callback);", "short_description": "Remove a listener from the listener array for the specified event.\n", "ellipsis_description": "Remove a listener from the listener array for the specified event.\n ...", "line": 127, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.removeListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L127", "name": "removeListener", "path": "eventemitter.removeListener" }, "eventemitter.setMaxListeners": { "id": "eventemitter.setMaxListeners", "type": "class method", "signatures": [ { "args": [ { "name": "n", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "n", "types": [ "Number" ], "description": "The maximum number of listeners" } ], "description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a useful default which helps finding memory\nleaks.\n\nObviously, not all Emitters should be limited to 10. This function allows that\nto be increased. Set it to `0` for unlimited listeners.\n\n#### Example\n\n", "short_description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a useful default which helps finding memory\nleaks.\n", "ellipsis_description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a usef...", "line": 143, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.setMaxListeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L143", "name": "setMaxListeners", "path": "eventemitter.setMaxListeners" }, "fs": { "id": "fs", "type": "class", "description": "\nIn Node.js, file input and output is provided by simple wrappers around standard\n[POSIX functions](http://en.wikipedia.org/wiki/POSIX). All the read and write\nmethods methods have asynchronous and synchronous forms. To use this module,\ninclude `require('fs')` in your code.\n\nThe asynchronous form always take a completion callback as its last argument.\nThe arguments passed to the completion callback depend on the method, but the\nfirst argument is always reserved for an exception. If the operation was\ncompleted successfully, then the first argument will be `null` or `undefined`.\n\nWhen using the synchronous form, any exceptions are immediately thrown. You can\nuse `try/catch` to handle exceptions, or allow them to bubble up.\n\nIn busy processes, the programmer is **strongly encouraged** to use the\nasynchronous versions of these calls. The synchronous versions block the entire\nprocess until they complete—halting all connections. However, with the\nasynchronous methods, there is no guaranteed ordering.\n\nNote: When processing files, relative paths to filename can be used; however, this path is relative to [[process.cwd `process.cwd()`]].\n\n#### Example: An asynchronous file delete:\n\n\n\n#### Example: A synchronous file delete:\n\n\n\n#### Example: Handling timing issues with callback\n\nHere's an example of the **wrong** way to perform more than one asynchronous\noperation:\n\n fs.rename('/tmp/hello', '/tmp/world', function (err) {\n if (err) throw err;\n console.log('renamed complete');\n });\n\t\t// ERROR: THIS IS NOT CORRECT!\n fs.stat('/tmp/world', function (err, stats) {\n if (err) throw err;\n console.log('stats: ' + JSON.stringify(stats));\n });\n\nIn the example above, it could be that `fs.stat` is executed before `fs.rename`.\nThe correct way to do this is to chain the callbacks, like this:\n\n fs.rename('/tmp/hello', '/tmp/world', function (err) {\n if (err) throw err;\n fs.stat('/tmp/world', function (err, stats) {\n if (err) throw err;\n console.log('stats: ' + JSON.stringify(stats));\n });\n });", "stability": "3 - Stable", "short_description": "\nIn Node.js, file input and output is provided by simple wrappers around standard\n[POSIX functions](http://en.wikipedia.org/wiki/POSIX). All the read and write\nmethods methods have asynchronous and synchronous forms. To use this module,\ninclude `require('fs')` in your code.\n", "ellipsis_description": "\nIn Node.js, file input and output is provided by simple wrappers around standard\n[POSIX functions](http://en.wikipe...", "line": 62, "aliases": [], "children": [ { "id": "fs.chmod", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "short_description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "ellipsis_description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the per...", "line": 253, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L253", "name": "chmod", "path": "fs.chmod" }, { "id": "fs.chmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "short_description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "ellipsis_description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permi...", "line": 269, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L269", "name": "chmodSync", "path": "fs.chmodSync" }, { "id": "fs.chown", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\nde-referenced if it is a symbolic link.", "short_description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\nde-referenced if it is a symbolic link.", "ellipsis_description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the own...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L146", "name": "chown", "path": "fs.chown" }, { "id": "fs.chownSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\ndereferenced if it is a symbolic link", "short_description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\ndereferenced if it is a symbolic link", "ellipsis_description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the owner...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L162", "name": "chownSync", "path": "fs.chownSync" }, { "id": "fs.close", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "short_description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "ellipsis_description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/ma...", "line": 711, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L711", "name": "close", "path": "fs.close" }, { "id": "fs.closeSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "short_description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "ellipsis_description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2...", "line": 724, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.closeSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L724", "name": "closeSync", "path": "fs.closeSync" }, { "id": "fs.createReadStream", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "fs.ReadStream" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to read from" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how to read the stream", "optional": true } ], "description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n\n`options` is an object with the following defaults:\n\n {\n flags: 'r',\n encoding: null,\n fd: null,\n mode: 0666,\n bufferSize: 64 * 1024\n }\n\n`options` can include `start` and `end` values to read a range of bytes from the\nfile instead of the entire file. Both `start` and `end` are inclusive and start\nat 0.\n\n#### Example\n\nHere's an example to read the last 10 bytes of a file which is 100 bytes long:\n\n fs.createReadStream('sample.txt', {start: 90, end: 99});", "short_description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n", "ellipsis_description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n ...", "line": 1202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.createReadStream", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1202", "name": "createReadStream", "path": "fs.createReadStream" }, { "id": "fs.createWriteStream", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "fs.WriteStream" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to read from" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how to write the stream", "optional": true } ], "description": "Returns a new [[streams.WritableStream WriteStream]] object.\n\n`options` is an object with the following defaults:\n\n { flags: 'w',\n encoding: null,\n mode: 0666 }\n\n`options` may also include a `start` option to allow writing data at some\nposition past the beginning of the file.\n\nModifying a file rather than replacing it may require a `flags` mode of `r+`\nrather than the default mode `w`.", "short_description": "Returns a new [[streams.WritableStream WriteStream]] object.\n", "ellipsis_description": "Returns a new [[streams.WritableStream WriteStream]] object.\n ...", "line": 1225, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.createWriteStream", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1225", "name": "createWriteStream", "path": "fs.createWriteStream" }, { "id": "fs.fchmod", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "short_description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "ellipsis_description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the ...", "line": 288, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L288", "name": "fchmod", "path": "fs.fchmod" }, { "id": "fs.fchmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "short_description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "ellipsis_description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the pe...", "line": 304, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L304", "name": "fchmodSync", "path": "fs.fchmodSync" }, { "id": "fs.fchown", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "short_description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "ellipsis_description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ...", "line": 181, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L181", "name": "fchown", "path": "fs.fchown" }, { "id": "fs.fchownSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "short_description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "ellipsis_description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ow...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L198", "name": "fchownSync", "path": "fs.fchownSync" }, { "id": "fs.fstat", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`]] object." } ], "description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 391, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fstat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L391", "name": "fstat", "path": "fs.fstat" }, { "id": "fs.fstatSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 430, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fstatSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L430", "name": "fstatSync", "path": "fs.fstatSync" }, { "id": "fs.fsync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err" } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err" } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "short_description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "ellipsis_description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html). ...", "line": 887, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fsync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L887", "name": "fsync", "path": "fs.fsync" }, { "id": "fs.fsyncSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "short_description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "ellipsis_description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html). ...", "line": 901, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fsyncSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L901", "name": "fsyncSync", "path": "fs.fsyncSync" }, { "id": "fs.futimes", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "short_description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "ellipsis_description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file...", "line": 853, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.futimes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L853", "name": "futimes", "path": "fs.futimes" }, { "id": "fs.futimesSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" } ], "description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "short_description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "ellipsis_description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file t...", "line": 871, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.futimesSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L871", "name": "futimesSync", "path": "fs.futimesSync" }, { "id": "fs.lchmod", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] except in the case where the named file is a\nsymbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "short_description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] except in the case where the named file is a\nsymbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "ellipsis_description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] ex...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L323", "name": "lchmod", "path": "fs.lchmod" }, { "id": "fs.lchmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()`]]except in the case where the named file is\na symbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "short_description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()`]]except in the case where the named file is\na symbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "ellipsis_description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()...", "line": 339, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L339", "name": "lchmodSync", "path": "fs.lchmodSync" }, { "id": "fs.lchown", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chown `chown()`]], but doesn't dereference symbolic links.", "short_description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chown `chown()`]], but doesn't dereference symbolic links.", "ellipsis_description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs...", "line": 217, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L217", "name": "lchown", "path": "fs.lchown" }, { "id": "fs.lchownSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chownSync `chownSync()`]], but doesn't dereference symbolic\nlinks", "short_description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chownSync `chownSync()`]], but doesn't dereference symbolic\nlinks", "ellipsis_description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.cho...", "line": 234, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L234", "name": "lchownSync", "path": "fs.lchownSync" }, { "id": "fs.link", "type": "class method", "signatures": [ { "args": [ { "name": "srcpath", "types": [ "String" ] }, { "name": "dstpath", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The original path of a file" }, { "name": "dstpath", "types": [ "String" ], "description": "The new file link path" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "short_description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "ellipsis_description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html). ...", "line": 447, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.link", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L447", "name": "link", "path": "fs.link" }, { "id": "fs.linkSync", "type": "class method", "signatures": [ { "args": [ { "name": "srcpath", "types": [ "String" ] }, { "name": "dstpath", "types": [ "String" ] } ] } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The original path of a file" }, { "name": "dstpath", "types": [ "String" ], "description": "The new file link path" } ], "description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "short_description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "ellipsis_description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html). ...", "line": 461, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.linkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L461", "name": "linkSync", "path": "fs.linkSync" }, { "id": "fs.lstat", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`] object." } ], "description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 374, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lstat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L374", "name": "lstat", "path": "fs.lstat" }, { "id": "fs.lstatSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" } ], "description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lstatSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L417", "name": "lstatSync", "path": "fs.lstatSync" }, { "id": "fs.mkdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "default_value": 777, "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the new directory" }, { "name": "mode", "types": [ "Number" ], "description": "An optional permission to set", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "short_description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "ellipsis_description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html). ...", "line": 646, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.mkdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L646", "name": "mkdir", "path": "fs.mkdir" }, { "id": "fs.mkdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "default_value": 777, "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the new directory" }, { "name": "mode", "types": [ "Number" ], "description": "An optional permission to set", "optional": true } ], "description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "short_description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "ellipsis_description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html). ...", "line": 660, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.mkdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L660", "name": "mkdirSync", "path": "fs.mkdirSync" }, { "id": "fs.open", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "flags", "types": [ "String" ] }, { "name": "mode", "default_value": 666, "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "fd", "type": [ "Number" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "fd", "type": [ "Number" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "flags", "types": [ "String" ], "description": "A string indicating how to open the file" }, { "name": "mode", "types": [ "Number" ], "description": "The optional permissions to give the file if it's created", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "fd", "types": [ "Number" ], "description": "An open file descriptor" } ], "description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n\n`flags` can be one of the following:\n\n* `'r'`: Opens the file for reading. An exception occurs if the file does not\nexist.\n\n* `'r+'`: Opens the file for reading and writing. An exception occurs if the\nfile does not exist.\n\n* `'w'`: Opens the file for writing. The file is created (if it does not exist)\nor truncated (if it exists).\n\n* `'w+'`: Opens the file for reading and writing. The file is created (if it\ndoesn't exist) or truncated (if it exists).\n\n* `'a'`: Opens the file for appending. The file is created if it doesn't exist.\n\n* `'a+'`: Opens the file for reading and appending. The file is created if it\ndoesn't exist.", "short_description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n", "ellipsis_description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2...", "line": 762, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L762", "name": "open", "path": "fs.open" }, { "id": "fs.openSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "flags", "types": [ "String" ] }, { "name": "mode", "default_value": 666, "optional": true, "types": [ "Number" ] } ], "returns": [ { "type": "Number" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "flags", "types": [ "String" ], "description": "A string indicating how to open the file" }, { "name": "mode", "types": [ "Number" ], "description": "The optional permissions to give the file if it's created", "optional": true } ], "description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n\n`flags` can be one of the following:\n\n* `'r'`: Opens the file for reading. An exception occurs if the file does not\nexist.\n\n* `'r+'`: Opens the file for reading and writing. An exception occurs if the\nfile does not exist.\n\n* `'w'`: Opens the file for writing. The file is created (if it does not exist)\nor truncated (if it exists).\n\n* `'w+'`: Opens the file for reading and writing. The file is created (if it\ndoesn't exist) or truncated (if it exists).\n\n* `'a'`: Opens the file for appending. The file is created if it doesn't exist.\n\n* `'a+'`: Opens the file for reading and appending. The file is created if it\ndoesn't exist.\n\n#### Returns\n\nAn open file descriptor.", "short_description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n", "ellipsis_description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/o...", "line": 800, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.openSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L800", "name": "openSync", "path": "fs.openSync" }, { "id": "fs.read", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "buffer", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "position", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "bytesRead", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "bytesRead", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to read from" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start writing at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates the number of bytes to read" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where the reading should begin" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "bytesRead", "types": [ "Number" ], "description": "Specifies how many bytes were read from `buffer`" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The rest of the buffer" } ], "description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from the current file position.", "short_description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from the current file position.", "ellipsis_description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from...", "line": 977, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.read", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L977", "name": "read", "path": "fs.read" }, { "id": "fs.readdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "files", "type": [ "Array" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "files", "type": [ "Array" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the directory" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "files", "types": [ "Array" ], "description": "An array of the names of the files in the directory (excluding `'.'` and `'..'`)" } ], "description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the contents of a directory.", "short_description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the contents of a directory.", "ellipsis_description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the c...", "line": 679, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L679", "name": "readdir", "path": "fs.readdir" }, { "id": "fs.readdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the directory" } ], "description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array of filenames, excluding `'.'` and `'..'`.", "short_description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array of filenames, excluding `'.'` and `'..'`.", "ellipsis_description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array ...", "line": 694, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L694", "name": "readdirSync", "path": "fs.readdirSync" }, { "id": "fs.readFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "data", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "data", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to read" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "data", "types": [ "Buffer" ], "description": "The contents of the file" } ], "description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n\n#### Example\n\n fs.readFile('/etc/passwd', function (err, data) {\n if (err) throw err;\n console.log(data);\n });", "short_description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n", "ellipsis_description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n ...", "line": 1029, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1029", "name": "readFile", "path": "fs.readFile" }, { "id": "fs.readFileSync", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" }, { "type": "Buffer" } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to read" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true } ], "description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n\n#### Returns\n\nThe contents of the `filename`. If `encoding` is specified, then this function\nreturns a string. Otherwise it returns a [[Buffer buffer]].", "short_description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n", "ellipsis_description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n ...", "line": 1048, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readFileSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1048", "name": "readFileSync", "path": "fs.readFileSync" }, { "id": "fs.readlink", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "linkString", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "linkString", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The original path of a link" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "linkString", "types": [ "String" ], "description": "T he symlink's string value" } ], "description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).", "short_description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).", "ellipsis_description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml). ...", "line": 516, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L516", "name": "readlink", "path": "fs.readlink" }, { "id": "fs.readlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The original path of a link" } ], "description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n\n#### Returns\n\nThe symbolic link's string value.", "short_description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n", "ellipsis_description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n ...", "line": 534, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L534", "name": "readlinkSync", "path": "fs.readlinkSync" }, { "id": "fs.readSync", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to read from" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start writing at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates the number of bytes to read" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where the reading should begin" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use" } ], "description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writes it to `buffer`. If `position` is `null`,\ndata will be read from the current file position.\n\n\n#### Returns\n\nThe number of bytes read.", "short_description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writes it to `buffer`. If `position` is `null`,\ndata will be read from the current file position.\n", "ellipsis_description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writ...", "line": 1003, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1003", "name": "readSync", "path": "fs.readSync" }, { "id": "fs.realpath", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "resolvedPath", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "resolvedPath", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "A path to a file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "resolvedPath", "types": [ "String" ], "description": "The resolved path string" } ], "description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [[process.cwd `process.cwd()`]] to resolve relative paths.", "short_description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [[process.cwd `process.cwd()`]] to resolve relative paths.", "ellipsis_description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [...", "line": 553, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.realpath", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L553", "name": "realpath", "path": "fs.realpath" }, { "id": "fs.realpathSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "A path to a file" } ], "description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n\n#### Returns\n\nThe resolved path.", "short_description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n", "ellipsis_description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n ...", "line": 571, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.realpathSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L571", "name": "realpathSync", "path": "fs.realpathSync" }, { "id": "fs.rename", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The original filename and path" }, { "name": "path2", "types": [ "String" ], "description": "The new filename and path" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "short_description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "ellipsis_description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `p...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L80", "name": "rename", "path": "fs.rename" }, { "id": "fs.renameSync", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The original filename and path" }, { "name": "path2", "types": [ "String" ], "description": "The new filename and path" } ], "description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "short_description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "ellipsis_description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `pat...", "line": 93, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.renameSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L93", "name": "renameSync", "path": "fs.renameSync" }, { "id": "fs.rmdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to a directory" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "short_description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "ellipsis_description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html). ...", "line": 618, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rmdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L618", "name": "rmdir", "path": "fs.rmdir" }, { "id": "fs.rmdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to a directory" } ], "description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "short_description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "ellipsis_description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html). ...", "line": 629, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rmdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L629", "name": "rmdirSync", "path": "fs.rmdirSync" }, { "id": "fs.stat", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`] object." } ], "description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 356, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.stat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L356", "name": "stat", "path": "fs.stat" }, { "id": "fs.statSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" } ], "description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.statSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L404", "name": "statSync", "path": "fs.statSync" }, { "id": "fs.symlink", "type": "class method", "signatures": [ { "args": [ { "name": "linkdata", "types": [ "String" ] }, { "name": "path", "types": [ "String" ] }, { "name": "type", "default_value": "file", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "linkdata", "types": [ "String" ], "description": "The original path of a file" }, { "name": "path", "types": [ "String" ], "description": "The new file link path" }, { "name": "type", "types": [ "String" ], "description": "This can be either `'dir'` or `'file'`. It is only used on Windows ( andignored on other platforms)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "short_description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "ellipsis_description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl). ...", "line": 481, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.symlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L481", "name": "symlink", "path": "fs.symlink" }, { "id": "fs.symlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "linkdata", "types": [ "String" ] }, { "name": "path", "types": [ "String" ] }, { "name": "type", "default_value": "file", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "linkdata", "types": [ "String" ], "description": "The original path of a file" }, { "name": "path", "types": [ "String" ], "description": "The new file link path" }, { "name": "type", "types": [ "String" ], "description": "This can be either `'dir'` or `'file'`. It is only used on Windows ( andignored on other platforms)", "optional": true } ], "description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "short_description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "ellipsis_description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl). ...", "line": 498, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.symlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L498", "name": "symlinkSync", "path": "fs.symlinkSync" }, { "id": "fs.truncate", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "len", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "len", "types": [ "Number" ], "description": "The final file length" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "short_description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "ellipsis_description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates...", "line": 111, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.truncate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L111", "name": "truncate", "path": "fs.truncate" }, { "id": "fs.truncateSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "len", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "len", "types": [ "Number" ], "description": "The final file length" } ], "description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "short_description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "ellipsis_description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.truncateSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L126", "name": "truncateSync", "path": "fs.truncateSync" }, { "id": "fs.unlink", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The path to a file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "short_description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "ellipsis_description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n. ...", "line": 588, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L588", "name": "unlink", "path": "fs.unlink" }, { "id": "fs.unlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The path to a file" } ], "description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "short_description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "ellipsis_description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n. ...", "line": 602, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L602", "name": "unlinkSync", "path": "fs.unlinkSync" }, { "id": "fs.unwatchFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The filename to watch" } ], "description": "Stops watching for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.", "short_description": "Stops watching for changes on `filename`.\n", "ellipsis_description": "Stops watching for changes on `filename`.\n ...", "line": 1129, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unwatchFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1129", "name": "unwatchFile", "path": "fs.unwatchFile" }, { "id": "fs.utimes", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps of the file referenced by the supplied path.", "short_description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps of the file referenced by the supplied path.", "ellipsis_description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps o...", "line": 818, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.utimes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L818", "name": "utimes", "path": "fs.utimes" }, { "id": "fs.utimesSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" } ], "description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of the file referenced by the supplied path.", "short_description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of the file referenced by the supplied path.", "ellipsis_description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of t...", "line": 834, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.utimesSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L834", "name": "utimesSync", "path": "fs.utimesSync" }, { "id": "fs.watch", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "event", "type": [ "String" ] }, { "name": "filename", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "event", "type": [ "String" ] }, { "name": "filename", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.FSWatcher" } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The filename (or directory) to watch" }, { "name": "options", "types": [ "Object" ], "description": "An optional arguments indicating how to watch the files; defaults to `true`", "optional": true }, { "name": "listener", "types": [ "Function" ], "description": "The callback to execute each time the file is accessed" }, { "name": "event", "types": [ "String" ], "description": "Either `'rename'` or '`change'`" }, { "name": "filename", "types": [ "String" ], "description": "The name of the file which triggered the event" } ], "description": "Watch for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.\n\n`options`, if provided, should be an object containing a boolean member\n`persistent`, which indicates whether the process should continue to run as long\nas files are being watched.\n\nWarning: Providing the `filename` argument in the callback is not supported on\nevery platform (currently it's only supported on Linux and Windows). Even on\nsupported platforms, `filename` is **not** always guaranteed to be provided.\nTherefore, don't assume that `filename` argument is always provided in the\ncallback, and have some fallback logic if it is `null`, like in the provided\nexample.\n\n#### Example\n\n fs.watch('somedir', function (event, filename) {\n console.log('event is: ' + event);\n if (filename) {\n console.log('filename provided: ' + filename);\n } else {\n console.log('filename not provided');\n }\n });", "short_description": "Watch for changes on `filename`.\n", "ellipsis_description": "Watch for changes on `filename`.\n ...", "line": 1168, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.watch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1168", "name": "watch", "path": "fs.watch" }, { "id": "fs.watchFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "curr", "type": [ "fs.Stats" ] }, { "name": "prev", "type": [ "fs.Stats" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "curr", "type": [ "fs.Stats" ] }, { "name": "prev", "type": [ "fs.Stats" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to watch" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how often to watch", "optional": true }, { "name": "listener", "types": [ "Function" ], "description": "The callback to execute each time the file is accessed" }, { "name": "curr", "types": [ "fs.Stats" ], "description": "The current `stats` object" }, { "name": "prev", "types": [ "fs.Stats" ], "description": "The previous `stats` object" } ], "description": "Watches for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.\n\n`options`, if provided, should be an object containing two boolean members:\n`persistent` and `interval`:\n* `persistent` indicates whether the process should continue to run as long as\nfiles are being watched; defaults to `true`\n* `interval` indicates how often the target should be polled, in milliseconds; defaults to `0`\n\nOn Linux systems with [inotify](http://en.wikipedia.org/wiki/Inotify),\n`interval` is ignored.\n\n#### Example\n\n fs.watchFile('message.text', function (curr, prev) {\n console.log('the current modification time is: ' + curr.mtime);\n console.log('the previous modification time was: ' + prev.mtime);\n });", "short_description": "Watches for changes on `filename`.\n", "ellipsis_description": "Watches for changes on `filename`.\n ...", "line": 1117, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.watchFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1117", "name": "watchFile", "path": "fs.watchFile" }, { "id": "fs.write", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "buffer", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "position", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "written", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "written", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where this data should be written" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "written", "types": [ "Number" ], "description": "Specifies how many bytes were written from `buffer`" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The remaining contents of the buffer" } ], "description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same file without waiting for the callback. For\nthis scenario, [[fs.createWriteStream `fs.createWriteStream()`]] is strongly\nrecommended.\n\nFor more information, see\n[pwrite(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/pwrite.2.html)\n.", "short_description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same file without waiting for the callback. For\nthis scenario, [[fs.createWriteStream `fs.createWriteStream()`]] is strongly\nrecommended.\n", "ellipsis_description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same fi...", "line": 929, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L929", "name": "write", "path": "fs.write" }, { "id": "fs.writeFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "data", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to write to" }, { "name": "data", "types": [ "String", "Buffer" ], "description": "The data to write (this can be a string or a buffer)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (this is ignored if `data` is a buffer)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "Asynchronously writes data to a file, replacing the file if it already exists.\n\n#### Example\n\n", "short_description": "Asynchronously writes data to a file, replacing the file if it already exists.\n", "ellipsis_description": "Asynchronously writes data to a file, replacing the file if it already exists.\n ...", "line": 1067, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1067", "name": "writeFile", "path": "fs.writeFile" }, { "id": "fs.writeFileSync", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "data", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to write to" }, { "name": "data", "types": [ "String", "Buffer" ], "description": "The data to write (this can be a string or a buffer)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (this is ignored if `data` is a buffer)", "optional": true } ], "description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]].", "short_description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]].", "ellipsis_description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]]. ...", "line": 1082, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeFileSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1082", "name": "writeFileSync", "path": "fs.writeFileSync" }, { "id": "fs.writeSync", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where this data should be written" }, { "name": "str", "types": [ "String" ], "description": "The string to write" }, { "name": "encoding", "types": [ "Number" ], "description": "The encoding to use during the write" } ], "description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n\n#### Returns\n\nReturns the number of bytes written.", "short_description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n", "ellipsis_description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n ...", "line": 954, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L954", "name": "writeSync", "path": "fs.writeSync" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs", "subclasses": [ "fs.Stats", "fs.WriteStream", "fs.ReadStream", "fs.FSWatcher" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L62", "name": "fs", "path": "fs" }, "fs.rename": { "id": "fs.rename", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The original filename and path" }, { "name": "path2", "types": [ "String" ], "description": "The new filename and path" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "short_description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "ellipsis_description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `p...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L80", "name": "rename", "path": "fs.rename" }, "fs.renameSync": { "id": "fs.renameSync", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The original filename and path" }, { "name": "path2", "types": [ "String" ], "description": "The new filename and path" } ], "description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "short_description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "ellipsis_description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `pat...", "line": 93, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.renameSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L93", "name": "renameSync", "path": "fs.renameSync" }, "fs.truncate": { "id": "fs.truncate", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "len", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "len", "types": [ "Number" ], "description": "The final file length" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "short_description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "ellipsis_description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates...", "line": 111, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.truncate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L111", "name": "truncate", "path": "fs.truncate" }, "fs.truncateSync": { "id": "fs.truncateSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "len", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "len", "types": [ "Number" ], "description": "The final file length" } ], "description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "short_description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "ellipsis_description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.truncateSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L126", "name": "truncateSync", "path": "fs.truncateSync" }, "fs.chown": { "id": "fs.chown", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\nde-referenced if it is a symbolic link.", "short_description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\nde-referenced if it is a symbolic link.", "ellipsis_description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the own...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L146", "name": "chown", "path": "fs.chown" }, "fs.chownSync": { "id": "fs.chownSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\ndereferenced if it is a symbolic link", "short_description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\ndereferenced if it is a symbolic link", "ellipsis_description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the owner...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L162", "name": "chownSync", "path": "fs.chownSync" }, "fs.fchown": { "id": "fs.fchown", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "short_description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "ellipsis_description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ...", "line": 181, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L181", "name": "fchown", "path": "fs.fchown" }, "fs.fchownSync": { "id": "fs.fchownSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "short_description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "ellipsis_description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ow...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L198", "name": "fchownSync", "path": "fs.fchownSync" }, "fs.lchown": { "id": "fs.lchown", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chown `chown()`]], but doesn't dereference symbolic links.", "short_description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chown `chown()`]], but doesn't dereference symbolic links.", "ellipsis_description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs...", "line": 217, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L217", "name": "lchown", "path": "fs.lchown" }, "fs.lchownSync": { "id": "fs.lchownSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chownSync `chownSync()`]], but doesn't dereference symbolic\nlinks", "short_description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chownSync `chownSync()`]], but doesn't dereference symbolic\nlinks", "ellipsis_description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.cho...", "line": 234, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L234", "name": "lchownSync", "path": "fs.lchownSync" }, "fs.chmod": { "id": "fs.chmod", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "short_description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "ellipsis_description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the per...", "line": 253, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L253", "name": "chmod", "path": "fs.chmod" }, "fs.chmodSync": { "id": "fs.chmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "short_description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "ellipsis_description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permi...", "line": 269, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L269", "name": "chmodSync", "path": "fs.chmodSync" }, "fs.fchmod": { "id": "fs.fchmod", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "short_description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "ellipsis_description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the ...", "line": 288, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L288", "name": "fchmod", "path": "fs.fchmod" }, "fs.fchmodSync": { "id": "fs.fchmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "short_description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "ellipsis_description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the pe...", "line": 304, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L304", "name": "fchmodSync", "path": "fs.fchmodSync" }, "fs.lchmod": { "id": "fs.lchmod", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] except in the case where the named file is a\nsymbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "short_description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] except in the case where the named file is a\nsymbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "ellipsis_description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] ex...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L323", "name": "lchmod", "path": "fs.lchmod" }, "fs.lchmodSync": { "id": "fs.lchmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()`]]except in the case where the named file is\na symbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "short_description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()`]]except in the case where the named file is\na symbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "ellipsis_description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()...", "line": 339, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L339", "name": "lchmodSync", "path": "fs.lchmodSync" }, "fs.stat": { "id": "fs.stat", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`] object." } ], "description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 356, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.stat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L356", "name": "stat", "path": "fs.stat" }, "fs.lstat": { "id": "fs.lstat", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`] object." } ], "description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 374, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lstat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L374", "name": "lstat", "path": "fs.lstat" }, "fs.fstat": { "id": "fs.fstat", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`]] object." } ], "description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 391, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fstat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L391", "name": "fstat", "path": "fs.fstat" }, "fs.statSync": { "id": "fs.statSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" } ], "description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.statSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L404", "name": "statSync", "path": "fs.statSync" }, "fs.lstatSync": { "id": "fs.lstatSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" } ], "description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lstatSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L417", "name": "lstatSync", "path": "fs.lstatSync" }, "fs.fstatSync": { "id": "fs.fstatSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 430, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fstatSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L430", "name": "fstatSync", "path": "fs.fstatSync" }, "fs.link": { "id": "fs.link", "type": "class method", "signatures": [ { "args": [ { "name": "srcpath", "types": [ "String" ] }, { "name": "dstpath", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The original path of a file" }, { "name": "dstpath", "types": [ "String" ], "description": "The new file link path" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "short_description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "ellipsis_description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html). ...", "line": 447, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.link", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L447", "name": "link", "path": "fs.link" }, "fs.linkSync": { "id": "fs.linkSync", "type": "class method", "signatures": [ { "args": [ { "name": "srcpath", "types": [ "String" ] }, { "name": "dstpath", "types": [ "String" ] } ] } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The original path of a file" }, { "name": "dstpath", "types": [ "String" ], "description": "The new file link path" } ], "description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "short_description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "ellipsis_description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html). ...", "line": 461, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.linkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L461", "name": "linkSync", "path": "fs.linkSync" }, "fs.symlink": { "id": "fs.symlink", "type": "class method", "signatures": [ { "args": [ { "name": "linkdata", "types": [ "String" ] }, { "name": "path", "types": [ "String" ] }, { "name": "type", "default_value": "file", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "linkdata", "types": [ "String" ], "description": "The original path of a file" }, { "name": "path", "types": [ "String" ], "description": "The new file link path" }, { "name": "type", "types": [ "String" ], "description": "This can be either `'dir'` or `'file'`. It is only used on Windows ( andignored on other platforms)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "short_description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "ellipsis_description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl). ...", "line": 481, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.symlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L481", "name": "symlink", "path": "fs.symlink" }, "fs.symlinkSync": { "id": "fs.symlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "linkdata", "types": [ "String" ] }, { "name": "path", "types": [ "String" ] }, { "name": "type", "default_value": "file", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "linkdata", "types": [ "String" ], "description": "The original path of a file" }, { "name": "path", "types": [ "String" ], "description": "The new file link path" }, { "name": "type", "types": [ "String" ], "description": "This can be either `'dir'` or `'file'`. It is only used on Windows ( andignored on other platforms)", "optional": true } ], "description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "short_description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "ellipsis_description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl). ...", "line": 498, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.symlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L498", "name": "symlinkSync", "path": "fs.symlinkSync" }, "fs.readlink": { "id": "fs.readlink", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "linkString", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "linkString", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The original path of a link" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "linkString", "types": [ "String" ], "description": "T he symlink's string value" } ], "description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).", "short_description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).", "ellipsis_description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml). ...", "line": 516, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L516", "name": "readlink", "path": "fs.readlink" }, "fs.readlinkSync": { "id": "fs.readlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The original path of a link" } ], "description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n\n#### Returns\n\nThe symbolic link's string value.", "short_description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n", "ellipsis_description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n ...", "line": 534, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L534", "name": "readlinkSync", "path": "fs.readlinkSync" }, "fs.realpath": { "id": "fs.realpath", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "resolvedPath", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "resolvedPath", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "A path to a file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "resolvedPath", "types": [ "String" ], "description": "The resolved path string" } ], "description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [[process.cwd `process.cwd()`]] to resolve relative paths.", "short_description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [[process.cwd `process.cwd()`]] to resolve relative paths.", "ellipsis_description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [...", "line": 553, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.realpath", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L553", "name": "realpath", "path": "fs.realpath" }, "fs.realpathSync": { "id": "fs.realpathSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "A path to a file" } ], "description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n\n#### Returns\n\nThe resolved path.", "short_description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n", "ellipsis_description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n ...", "line": 571, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.realpathSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L571", "name": "realpathSync", "path": "fs.realpathSync" }, "fs.unlink": { "id": "fs.unlink", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The path to a file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "short_description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "ellipsis_description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n. ...", "line": 588, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L588", "name": "unlink", "path": "fs.unlink" }, "fs.unlinkSync": { "id": "fs.unlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The path to a file" } ], "description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "short_description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "ellipsis_description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n. ...", "line": 602, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L602", "name": "unlinkSync", "path": "fs.unlinkSync" }, "fs.rmdir": { "id": "fs.rmdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to a directory" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "short_description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "ellipsis_description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html). ...", "line": 618, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rmdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L618", "name": "rmdir", "path": "fs.rmdir" }, "fs.rmdirSync": { "id": "fs.rmdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to a directory" } ], "description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "short_description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "ellipsis_description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html). ...", "line": 629, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rmdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L629", "name": "rmdirSync", "path": "fs.rmdirSync" }, "fs.mkdir": { "id": "fs.mkdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "default_value": 777, "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the new directory" }, { "name": "mode", "types": [ "Number" ], "description": "An optional permission to set", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "short_description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "ellipsis_description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html). ...", "line": 646, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.mkdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L646", "name": "mkdir", "path": "fs.mkdir" }, "fs.mkdirSync": { "id": "fs.mkdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "default_value": 777, "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the new directory" }, { "name": "mode", "types": [ "Number" ], "description": "An optional permission to set", "optional": true } ], "description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "short_description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "ellipsis_description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html). ...", "line": 660, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.mkdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L660", "name": "mkdirSync", "path": "fs.mkdirSync" }, "fs.readdir": { "id": "fs.readdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "files", "type": [ "Array" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "files", "type": [ "Array" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the directory" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "files", "types": [ "Array" ], "description": "An array of the names of the files in the directory (excluding `'.'` and `'..'`)" } ], "description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the contents of a directory.", "short_description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the contents of a directory.", "ellipsis_description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the c...", "line": 679, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L679", "name": "readdir", "path": "fs.readdir" }, "fs.readdirSync": { "id": "fs.readdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the directory" } ], "description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array of filenames, excluding `'.'` and `'..'`.", "short_description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array of filenames, excluding `'.'` and `'..'`.", "ellipsis_description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array ...", "line": 694, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L694", "name": "readdirSync", "path": "fs.readdirSync" }, "fs.close": { "id": "fs.close", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "short_description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "ellipsis_description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/ma...", "line": 711, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L711", "name": "close", "path": "fs.close" }, "fs.closeSync": { "id": "fs.closeSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "short_description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "ellipsis_description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2...", "line": 724, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.closeSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L724", "name": "closeSync", "path": "fs.closeSync" }, "fs.open": { "id": "fs.open", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "flags", "types": [ "String" ] }, { "name": "mode", "default_value": 666, "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "fd", "type": [ "Number" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "fd", "type": [ "Number" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "flags", "types": [ "String" ], "description": "A string indicating how to open the file" }, { "name": "mode", "types": [ "Number" ], "description": "The optional permissions to give the file if it's created", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "fd", "types": [ "Number" ], "description": "An open file descriptor" } ], "description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n\n`flags` can be one of the following:\n\n* `'r'`: Opens the file for reading. An exception occurs if the file does not\nexist.\n\n* `'r+'`: Opens the file for reading and writing. An exception occurs if the\nfile does not exist.\n\n* `'w'`: Opens the file for writing. The file is created (if it does not exist)\nor truncated (if it exists).\n\n* `'w+'`: Opens the file for reading and writing. The file is created (if it\ndoesn't exist) or truncated (if it exists).\n\n* `'a'`: Opens the file for appending. The file is created if it doesn't exist.\n\n* `'a+'`: Opens the file for reading and appending. The file is created if it\ndoesn't exist.", "short_description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n", "ellipsis_description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2...", "line": 762, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L762", "name": "open", "path": "fs.open" }, "fs.openSync": { "id": "fs.openSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "flags", "types": [ "String" ] }, { "name": "mode", "default_value": 666, "optional": true, "types": [ "Number" ] } ], "returns": [ { "type": "Number" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "flags", "types": [ "String" ], "description": "A string indicating how to open the file" }, { "name": "mode", "types": [ "Number" ], "description": "The optional permissions to give the file if it's created", "optional": true } ], "description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n\n`flags` can be one of the following:\n\n* `'r'`: Opens the file for reading. An exception occurs if the file does not\nexist.\n\n* `'r+'`: Opens the file for reading and writing. An exception occurs if the\nfile does not exist.\n\n* `'w'`: Opens the file for writing. The file is created (if it does not exist)\nor truncated (if it exists).\n\n* `'w+'`: Opens the file for reading and writing. The file is created (if it\ndoesn't exist) or truncated (if it exists).\n\n* `'a'`: Opens the file for appending. The file is created if it doesn't exist.\n\n* `'a+'`: Opens the file for reading and appending. The file is created if it\ndoesn't exist.\n\n#### Returns\n\nAn open file descriptor.", "short_description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n", "ellipsis_description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/o...", "line": 800, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.openSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L800", "name": "openSync", "path": "fs.openSync" }, "fs.utimes": { "id": "fs.utimes", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps of the file referenced by the supplied path.", "short_description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps of the file referenced by the supplied path.", "ellipsis_description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps o...", "line": 818, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.utimes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L818", "name": "utimes", "path": "fs.utimes" }, "fs.utimesSync": { "id": "fs.utimesSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" } ], "description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of the file referenced by the supplied path.", "short_description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of the file referenced by the supplied path.", "ellipsis_description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of t...", "line": 834, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.utimesSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L834", "name": "utimesSync", "path": "fs.utimesSync" }, "fs.futimes": { "id": "fs.futimes", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "short_description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "ellipsis_description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file...", "line": 853, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.futimes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L853", "name": "futimes", "path": "fs.futimes" }, "fs.futimesSync": { "id": "fs.futimesSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" } ], "description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "short_description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "ellipsis_description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file t...", "line": 871, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.futimesSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L871", "name": "futimesSync", "path": "fs.futimesSync" }, "fs.fsync": { "id": "fs.fsync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err" } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err" } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "short_description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "ellipsis_description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html). ...", "line": 887, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fsync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L887", "name": "fsync", "path": "fs.fsync" }, "fs.fsyncSync": { "id": "fs.fsyncSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "short_description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "ellipsis_description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html). ...", "line": 901, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fsyncSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L901", "name": "fsyncSync", "path": "fs.fsyncSync" }, "fs.write": { "id": "fs.write", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "buffer", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "position", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "written", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "written", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where this data should be written" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "written", "types": [ "Number" ], "description": "Specifies how many bytes were written from `buffer`" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The remaining contents of the buffer" } ], "description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same file without waiting for the callback. For\nthis scenario, [[fs.createWriteStream `fs.createWriteStream()`]] is strongly\nrecommended.\n\nFor more information, see\n[pwrite(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/pwrite.2.html)\n.", "short_description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same file without waiting for the callback. For\nthis scenario, [[fs.createWriteStream `fs.createWriteStream()`]] is strongly\nrecommended.\n", "ellipsis_description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same fi...", "line": 929, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L929", "name": "write", "path": "fs.write" }, "fs.writeSync": { "id": "fs.writeSync", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where this data should be written" }, { "name": "str", "types": [ "String" ], "description": "The string to write" }, { "name": "encoding", "types": [ "Number" ], "description": "The encoding to use during the write" } ], "description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n\n#### Returns\n\nReturns the number of bytes written.", "short_description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n", "ellipsis_description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n ...", "line": 954, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L954", "name": "writeSync", "path": "fs.writeSync" }, "fs.read": { "id": "fs.read", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "buffer", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "position", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "bytesRead", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "bytesRead", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to read from" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start writing at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates the number of bytes to read" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where the reading should begin" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "bytesRead", "types": [ "Number" ], "description": "Specifies how many bytes were read from `buffer`" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The rest of the buffer" } ], "description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from the current file position.", "short_description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from the current file position.", "ellipsis_description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from...", "line": 977, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.read", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L977", "name": "read", "path": "fs.read" }, "fs.readSync": { "id": "fs.readSync", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to read from" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start writing at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates the number of bytes to read" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where the reading should begin" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use" } ], "description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writes it to `buffer`. If `position` is `null`,\ndata will be read from the current file position.\n\n\n#### Returns\n\nThe number of bytes read.", "short_description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writes it to `buffer`. If `position` is `null`,\ndata will be read from the current file position.\n", "ellipsis_description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writ...", "line": 1003, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1003", "name": "readSync", "path": "fs.readSync" }, "fs.readFile": { "id": "fs.readFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "data", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "data", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to read" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "data", "types": [ "Buffer" ], "description": "The contents of the file" } ], "description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n\n#### Example\n\n fs.readFile('/etc/passwd', function (err, data) {\n if (err) throw err;\n console.log(data);\n });", "short_description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n", "ellipsis_description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n ...", "line": 1029, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1029", "name": "readFile", "path": "fs.readFile" }, "fs.readFileSync": { "id": "fs.readFileSync", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" }, { "type": "Buffer" } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to read" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true } ], "description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n\n#### Returns\n\nThe contents of the `filename`. If `encoding` is specified, then this function\nreturns a string. Otherwise it returns a [[Buffer buffer]].", "short_description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n", "ellipsis_description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n ...", "line": 1048, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readFileSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1048", "name": "readFileSync", "path": "fs.readFileSync" }, "fs.writeFile": { "id": "fs.writeFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "data", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to write to" }, { "name": "data", "types": [ "String", "Buffer" ], "description": "The data to write (this can be a string or a buffer)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (this is ignored if `data` is a buffer)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "Asynchronously writes data to a file, replacing the file if it already exists.\n\n#### Example\n\n", "short_description": "Asynchronously writes data to a file, replacing the file if it already exists.\n", "ellipsis_description": "Asynchronously writes data to a file, replacing the file if it already exists.\n ...", "line": 1067, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1067", "name": "writeFile", "path": "fs.writeFile" }, "fs.writeFileSync": { "id": "fs.writeFileSync", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "data", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to write to" }, { "name": "data", "types": [ "String", "Buffer" ], "description": "The data to write (this can be a string or a buffer)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (this is ignored if `data` is a buffer)", "optional": true } ], "description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]].", "short_description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]].", "ellipsis_description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]]. ...", "line": 1082, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeFileSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1082", "name": "writeFileSync", "path": "fs.writeFileSync" }, "fs.watchFile": { "id": "fs.watchFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "curr", "type": [ "fs.Stats" ] }, { "name": "prev", "type": [ "fs.Stats" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "curr", "type": [ "fs.Stats" ] }, { "name": "prev", "type": [ "fs.Stats" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to watch" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how often to watch", "optional": true }, { "name": "listener", "types": [ "Function" ], "description": "The callback to execute each time the file is accessed" }, { "name": "curr", "types": [ "fs.Stats" ], "description": "The current `stats` object" }, { "name": "prev", "types": [ "fs.Stats" ], "description": "The previous `stats` object" } ], "description": "Watches for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.\n\n`options`, if provided, should be an object containing two boolean members:\n`persistent` and `interval`:\n* `persistent` indicates whether the process should continue to run as long as\nfiles are being watched; defaults to `true`\n* `interval` indicates how often the target should be polled, in milliseconds; defaults to `0`\n\nOn Linux systems with [inotify](http://en.wikipedia.org/wiki/Inotify),\n`interval` is ignored.\n\n#### Example\n\n fs.watchFile('message.text', function (curr, prev) {\n console.log('the current modification time is: ' + curr.mtime);\n console.log('the previous modification time was: ' + prev.mtime);\n });", "short_description": "Watches for changes on `filename`.\n", "ellipsis_description": "Watches for changes on `filename`.\n ...", "line": 1117, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.watchFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1117", "name": "watchFile", "path": "fs.watchFile" }, "fs.unwatchFile": { "id": "fs.unwatchFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The filename to watch" } ], "description": "Stops watching for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.", "short_description": "Stops watching for changes on `filename`.\n", "ellipsis_description": "Stops watching for changes on `filename`.\n ...", "line": 1129, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unwatchFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1129", "name": "unwatchFile", "path": "fs.unwatchFile" }, "fs.watch": { "id": "fs.watch", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "event", "type": [ "String" ] }, { "name": "filename", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "event", "type": [ "String" ] }, { "name": "filename", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.FSWatcher" } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The filename (or directory) to watch" }, { "name": "options", "types": [ "Object" ], "description": "An optional arguments indicating how to watch the files; defaults to `true`", "optional": true }, { "name": "listener", "types": [ "Function" ], "description": "The callback to execute each time the file is accessed" }, { "name": "event", "types": [ "String" ], "description": "Either `'rename'` or '`change'`" }, { "name": "filename", "types": [ "String" ], "description": "The name of the file which triggered the event" } ], "description": "Watch for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.\n\n`options`, if provided, should be an object containing a boolean member\n`persistent`, which indicates whether the process should continue to run as long\nas files are being watched.\n\nWarning: Providing the `filename` argument in the callback is not supported on\nevery platform (currently it's only supported on Linux and Windows). Even on\nsupported platforms, `filename` is **not** always guaranteed to be provided.\nTherefore, don't assume that `filename` argument is always provided in the\ncallback, and have some fallback logic if it is `null`, like in the provided\nexample.\n\n#### Example\n\n fs.watch('somedir', function (event, filename) {\n console.log('event is: ' + event);\n if (filename) {\n console.log('filename provided: ' + filename);\n } else {\n console.log('filename not provided');\n }\n });", "short_description": "Watch for changes on `filename`.\n", "ellipsis_description": "Watch for changes on `filename`.\n ...", "line": 1168, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.watch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1168", "name": "watch", "path": "fs.watch" }, "fs.createReadStream": { "id": "fs.createReadStream", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "fs.ReadStream" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to read from" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how to read the stream", "optional": true } ], "description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n\n`options` is an object with the following defaults:\n\n {\n flags: 'r',\n encoding: null,\n fd: null,\n mode: 0666,\n bufferSize: 64 * 1024\n }\n\n`options` can include `start` and `end` values to read a range of bytes from the\nfile instead of the entire file. Both `start` and `end` are inclusive and start\nat 0.\n\n#### Example\n\nHere's an example to read the last 10 bytes of a file which is 100 bytes long:\n\n fs.createReadStream('sample.txt', {start: 90, end: 99});", "short_description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n", "ellipsis_description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n ...", "line": 1202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.createReadStream", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1202", "name": "createReadStream", "path": "fs.createReadStream" }, "fs.createWriteStream": { "id": "fs.createWriteStream", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "fs.WriteStream" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to read from" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how to write the stream", "optional": true } ], "description": "Returns a new [[streams.WritableStream WriteStream]] object.\n\n`options` is an object with the following defaults:\n\n { flags: 'w',\n encoding: null,\n mode: 0666 }\n\n`options` may also include a `start` option to allow writing data at some\nposition past the beginning of the file.\n\nModifying a file rather than replacing it may require a `flags` mode of `r+`\nrather than the default mode `w`.", "short_description": "Returns a new [[streams.WritableStream WriteStream]] object.\n", "ellipsis_description": "Returns a new [[streams.WritableStream WriteStream]] object.\n ...", "line": 1225, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.createWriteStream", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1225", "name": "createWriteStream", "path": "fs.createWriteStream" }, "fs.Stats": { "id": "fs.Stats", "type": "class", "superclass": "fs", "description": "Objects returned from [[fs.stat `fs.stat()`]], [[fs.lstat `fs.lstat()`]], and\n[[fs.fstat `fs.fstat()`]] (and their synchronous counterparts) are of this type.\nThe object contains the following methods:\n\nFor a regular file, `util.inspect(fs.Stats)` returns an object similar to [the\nstructure returned by the Unix stat\ncommand](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html):\n\n { dev: 2114,\n ino: 48064969,\n mode: 33188,\n nlink: 1,\n uid: 85,\n gid: 100,\n rdev: 0,\n size: 527,\n blksize: 4096,\n blocks: 8,\n atime: Mon, 10 Oct 2011 23:24:11 GMT,\n mtime: Mon, 10 Oct 2011 23:24:11 GMT,\n ctime: Mon, 10 Oct 2011 23:24:11 GMT }\n\n\nPlease note that `atime`, `mtime`, and `ctime` are instances of the [[Date]]\nobject, and to compare the values of these objects you should use appropriate\nmethods. For most general uses, `Date.getTime()` returns the number of\nmilliseconds elapsed since _1 January 1970 00:00:00 UTC_, and this integer\nshould be sufficient for any comparison. However, there are additional methods\nwhich can be used for displaying fuzzy information.", "short_description": "Objects returned from [[fs.stat `fs.stat()`]], [[fs.lstat `fs.lstat()`]], and\n[[fs.fstat `fs.fstat()`]] (and their synchronous counterparts) are of this type.\nThe object contains the following methods:\n", "ellipsis_description": "Objects returned from [[fs.stat `fs.stat()`]], [[fs.lstat `fs.lstat()`]], and\n[[fs.fstat `fs.fstat()`]] (and their s...", "line": 1262, "aliases": [], "children": [ { "id": "fs.Stats.isBlockDevice", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices).", "short_description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices).", "ellipsis_description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices). ...", "line": 1289, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isBlockDevice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1289", "name": "isBlockDevice", "path": "fs.Stats.isBlockDevice" }, { "id": "fs.Stats.isCharacterDevice", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices).", "short_description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices).", "ellipsis_description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices). ...", "line": 1298, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isCharacterDevice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1298", "name": "isCharacterDevice", "path": "fs.Stats.isCharacterDevice" }, { "id": "fs.Stats.isDirectory", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a directory.", "short_description": "Indicates if the object is a directory.", "ellipsis_description": "Indicates if the object is a directory. ...", "line": 1280, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isDirectory", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1280", "name": "isDirectory", "path": "fs.Stats.isDirectory" }, { "id": "fs.Stats.isFIFO", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe).", "short_description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe).", "ellipsis_description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe). ...", "line": 1316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isFIFO", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1316", "name": "isFIFO", "path": "fs.Stats.isFIFO" }, { "id": "fs.Stats.isFile", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a file.", "short_description": "Indicates if the object is a file.", "ellipsis_description": "Indicates if the object is a file. ...", "line": 1272, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1272", "name": "isFile", "path": "fs.Stats.isFile" }, { "id": "fs.Stats.isSocket", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket).", "short_description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket).", "ellipsis_description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket). ...", "line": 1326, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isSocket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1326", "name": "isSocket", "path": "fs.Stats.isSocket" }, { "id": "fs.Stats.isSymbolicLink", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`.", "short_description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`.", "ellipsis_description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`. ...", "line": 1307, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isSymbolicLink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1307", "name": "isSymbolicLink", "path": "fs.Stats.isSymbolicLink" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1262", "name": "Stats", "path": "fs.Stats" }, "fs.Stats.isFile": { "id": "fs.Stats.isFile", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a file.", "short_description": "Indicates if the object is a file.", "ellipsis_description": "Indicates if the object is a file. ...", "line": 1272, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1272", "name": "isFile", "path": "fs.Stats.isFile" }, "fs.Stats.isDirectory": { "id": "fs.Stats.isDirectory", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a directory.", "short_description": "Indicates if the object is a directory.", "ellipsis_description": "Indicates if the object is a directory. ...", "line": 1280, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isDirectory", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1280", "name": "isDirectory", "path": "fs.Stats.isDirectory" }, "fs.Stats.isBlockDevice": { "id": "fs.Stats.isBlockDevice", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices).", "short_description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices).", "ellipsis_description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices). ...", "line": 1289, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isBlockDevice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1289", "name": "isBlockDevice", "path": "fs.Stats.isBlockDevice" }, "fs.Stats.isCharacterDevice": { "id": "fs.Stats.isCharacterDevice", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices).", "short_description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices).", "ellipsis_description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices). ...", "line": 1298, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isCharacterDevice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1298", "name": "isCharacterDevice", "path": "fs.Stats.isCharacterDevice" }, "fs.Stats.isSymbolicLink": { "id": "fs.Stats.isSymbolicLink", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`.", "short_description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`.", "ellipsis_description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`. ...", "line": 1307, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isSymbolicLink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1307", "name": "isSymbolicLink", "path": "fs.Stats.isSymbolicLink" }, "fs.Stats.isFIFO": { "id": "fs.Stats.isFIFO", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe).", "short_description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe).", "ellipsis_description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe). ...", "line": 1316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isFIFO", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1316", "name": "isFIFO", "path": "fs.Stats.isFIFO" }, "fs.Stats.isSocket": { "id": "fs.Stats.isSocket", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket).", "short_description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket).", "ellipsis_description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket). ...", "line": 1326, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isSocket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1326", "name": "isSocket", "path": "fs.Stats.isSocket" }, "fs.WriteStream": { "id": "fs.WriteStream", "type": "class", "superclass": "fs", "description": "This is a [[streams.WritableStream WriteStream]], created from the function\n[[fs.createWriteStream `fs.createWriteStream()`]].", "short_description": "This is a [[streams.WritableStream WriteStream]], created from the function\n[[fs.createWriteStream `fs.createWriteStream()`]].", "ellipsis_description": "This is a [[streams.WritableStream WriteStream]], created from the function\n[[fs.createWriteStream `fs.createWriteSt...", "line": 1337, "aliases": [], "children": [ { "id": "fs.WriteStream.bytesWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing.", "short_description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing.", "ellipsis_description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing. ...", "line": 1357, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream.bytesWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1357", "name": "bytesWritten", "path": "fs.WriteStream.bytesWritten" }, { "id": "fs.WriteStream@open", "type": "event", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor used by the `WriteStream`" } ], "description": "Emitted when a file is opened for writing.", "short_description": "Emitted when a file is opened for writing.", "ellipsis_description": "Emitted when a file is opened for writing. ...", "line": 1349, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream@open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1349", "name": "open", "path": "fs.WriteStream.event.open" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1337", "name": "WriteStream", "path": "fs.WriteStream" }, "fs.WriteStream@open": { "id": "fs.WriteStream@open", "type": "event", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor used by the `WriteStream`" } ], "description": "Emitted when a file is opened for writing.", "short_description": "Emitted when a file is opened for writing.", "ellipsis_description": "Emitted when a file is opened for writing. ...", "line": 1349, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream@open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1349", "name": "open", "path": "fs.WriteStream.event.open" }, "fs.WriteStream.bytesWritten": { "id": "fs.WriteStream.bytesWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing.", "short_description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing.", "ellipsis_description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing. ...", "line": 1357, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream.bytesWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1357", "name": "bytesWritten", "path": "fs.WriteStream.bytesWritten" }, "fs.ReadStream": { "id": "fs.ReadStream", "type": "class", "superclass": "fs", "description": "This is a [[streams.ReadableStream streams.ReadableStream]], created from the\nfunction [[fs.createReadStream `fs.createReadStream()`]].", "short_description": "This is a [[streams.ReadableStream streams.ReadableStream]], created from the\nfunction [[fs.createReadStream `fs.createReadStream()`]].", "ellipsis_description": "This is a [[streams.ReadableStream streams.ReadableStream]], created from the\nfunction [[fs.createReadStream `fs.cre...", "line": 1368, "aliases": [], "children": [ { "id": "fs.ReadStream@open", "type": "event", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor used by the `ReadStream`" } ], "description": "Emitted when a file is opened.", "short_description": "Emitted when a file is opened.", "ellipsis_description": "Emitted when a file is opened. ...", "line": 1380, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.ReadStream@open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1380", "name": "open", "path": "fs.ReadStream.event.open" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.ReadStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1368", "name": "ReadStream", "path": "fs.ReadStream" }, "fs.ReadStream@open": { "id": "fs.ReadStream@open", "type": "event", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor used by the `ReadStream`" } ], "description": "Emitted when a file is opened.", "short_description": "Emitted when a file is opened.", "ellipsis_description": "Emitted when a file is opened. ...", "line": 1380, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.ReadStream@open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1380", "name": "open", "path": "fs.ReadStream.event.open" }, "fs.FSWatcher": { "id": "fs.FSWatcher", "type": "class", "superclass": "fs", "description": "Objects returned from [[fs.watch `fs.watch()`]] are of this type. You can\nmonitor any changes that occur on a watched file by listening for the events in\nthis object.", "short_description": "Objects returned from [[fs.watch `fs.watch()`]] are of this type. You can\nmonitor any changes that occur on a watched file by listening for the events in\nthis object.", "ellipsis_description": "Objects returned from [[fs.watch `fs.watch()`]] are of this type. You can\nmonitor any changes that occur on a watche...", "line": 1393, "aliases": [], "children": [ { "id": "fs.FSWatcher.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stop watching for changes on the given `FSWatcher`.", "short_description": "Stop watching for changes on the given `FSWatcher`.", "ellipsis_description": "Stop watching for changes on the given `FSWatcher`. ...", "line": 1403, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1403", "name": "close", "path": "fs.FSWatcher.close" }, { "id": "fs.FSWatcher@change", "type": "event", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "filename", "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event that occured, either `'rename'` or '`change'`" }, { "name": "filename", "types": [ "String" ], "description": "The name of the file which triggered the event" } ], "description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]].", "short_description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]].", "ellipsis_description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]]. ...", "line": 1417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher@change", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1417", "name": "change", "path": "fs.FSWatcher.event.change" }, { "id": "fs.FSWatcher@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception that was caught" } ], "description": "Emitted when an error occurs.", "short_description": "Emitted when an error occurs.", "ellipsis_description": "Emitted when an error occurs. ...", "line": 1427, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1427", "name": "error", "path": "fs.FSWatcher.event.error" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1393", "name": "FSWatcher", "path": "fs.FSWatcher" }, "fs.FSWatcher.close": { "id": "fs.FSWatcher.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stop watching for changes on the given `FSWatcher`.", "short_description": "Stop watching for changes on the given `FSWatcher`.", "ellipsis_description": "Stop watching for changes on the given `FSWatcher`. ...", "line": 1403, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1403", "name": "close", "path": "fs.FSWatcher.close" }, "fs.FSWatcher@change": { "id": "fs.FSWatcher@change", "type": "event", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "filename", "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event that occured, either `'rename'` or '`change'`" }, { "name": "filename", "types": [ "String" ], "description": "The name of the file which triggered the event" } ], "description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]].", "short_description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]].", "ellipsis_description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]]. ...", "line": 1417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher@change", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1417", "name": "change", "path": "fs.FSWatcher.event.change" }, "fs.FSWatcher@error": { "id": "fs.FSWatcher@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception that was caught" } ], "description": "Emitted when an error occurs.", "short_description": "Emitted when an error occurs.", "ellipsis_description": "Emitted when an error occurs. ...", "line": 1427, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1427", "name": "error", "path": "fs.FSWatcher.event.error" }, "Globals": { "id": "Globals", "type": "class", "description": "These objects are available to all modules. Some of these objects aren't\nactually in the global scope, but in the module scope; they'll be noted as such\nbelow.\n\n
\n
__dirname
\n
The name of the directory that the currently executing script resides in.\n__dirname isn't actually on the global scope, but is local to each\nmodule.
\n
For example, if you're running node example.js from /Users/mjr:\n\n
\n    console.log(__dirname);\n    // prints /Users/mjr\n
\n
\n\n
__filename
\n
The filename of the code being executed. This is the resolved absolute path\nof this code file. For a main program this is not necessarily the same filename\nused in the command line. The value inside a module is the path to that module\nfile.
\n
__filename isn't actually on the global scope, but is local to each\nmodule.
\n
For example, if you're running node example.js from /Users/mjr:\n\n
\n    console.log(__filename);\n    // prints /Users/mjr/example.js\n
\n
\n\n
Buffer
\n
Used to handle binary data. See the [[Buffer Buffers]] section for more\ninformation.
\n\n
console
\n
Used to print to stdout and stderr. See the [[console STDIO]] section for\nmore information.
\n\n
exports
\n
An object which is shared between all instances of the current module and\nmade accessible through require().
\n
exports is the same as the module.exports object. See src/node.js for\nmore information.
\n
exports isn't actually on the global scope, but is local to each\nmodule.
\n\n
global
\n
The global namespace object.
\n
In browsers, the top-level scope is the global scope. That means that in\nbrowsers if you're in the global scope var something will define a global\nvariable. In Node.js this is different. The top-level scope is not the global\nscope; var something inside a Node.js module is local only to that\nmodule.
\n\n
module
\n
A reference to the current module. In particular module.exports is the\nsame as the exports object. See src/node.js for more information.
\n
module isn't actually on the global scope, but is local to each\nmodule.
\n\n
process
\n
The process object. See the [process object](process.html) section for more\ninformation.
\n\n
require()
\n
This is necessary to require modules. See the [Modules](modules.html)\nsection for more information.
\n
require isn't actually on the global scope, but is local to each\nmodule.
\n\n
require.cache
\n
Modules are cached in this object when they are required. By deleting a key\nvalue from this object, the next require will reload the module.
\n\n
require.resolve()
\n
Use the internal require() machinery to look up the location of a module,\nbut rather than loading the module, just return the resolved filename.
\n\n
setTimeout(cb, ms)
\nclearTimeout(t)
\nsetInterval(cb, ms)
\nclearInterval(t)
\n
These timer functions are all global variables. See the [[timer Timers]]\nsection for more information.
\n
", "short_description": "These objects are available to all modules. Some of these objects aren't\nactually in the global scope, but in the module scope; they'll be noted as such\nbelow.\n", "ellipsis_description": "These objects are available to all modules. Some of these objects aren't\nactually in the global scope, but in the mo...", "line": 94, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/globals.markdown", "fileName": "globals", "resultingFile": "globals.html#Globals", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/globals.markdown#L94", "name": "Globals", "path": "Globals" }, "http": { "id": "http", "type": "class", "description": "\nThe HTTP interfaces in Node.js are designed to support many features of the\nprotocol which have been traditionally difficult to use. In particular, large,\npossibly chunk-encoded, messages. The interface is careful to never buffer\nentire requests or responses—the user is always able to stream data. To use the\nHTTP server and client, add `require('http')` to your code.\n\nHTTP message headers are represented by an object like this:\n\n { 'content-length': '123',\n 'content-type': 'text/plain',\n 'connection': 'keep-alive',\n 'accept': 'text/plain' }\n\nKeys are lowercased, and values are not modifiable.\n\nIn order to support the full spectrum of possible HTTP applications, Node's HTTP\nAPI is very low-level. It deals with stream handling and message parsing only.\nIt parses a message into headers and body but it does not parse the actual\nheaders or the body.\n\n\nFor more information, read [this article on how to create HTTP\nservers](../nodejs_dev_guide/creating_an_http_server.html).\n\n#### Example: The famous hello world\n\n", "stability": "3 - Stable", "short_description": "\nThe HTTP interfaces in Node.js are designed to support many features of the\nprotocol which have been traditionally difficult to use. In particular, large,\npossibly chunk-encoded, messages. The interface is careful to never buffer\nentire requests or responses—the user is always able to stream data. To use the\nHTTP server and client, add `require('http')` to your code.\n", "ellipsis_description": "\nThe HTTP interfaces in Node.js are designed to support many features of the\nprotocol which have been traditionally ...", "line": 39, "aliases": [], "children": [ { "id": "http.createClient", "type": "class method", "signatures": [ { "args": [ { "name": "port", "optional": true, "types": [ "Number" ] }, { "name": "host", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to", "optional": true }, { "name": "host", "types": [ "String" ], "description": "The hostname to listen to (deprecated)", "optional": true } ], "description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n\nConstructs a new HTTP client. `port` and `host` refer to the server to be\nconnected to.", "short_description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n", "ellipsis_description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.createClient", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L92", "name": "createClient", "path": "http.createClient" }, { "id": "http.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientRequest" ] }, { "name": "response", "type": [ "http.ClientResponse" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientRequest" ] }, { "name": "response", "type": [ "http.ClientResponse" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "http.Server" } ] } ], "arguments": [ { "name": "function", "types": [ "Function" ], "description": "A callback that is automatically added to the `'request'` event" }, { "name": "request", "types": [ "http.ClientRequest" ], "description": "Any options you want to pass to the server" }, { "name": "response", "types": [ "http.ClientResponse" ], "description": "An optional listener" } ], "description": "Returns a new web server object.", "short_description": "Returns a new web server object.", "ellipsis_description": "Returns a new web server object. ...", "line": 78, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L78", "name": "createServer", "path": "http.createServer" }, { "id": "http.get", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" } ], "description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n\n#### Example\n\n var options = {\n host: 'www.google.com',\n port: 80,\n path: '/index.html'\n };\n\n http.get(options, function(res) {\n console.log(\"Got response: \" + res.statusCode);\n }).on('error', function(e) {\n console.log(\"Got error: \" + e.message);\n });", "short_description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n", "ellipsis_description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference b...", "line": 68, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.get", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L68", "name": "get", "path": "http.get" }, { "id": "http.globalAgent", "type": "class property", "signatures": [ { "returns": [ { "type": "http.Agent" } ] } ], "description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests.", "short_description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests.", "ellipsis_description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests. ...", "line": 103, "aliases": [], "children": [ { "id": "http.globalAgent.requests", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "short_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "ellipsis_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!** ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent.requests", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L114", "name": "requests", "path": "http.globalAgent.requests" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L103", "name": "globalAgent", "path": "http.globalAgent" }, { "id": "http.request", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "response", "type": [ "http.ClientRequest" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "response", "type": [ "http.ClientRequest" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "http.ClientRequest" } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" }, { "name": "response", "types": [ "http.ClientRequest" ], "description": "The server's response, including headers and status code" } ], "description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently issue requests.\n\nThe `options` align with the return value of [[url.parse `url.parse()`]]:\n\n- `host`: a domain name or IP address of the server to issue the request to.\nDefaults to `'localhost'`.\n- `hostname`: To support `url.parse()`, `hostname` is preferred over `host`\n- `port`: the port of the remote server. Defaults to `80`.\n- `socketPath`: the Unix Domain Socket (in other words, use either `host:port`\nor `socketPath`)\n- `method`: a string specifying the HTTP request method. Defaults to `'GET'`.\n- `path`: the request path. Defaults to `'/'`. This should include a query\nstring (if any) For example, `'/index.html?page=12'`\n- `headers`: an object containing request headers\n- `auth`: used for basic authentication. For example, `'user:password'` computes\nan Authorization header.\n- `agent`: this controls [[http.Agent `http.Agent`]] behavior. When an Agent is\nused, the request defaults to `Connection: keep-alive`. The possible values are:\n -- `undefined`: uses [[http.globalAgent the global agent]] for this host\n and port (default).\n -- `Agent` object: explicitly use the passed in `Agent`\n -- `false`: opt out of connection pooling with an `Agent`, and default the\nrequest to `Connection: close`.\n\nThere are a few special headers that should be noted.\n\n* Sending a `'Connection: keep-alive'` notifies Node.js that the connection to\nthe server should be persisted until the next request.\n\n* Sending a `'Content-length'` header disables the default chunked encoding.\n\n* Sending an 'Expect' header immediately sends the request headers.\n Usually, when sending `'Expect: 100-continue'`, you should both set a timeout\n and listen for the `continue` event. For more information, see [RFC2616\nSection 8.2.3](http://tools.ietf.org/html/rfc2616#section-8.2.3).\n\n* Sending an Authorization header overrides using the `auth` option to compute\nbasic authentication.\n\n#### Example\n\n var options = {\n host: 'www.google.com',\n port: 80,\n path: '/upload',\n method: 'POST'\n };\n\n var req = http.request(options, function(res) {\n console.log('STATUS: ' + res.statusCode);\n console.log('HEADERS: ' + JSON.stringify(res.headers));\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n });\n\n req.on('error', function(e) {\n console.log('problem with request: ' + e.message);\n });\n\n // write data to request body\n req.write('data\\n');\n req.write('data\\n');\n req.end();\n\nNote that in the example, `req.end()` was called. With `http.request()` one must\nalways call `req.end()` to signify that you're done with the request—even if\nthere is no data being written to the request body.\n\n#### Returns\n\nAn instance of the `http.ClientRequest` class. The `ClientRequest` instance is a\nwritable stream. If one needs to upload a file with a POST request, then write\nit to the `ClientRequest` object.\n\nIf any error is encountered during the request (be that with DNS resolution, TCP\nlevel errors, or actual HTTP parse errors) an `'error'` event is emitted on the\nreturned request object.", "short_description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently issue requests.\n", "ellipsis_description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently is...", "line": 208, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L208", "name": "request", "path": "http.request" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http", "subclasses": [ "http.Agent", "http.Server", "http.ServerRequest", "http.ServerResponse", "http.ClientRequest", "http.ClientResponse" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L39", "name": "http", "path": "http" }, "http.get": { "id": "http.get", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" } ], "description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n\n#### Example\n\n var options = {\n host: 'www.google.com',\n port: 80,\n path: '/index.html'\n };\n\n http.get(options, function(res) {\n console.log(\"Got response: \" + res.statusCode);\n }).on('error', function(e) {\n console.log(\"Got error: \" + e.message);\n });", "short_description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n", "ellipsis_description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference b...", "line": 68, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.get", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L68", "name": "get", "path": "http.get" }, "http.createServer": { "id": "http.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientRequest" ] }, { "name": "response", "type": [ "http.ClientResponse" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientRequest" ] }, { "name": "response", "type": [ "http.ClientResponse" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "http.Server" } ] } ], "arguments": [ { "name": "function", "types": [ "Function" ], "description": "A callback that is automatically added to the `'request'` event" }, { "name": "request", "types": [ "http.ClientRequest" ], "description": "Any options you want to pass to the server" }, { "name": "response", "types": [ "http.ClientResponse" ], "description": "An optional listener" } ], "description": "Returns a new web server object.", "short_description": "Returns a new web server object.", "ellipsis_description": "Returns a new web server object. ...", "line": 78, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L78", "name": "createServer", "path": "http.createServer" }, "http.createClient": { "id": "http.createClient", "type": "class method", "signatures": [ { "args": [ { "name": "port", "optional": true, "types": [ "Number" ] }, { "name": "host", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to", "optional": true }, { "name": "host", "types": [ "String" ], "description": "The hostname to listen to (deprecated)", "optional": true } ], "description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n\nConstructs a new HTTP client. `port` and `host` refer to the server to be\nconnected to.", "short_description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n", "ellipsis_description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.createClient", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L92", "name": "createClient", "path": "http.createClient" }, "http.globalAgent": { "id": "http.globalAgent", "type": "class property", "signatures": [ { "returns": [ { "type": "http.Agent" } ] } ], "description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests.", "short_description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests.", "ellipsis_description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests. ...", "line": 103, "aliases": [], "children": [ { "id": "http.globalAgent.requests", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "short_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "ellipsis_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!** ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent.requests", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L114", "name": "requests", "path": "http.globalAgent.requests" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L103", "name": "globalAgent", "path": "http.globalAgent" }, "http.globalAgent.requests": { "id": "http.globalAgent.requests", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "short_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "ellipsis_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!** ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent.requests", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L114", "name": "requests", "path": "http.globalAgent.requests" }, "http.request": { "id": "http.request", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "response", "type": [ "http.ClientRequest" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "response", "type": [ "http.ClientRequest" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "http.ClientRequest" } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" }, { "name": "response", "types": [ "http.ClientRequest" ], "description": "The server's response, including headers and status code" } ], "description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently issue requests.\n\nThe `options` align with the return value of [[url.parse `url.parse()`]]:\n\n- `host`: a domain name or IP address of the server to issue the request to.\nDefaults to `'localhost'`.\n- `hostname`: To support `url.parse()`, `hostname` is preferred over `host`\n- `port`: the port of the remote server. Defaults to `80`.\n- `socketPath`: the Unix Domain Socket (in other words, use either `host:port`\nor `socketPath`)\n- `method`: a string specifying the HTTP request method. Defaults to `'GET'`.\n- `path`: the request path. Defaults to `'/'`. This should include a query\nstring (if any) For example, `'/index.html?page=12'`\n- `headers`: an object containing request headers\n- `auth`: used for basic authentication. For example, `'user:password'` computes\nan Authorization header.\n- `agent`: this controls [[http.Agent `http.Agent`]] behavior. When an Agent is\nused, the request defaults to `Connection: keep-alive`. The possible values are:\n -- `undefined`: uses [[http.globalAgent the global agent]] for this host\n and port (default).\n -- `Agent` object: explicitly use the passed in `Agent`\n -- `false`: opt out of connection pooling with an `Agent`, and default the\nrequest to `Connection: close`.\n\nThere are a few special headers that should be noted.\n\n* Sending a `'Connection: keep-alive'` notifies Node.js that the connection to\nthe server should be persisted until the next request.\n\n* Sending a `'Content-length'` header disables the default chunked encoding.\n\n* Sending an 'Expect' header immediately sends the request headers.\n Usually, when sending `'Expect: 100-continue'`, you should both set a timeout\n and listen for the `continue` event. For more information, see [RFC2616\nSection 8.2.3](http://tools.ietf.org/html/rfc2616#section-8.2.3).\n\n* Sending an Authorization header overrides using the `auth` option to compute\nbasic authentication.\n\n#### Example\n\n var options = {\n host: 'www.google.com',\n port: 80,\n path: '/upload',\n method: 'POST'\n };\n\n var req = http.request(options, function(res) {\n console.log('STATUS: ' + res.statusCode);\n console.log('HEADERS: ' + JSON.stringify(res.headers));\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n });\n\n req.on('error', function(e) {\n console.log('problem with request: ' + e.message);\n });\n\n // write data to request body\n req.write('data\\n');\n req.write('data\\n');\n req.end();\n\nNote that in the example, `req.end()` was called. With `http.request()` one must\nalways call `req.end()` to signify that you're done with the request—even if\nthere is no data being written to the request body.\n\n#### Returns\n\nAn instance of the `http.ClientRequest` class. The `ClientRequest` instance is a\nwritable stream. If one needs to upload a file with a POST request, then write\nit to the `ClientRequest` object.\n\nIf any error is encountered during the request (be that with DNS resolution, TCP\nlevel errors, or actual HTTP parse errors) an `'error'` event is emitted on the\nreturned request object.", "short_description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently issue requests.\n", "ellipsis_description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently is...", "line": 208, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L208", "name": "request", "path": "http.request" }, "http.Agent": { "id": "http.Agent", "type": "class", "superclass": "http", "description": "Starting with Node.js version 0.5.3, there's a new implementation of the HTTP\nAgent which is used for pooling sockets used in HTTP client requests.\n\nPreviously, a single agent instance help the pool for single host+port. The\ncurrent implementation now holds sockets for any number of hosts.\n\nThe current HTTP Agent also defaults client requests to using\n`Connection:keep-alive`. If no pending HTTP requests are waiting on a socket to\nbecome free ,the socket is closed. This means that Node's pool has the benefit\nof keep-alive when under load but still does not require developers to manually\nclose the HTTP clients using keep-alive.\n\nSockets are removed from the agent's pool when the socket emits either a\n`'close'` event or a special `'agentRemove'` event. This means that if you\nintend to keep one HTTP request open for a long time and don't want it to stay\nin the pool you can do something along the lines of:\n\n http.get(options, function(res) {\n // Do stuff\n }).on(\"socket\", function (socket) {\n socket.emit(\"agentRemove\");\n });\n\nAlternatively, you could just opt out of pooling entirely using `agent:false`:\n\n\n http.get({host:'localhost', port:80, path:'/', agent:false}, function (res)\n{\n // Do stuff\n });", "short_description": "Starting with Node.js version 0.5.3, there's a new implementation of the HTTP\nAgent which is used for pooling sockets used in HTTP client requests.\n", "ellipsis_description": "Starting with Node.js version 0.5.3, there's a new implementation of the HTTP\nAgent which is used for pooling socket...", "line": 249, "aliases": [], "children": [ { "id": "http.Agent.maxSockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "short_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "ellipsis_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5. ...", "line": 260, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent.maxSockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L260", "name": "maxSockets", "path": "http.Agent.maxSockets" }, { "id": "http.Agent.sockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "short_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "ellipsis_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!** ...", "line": 270, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent.sockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L270", "name": "sockets", "path": "http.Agent.sockets" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L249", "name": "Agent", "path": "http.Agent" }, "http.Agent.maxSockets": { "id": "http.Agent.maxSockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "short_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "ellipsis_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5. ...", "line": 260, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent.maxSockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L260", "name": "maxSockets", "path": "http.Agent.maxSockets" }, "http.Agent.sockets": { "id": "http.Agent.sockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "short_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "ellipsis_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!** ...", "line": 270, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent.sockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L270", "name": "sockets", "path": "http.Agent.sockets" }, "http.Server": { "id": "http.Server", "type": "class", "superclass": "http", "description": "A representation of the server within the `http` module. To create an HTTP\nserver, you'll need to first call [[http.createServer `http.createServer()`]],\nwith something like this:\n\n\n\nThis object is also an [[eventemitter `eventemitter`]].\n\nFor more information, read [this article on how to create HTTP\nservers](../nodejs_dev_guide/creating_an_http_server.html).", "short_description": "A representation of the server within the `http` module. To create an HTTP\nserver, you'll need to first call [[http.createServer `http.createServer()`]],\nwith something like this:\n", "ellipsis_description": "A representation of the server within the `http` module. To create an HTTP\nserver, you'll need to first call [[http....", "line": 287, "aliases": [], "children": [ { "id": "http.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Server.close)\n\nStops the server from accepting new connections.", "short_description": "(related to: net.Server.close)\n", "ellipsis_description": "(related to: net.Server.close)\n ...", "line": 406, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L406", "name": "close", "path": "http.Server.close" }, { "id": "http.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to" }, { "name": "hostname", "types": [ "String" ], "description": "The hostname to listen to" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the server has been bound to the port (related to: net.Server.listen)" } ], "description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n\nThis function is asynchronous. The `callback()` is added as a listener for the\n[[net.Server@listening `net.Server@listening`]] event.", "short_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n", "ellipsis_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts conne...", "line": 394, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L394", "name": "listen", "path": "http.Server.listen" }, { "id": "http.Server@checkContinue", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of `http.ServerRequest`" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of `http.ServerResponse`" } ], "description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n\nHandling this event involves calling `response.writeContinue` if the client\nshould continue to send the request body, or generating an appropriate HTTP\nresponse (_e.g._ `400 Bad Request`) if the client should not continue to send\nthe request body.\n\nNote: When this event is emitted and handled, the `request` event is not be emitted.", "short_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n", "ellipsis_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the s...", "line": 342, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@checkContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L342", "name": "checkContinue", "path": "http.Server.event.checkContinue" }, { "id": "http.Server@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception being thrown" } ], "description": "If a client connection emits an `'error'` event, it's forwarded here.", "short_description": "If a client connection emits an `'error'` event, it's forwarded here.", "ellipsis_description": "If a client connection emits an `'error'` event, it's forwarded here. ...", "line": 372, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L372", "name": "clientError", "path": "http.Server.event.clientError" }, { "id": "http.Server@close", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 321, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L321", "name": "close", "path": "http.Server.event.close" }, { "id": "http.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "short_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "ellipsis_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also b...", "line": 311, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L311", "name": "connection", "path": "http.Server.event.connection" }, { "id": "http.Server@request", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of [[http.ServerRequest]]" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of [[http.ServerResponse]]" } ], "description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "short_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "ellipsis_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple reques...", "line": 298, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L298", "name": "request", "path": "http.Server.event.request" }, { "id": "http.Server@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "socket", "types": [ "Number" ] }, { "name": "head", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "The arguments for the http request, as it is in the request event" }, { "name": "socket", "types": [ "Number" ], "description": "The network socket between the server and client" }, { "name": "head", "types": [ "Buffer" ], "description": "The first packet of the upgraded stream; this can be empty" } ], "description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n\nAfter this event is emitted, the request's socket won't have a `data` event\nlistener, meaning you will need to bind to it in order to handle data sent to\nthe server on that socket.", "short_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n", "ellipsis_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upg...", "line": 361, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L361", "name": "upgrade", "path": "http.Server.event.upgrade" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L287", "name": "Server", "path": "http.Server" }, "http.Server@request": { "id": "http.Server@request", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of [[http.ServerRequest]]" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of [[http.ServerResponse]]" } ], "description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "short_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "ellipsis_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple reques...", "line": 298, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L298", "name": "request", "path": "http.Server.event.request" }, "http.Server@connection": { "id": "http.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "short_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "ellipsis_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also b...", "line": 311, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L311", "name": "connection", "path": "http.Server.event.connection" }, "http.Server@close": { "id": "http.Server@close", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 321, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L321", "name": "close", "path": "http.Server.event.close" }, "http.Server@checkContinue": { "id": "http.Server@checkContinue", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of `http.ServerRequest`" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of `http.ServerResponse`" } ], "description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n\nHandling this event involves calling `response.writeContinue` if the client\nshould continue to send the request body, or generating an appropriate HTTP\nresponse (_e.g._ `400 Bad Request`) if the client should not continue to send\nthe request body.\n\nNote: When this event is emitted and handled, the `request` event is not be emitted.", "short_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n", "ellipsis_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the s...", "line": 342, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@checkContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L342", "name": "checkContinue", "path": "http.Server.event.checkContinue" }, "http.Server@upgrade": { "id": "http.Server@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "socket", "types": [ "Number" ] }, { "name": "head", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "The arguments for the http request, as it is in the request event" }, { "name": "socket", "types": [ "Number" ], "description": "The network socket between the server and client" }, { "name": "head", "types": [ "Buffer" ], "description": "The first packet of the upgraded stream; this can be empty" } ], "description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n\nAfter this event is emitted, the request's socket won't have a `data` event\nlistener, meaning you will need to bind to it in order to handle data sent to\nthe server on that socket.", "short_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n", "ellipsis_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upg...", "line": 361, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L361", "name": "upgrade", "path": "http.Server.event.upgrade" }, "http.Server@clientError": { "id": "http.Server@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception being thrown" } ], "description": "If a client connection emits an `'error'` event, it's forwarded here.", "short_description": "If a client connection emits an `'error'` event, it's forwarded here.", "ellipsis_description": "If a client connection emits an `'error'` event, it's forwarded here. ...", "line": 372, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L372", "name": "clientError", "path": "http.Server.event.clientError" }, "http.Server.listen": { "id": "http.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to" }, { "name": "hostname", "types": [ "String" ], "description": "The hostname to listen to" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the server has been bound to the port (related to: net.Server.listen)" } ], "description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n\nThis function is asynchronous. The `callback()` is added as a listener for the\n[[net.Server@listening `net.Server@listening`]] event.", "short_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n", "ellipsis_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts conne...", "line": 394, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L394", "name": "listen", "path": "http.Server.listen" }, "http.Server.close": { "id": "http.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Server.close)\n\nStops the server from accepting new connections.", "short_description": "(related to: net.Server.close)\n", "ellipsis_description": "(related to: net.Server.close)\n ...", "line": 406, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L406", "name": "close", "path": "http.Server.close" }, "http.ServerRequest": { "id": "http.ServerRequest", "type": "class", "superclass": "http", "description": "This object is created internally by an HTTP server—not by the user—and passed\nas the first argument to a `'request'` listener.\n\nThe request implements the [[streams.ReadableStream Readable Stream]] interface;\nit is also an [[eventemitter `eventemitter`]] with the following events:", "short_description": "This object is created internally by an HTTP server—not by the user—and passed\nas the first argument to a `'request'` listener.\n", "ellipsis_description": "This object is created internally by an HTTP server—not by the user—and passed\nas the first argument to a `'request'...", "line": 420, "aliases": [], "children": [ { "id": "http.ServerRequest.connection", "type": "class property", "signatures": [ { "returns": [ { "type": "net.Socket" } ] } ], "description": "The `net.Socket` object associated with the connection.\n\nWith HTTPS support, use `request.connection.verifyPeer()` and\n`request.connection.getPeerCertificate()` to obtain the client's authentication\ndetails.", "short_description": "The `net.Socket` object associated with the connection.\n", "ellipsis_description": "The `net.Socket` object associated with the connection.\n ...", "line": 587, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L587", "name": "connection", "path": "http.ServerRequest.connection" }, { "id": "http.ServerRequest.headers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Returns the request header.\n\n\n\n\nread-only", "short_description": "Returns the request header.\n", "ellipsis_description": "Returns the request header.\n ...", "line": 516, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.headers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L516", "name": "headers", "path": "http.ServerRequest.headers" }, { "id": "http.ServerRequest.httpVersion", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first integer and `request.httpVersionMinor`\nis the second.", "short_description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first integer and `request.httpVersionMinor`\nis the second.", "ellipsis_description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first intege...", "line": 540, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.httpVersion", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L540", "name": "httpVersion", "path": "http.ServerRequest.httpVersion" }, { "id": "http.ServerRequest.method", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The request method as a string, like `'GET'` or `'DELETE'`.", "short_description": "The request method as a string, like `'GET'` or `'DELETE'`.", "ellipsis_description": "The request method as a string, like `'GET'` or `'DELETE'`. ...", "line": 474, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.method", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L474", "name": "method", "path": "http.ServerRequest.method" }, { "id": "http.ServerRequest.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses request from emitting events. Useful to throttle back an upload.", "short_description": "Pauses request from emitting events. Useful to throttle back an upload.", "ellipsis_description": "Pauses request from emitting events. Useful to throttle back an upload. ...", "line": 562, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L562", "name": "pause", "path": "http.ServerRequest.pause" }, { "id": "http.ServerRequest.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes a paused request.", "short_description": "Resumes a paused request.", "ellipsis_description": "Resumes a paused request. ...", "line": 572, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L572", "name": "resume", "path": "http.ServerRequest.resume" }, { "id": "http.ServerRequest.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use, either `'utf8'` or `'binary'`", "optional": true } ], "description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object.", "short_description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object.", "ellipsis_description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object. ...", "line": 553, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L553", "name": "setEncoding", "path": "http.ServerRequest.setEncoding" }, { "id": "http.ServerRequest.trailers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n\n\n\n\nread-only", "short_description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n", "ellipsis_description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n ...", "line": 527, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.trailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L527", "name": "trailers", "path": "http.ServerRequest.trailers" }, { "id": "http.ServerRequest.url", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the request is:\n\n GET /status?name=ryan HTTP/1.1\\r\\n\n Accept: text/plain\\r\\n\n \\r\\n\n\nThen `request.url` becomes:\n\n '/status?name=ryan'\n\n#### Example\n\nIf you would like to parse the URL into its parts, you can use\n`require('url').parse(request.url)`. For example:\n\n\n\nIf you would like to extract the params from the query string, you can use\n[[querystring.parse `require('querystring').parse()`]], or pass `true` as the\nsecond argument to `require('url').parse`. For example:\n\n\n\n\nread-only", "short_description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the request is:\n", "ellipsis_description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the reques...", "line": 505, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.url", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L505", "name": "url", "path": "http.ServerRequest.url" }, { "id": "http.ServerRequest@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n\nJust like `'end'`, this event occurs only once per request, and no more `'data'`\nevents will fire afterwards.\n\nNote: `'close'` can fire after `'end'`, but not vice versa.\n\n\nread-only", "short_description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n", "ellipsis_description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n ...", "line": 463, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L463", "name": "close", "path": "http.ServerRequest.event.close" }, { "id": "http.ServerRequest@data", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "String" ], "description": "The data that's received (as a string)" } ], "description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http.ServerRequest.setEncoding\n`request.setEncoding()`]], otherwise it's a [Buffer](buffer.html).\n\nNote that the **data will be lost** if there is no listener when a\n`ServerRequest` emits a `'data'` event.", "short_description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http.ServerRequest.setEncoding\n`request.setEncoding()`]], otherwise it's a [Buffer](buffer.html).\n", "ellipsis_description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http....", "line": 436, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L436", "name": "data", "path": "http.ServerRequest.event.data" }, { "id": "http.ServerRequest@end", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request.", "short_description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request.", "ellipsis_description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request. ...", "line": 448, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L448", "name": "end", "path": "http.ServerRequest.event.end" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L420", "name": "ServerRequest", "path": "http.ServerRequest" }, "http.ServerRequest@data": { "id": "http.ServerRequest@data", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "String" ], "description": "The data that's received (as a string)" } ], "description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http.ServerRequest.setEncoding\n`request.setEncoding()`]], otherwise it's a [Buffer](buffer.html).\n\nNote that the **data will be lost** if there is no listener when a\n`ServerRequest` emits a `'data'` event.", "short_description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http.ServerRequest.setEncoding\n`request.setEncoding()`]], otherwise it's a [Buffer](buffer.html).\n", "ellipsis_description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http....", "line": 436, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L436", "name": "data", "path": "http.ServerRequest.event.data" }, "http.ServerRequest@end": { "id": "http.ServerRequest@end", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request.", "short_description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request.", "ellipsis_description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request. ...", "line": 448, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L448", "name": "end", "path": "http.ServerRequest.event.end" }, "http.ServerRequest@close": { "id": "http.ServerRequest@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n\nJust like `'end'`, this event occurs only once per request, and no more `'data'`\nevents will fire afterwards.\n\nNote: `'close'` can fire after `'end'`, but not vice versa.\n\n\nread-only", "short_description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n", "ellipsis_description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n ...", "line": 463, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L463", "name": "close", "path": "http.ServerRequest.event.close" }, "http.ServerRequest.method": { "id": "http.ServerRequest.method", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The request method as a string, like `'GET'` or `'DELETE'`.", "short_description": "The request method as a string, like `'GET'` or `'DELETE'`.", "ellipsis_description": "The request method as a string, like `'GET'` or `'DELETE'`. ...", "line": 474, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.method", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L474", "name": "method", "path": "http.ServerRequest.method" }, "http.ServerRequest.url": { "id": "http.ServerRequest.url", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the request is:\n\n GET /status?name=ryan HTTP/1.1\\r\\n\n Accept: text/plain\\r\\n\n \\r\\n\n\nThen `request.url` becomes:\n\n '/status?name=ryan'\n\n#### Example\n\nIf you would like to parse the URL into its parts, you can use\n`require('url').parse(request.url)`. For example:\n\n\n\nIf you would like to extract the params from the query string, you can use\n[[querystring.parse `require('querystring').parse()`]], or pass `true` as the\nsecond argument to `require('url').parse`. For example:\n\n\n\n\nread-only", "short_description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the request is:\n", "ellipsis_description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the reques...", "line": 505, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.url", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L505", "name": "url", "path": "http.ServerRequest.url" }, "http.ServerRequest.headers": { "id": "http.ServerRequest.headers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Returns the request header.\n\n\n\n\nread-only", "short_description": "Returns the request header.\n", "ellipsis_description": "Returns the request header.\n ...", "line": 516, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.headers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L516", "name": "headers", "path": "http.ServerRequest.headers" }, "http.ServerRequest.trailers": { "id": "http.ServerRequest.trailers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n\n\n\n\nread-only", "short_description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n", "ellipsis_description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n ...", "line": 527, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.trailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L527", "name": "trailers", "path": "http.ServerRequest.trailers" }, "http.ServerRequest.httpVersion": { "id": "http.ServerRequest.httpVersion", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first integer and `request.httpVersionMinor`\nis the second.", "short_description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first integer and `request.httpVersionMinor`\nis the second.", "ellipsis_description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first intege...", "line": 540, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.httpVersion", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L540", "name": "httpVersion", "path": "http.ServerRequest.httpVersion" }, "http.ServerRequest.setEncoding": { "id": "http.ServerRequest.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use, either `'utf8'` or `'binary'`", "optional": true } ], "description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object.", "short_description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object.", "ellipsis_description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object. ...", "line": 553, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L553", "name": "setEncoding", "path": "http.ServerRequest.setEncoding" }, "http.ServerRequest.pause": { "id": "http.ServerRequest.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses request from emitting events. Useful to throttle back an upload.", "short_description": "Pauses request from emitting events. Useful to throttle back an upload.", "ellipsis_description": "Pauses request from emitting events. Useful to throttle back an upload. ...", "line": 562, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L562", "name": "pause", "path": "http.ServerRequest.pause" }, "http.ServerRequest.resume": { "id": "http.ServerRequest.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes a paused request.", "short_description": "Resumes a paused request.", "ellipsis_description": "Resumes a paused request. ...", "line": 572, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L572", "name": "resume", "path": "http.ServerRequest.resume" }, "http.ServerRequest.connection": { "id": "http.ServerRequest.connection", "type": "class property", "signatures": [ { "returns": [ { "type": "net.Socket" } ] } ], "description": "The `net.Socket` object associated with the connection.\n\nWith HTTPS support, use `request.connection.verifyPeer()` and\n`request.connection.getPeerCertificate()` to obtain the client's authentication\ndetails.", "short_description": "The `net.Socket` object associated with the connection.\n", "ellipsis_description": "The `net.Socket` object associated with the connection.\n ...", "line": 587, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L587", "name": "connection", "path": "http.ServerRequest.connection" }, "http.ServerResponse": { "id": "http.ServerResponse", "type": "class", "superclass": "http", "description": "This object is created internally by a HTTP server—not by the user. It is passed\nas the second parameter to the `'request'` event. It is a\n[[streams.WritableStream `Writable Stream`]].", "short_description": "This object is created internally by a HTTP server—not by the user. It is passed\nas the second parameter to the `'request'` event. It is a\n[[streams.WritableStream `Writable Stream`]].", "ellipsis_description": "This object is created internally by a HTTP server—not by the user. It is passed\nas the second parameter to the `'re...", "line": 599, "aliases": [], "children": [ { "id": "http.ServerResponse.addTrailers", "type": "class method", "signatures": [ { "args": [ { "name": "headers", "types": [ "String" ] } ] } ], "arguments": [ { "name": "headers", "types": [ "String" ], "description": "The trailing header to add" } ], "description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n\nTrailers are only emitted if chunked encoding is used for the response; if it is\nnot (_e.g._ if the request was `'HTTP/1.0'`), they are silently discarded.\n\n#### Example\n\nHTTP requires the `Trailer` header to be sent if you intend to emit trailers,\nwith a list of the header fields in its value. For example:\n\n response.writeHead(200, { 'Content-Type': 'text/plain',\n 'Trailer': 'Content-MD5' });\n response.write(fileData);\n response.addTrailers({'Content-MD5': \"7895bf4b8828b55ceaf47747b4bca667\"});\n response.end();", "short_description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n", "ellipsis_description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n ...", "line": 768, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.addTrailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L768", "name": "addTrailers", "path": "http.ServerResponse.addTrailers" }, { "id": "http.ServerResponse.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "Some data to write before finishing", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding for the data", "optional": true } ], "description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consider this message complete. `response.end()`\n**must** be called on each response.\n\nIf `data` is specified, it is equivalent to calling `response.write(data,\nencoding)` followed by `response.end()`.", "short_description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consider this message complete. `response.end()`\n**must** be called on each response.\n", "ellipsis_description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consid...", "line": 787, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L787", "name": "end", "path": "http.ServerResponse.end" }, { "id": "http.ServerResponse.getHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The name of the header to retrieve" } ], "description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. This can only be called before headers get\nimplicitly flushed.\n\n#### Example\n\n var stringContentType = response.getHeader('content-type');", "short_description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. This can only be called before headers get\nimplicitly flushed.\n", "ellipsis_description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. ...", "line": 702, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.getHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L702", "name": "getHeader", "path": "http.ServerResponse.getHeader" }, { "id": "http.ServerResponse.removeHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The header to remove" } ], "description": "Removes a header that's queued for implicit sending.\n\n#### Example\n\n response.removeHeader(\"Content-Encoding\");", "short_description": "Removes a header that's queued for implicit sending.\n", "ellipsis_description": "Removes a header that's queued for implicit sending.\n ...", "line": 717, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.removeHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L717", "name": "removeHeader", "path": "http.ServerResponse.removeHeader" }, { "id": "http.ServerResponse.setHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] }, { "name": "value", "types": [ "String" ] } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The name of the header to set" }, { "name": "value", "types": [ "String" ], "description": "The value to set" } ], "description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value is replaced. Use an array of strings here\nif you need to send multiple headers with the same name.\n\n#### Examples\n\n response.setHeader(\"Content-Type\", \"text/html\");\n\n response.setHeader(\"Set-Cookie\", [\"type=ninja\", \"language=javascript\"]);", "short_description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value is replaced. Use an array of strings here\nif you need to send multiple headers with the same name.\n", "ellipsis_description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value ...", "line": 685, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.setHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L685", "name": "setHeader", "path": "http.ServerResponse.setHeader" }, { "id": "http.ServerResponse.statusCode", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code that will be send to the client when the\nheaders get flushed; for example: `response.statusCode = 404;`.\n\nAfter the response header is sent to the client, this property indicates the\nstatus code which was sent out.", "short_description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code that will be send to the client when the\nheaders get flushed; for example: `response.statusCode = 404;`.\n", "ellipsis_description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code ...", "line": 665, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.statusCode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L665", "name": "statusCode", "path": "http.ServerResponse.statusCode" }, { "id": "http.ServerResponse.write", "type": "class method", "signatures": [ { "args": [ { "name": "chunk", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "String", "Buffer" ], "description": "A string or buffer to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (if `chunk` is a string)", "optional": true } ], "description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and flush the implicit headers.\n\nThis sends a chunk of the response body. This method may be called multiple\ntimes to provide successive parts of the body.\n\nNote: This is the raw HTTP body and has nothing to do with higher-level multi-part body encodings that may be used.\n\nThe first time `response.write()` is called, it sends the buffered header\ninformation and the first body to the client. The second time `response.write()`\nis called, Node.js assumes you're going to be streaming data, and sends that\nseparately. That is, the response is buffered up to the first chunk of body.", "short_description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and flush the implicit headers.\n", "ellipsis_description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and fl...", "line": 741, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L741", "name": "write", "path": "http.ServerResponse.write" }, { "id": "http.ServerResponse.writeContinue", "type": "class method", "signatures": [ { "args": [] } ], "description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more information, see the\n[[http.Server@checkContinue `http.Server@checkContinue`]] event.", "short_description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more information, see the\n[[http.Server@checkContinue `http.Server@checkContinue`]] event.", "ellipsis_description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more in...", "line": 622, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.writeContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L622", "name": "writeContinue", "path": "http.ServerResponse.writeContinue" }, { "id": "http.ServerResponse.writeHead", "type": "class method", "signatures": [ { "args": [ { "name": "statusCode", "types": [ "Number" ] }, { "name": "reasonPhrase", "optional": true, "types": [ "String" ] }, { "name": "headers", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "statusCode", "types": [ "Number" ], "description": "The 3-digit HTTP status code, like `404`" }, { "name": "reasonPhrase", "types": [ "String" ], "description": "A human-readable string describing the status", "optional": true }, { "name": "headers", "types": [ "Object" ], "description": "Any response headers", "optional": true } ], "description": "Sends a response header to the request.\n\nThis method must only be called once on a message and it must be called before\n`response.end()` is called.\n\nIf you call `response.write()` or `response.end()` before calling this, the\nimplicit/mutable headers will be calculated and call this function for you.\n\n#### Example\n\n var body = 'hello world';\n response.writeHead(200, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain' });\n\nNote: `Content-Length` is given in bytes, not characters. The above example works because the string `'hello world'` contains only single byte characters. If the body contains higher coded characters then `Buffer.byteLength()` should be used to determine the number of bytes in a given encoding. Node.js does not check whether `Content-Length` and the length of the body which has been transmitted are equal or not.", "short_description": "Sends a response header to the request.\n", "ellipsis_description": "Sends a response header to the request.\n ...", "line": 649, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.writeHead", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L649", "name": "writeHead", "path": "http.ServerResponse.writeHead" }, { "id": "http.ServerResponse@close", "type": "event", "signatures": [ { "args": [] } ], "description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or able to flush.", "short_description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or able to flush.", "ellipsis_description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or abl...", "line": 610, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L610", "name": "close", "path": "http.ServerResponse.event.close" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L599", "name": "ServerResponse", "path": "http.ServerResponse" }, "http.ServerResponse@close": { "id": "http.ServerResponse@close", "type": "event", "signatures": [ { "args": [] } ], "description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or able to flush.", "short_description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or able to flush.", "ellipsis_description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or abl...", "line": 610, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L610", "name": "close", "path": "http.ServerResponse.event.close" }, "http.ServerResponse.writeContinue": { "id": "http.ServerResponse.writeContinue", "type": "class method", "signatures": [ { "args": [] } ], "description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more information, see the\n[[http.Server@checkContinue `http.Server@checkContinue`]] event.", "short_description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more information, see the\n[[http.Server@checkContinue `http.Server@checkContinue`]] event.", "ellipsis_description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more in...", "line": 622, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.writeContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L622", "name": "writeContinue", "path": "http.ServerResponse.writeContinue" }, "http.ServerResponse.writeHead": { "id": "http.ServerResponse.writeHead", "type": "class method", "signatures": [ { "args": [ { "name": "statusCode", "types": [ "Number" ] }, { "name": "reasonPhrase", "optional": true, "types": [ "String" ] }, { "name": "headers", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "statusCode", "types": [ "Number" ], "description": "The 3-digit HTTP status code, like `404`" }, { "name": "reasonPhrase", "types": [ "String" ], "description": "A human-readable string describing the status", "optional": true }, { "name": "headers", "types": [ "Object" ], "description": "Any response headers", "optional": true } ], "description": "Sends a response header to the request.\n\nThis method must only be called once on a message and it must be called before\n`response.end()` is called.\n\nIf you call `response.write()` or `response.end()` before calling this, the\nimplicit/mutable headers will be calculated and call this function for you.\n\n#### Example\n\n var body = 'hello world';\n response.writeHead(200, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain' });\n\nNote: `Content-Length` is given in bytes, not characters. The above example works because the string `'hello world'` contains only single byte characters. If the body contains higher coded characters then `Buffer.byteLength()` should be used to determine the number of bytes in a given encoding. Node.js does not check whether `Content-Length` and the length of the body which has been transmitted are equal or not.", "short_description": "Sends a response header to the request.\n", "ellipsis_description": "Sends a response header to the request.\n ...", "line": 649, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.writeHead", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L649", "name": "writeHead", "path": "http.ServerResponse.writeHead" }, "http.ServerResponse.statusCode": { "id": "http.ServerResponse.statusCode", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code that will be send to the client when the\nheaders get flushed; for example: `response.statusCode = 404;`.\n\nAfter the response header is sent to the client, this property indicates the\nstatus code which was sent out.", "short_description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code that will be send to the client when the\nheaders get flushed; for example: `response.statusCode = 404;`.\n", "ellipsis_description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code ...", "line": 665, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.statusCode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L665", "name": "statusCode", "path": "http.ServerResponse.statusCode" }, "http.ServerResponse.setHeader": { "id": "http.ServerResponse.setHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] }, { "name": "value", "types": [ "String" ] } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The name of the header to set" }, { "name": "value", "types": [ "String" ], "description": "The value to set" } ], "description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value is replaced. Use an array of strings here\nif you need to send multiple headers with the same name.\n\n#### Examples\n\n response.setHeader(\"Content-Type\", \"text/html\");\n\n response.setHeader(\"Set-Cookie\", [\"type=ninja\", \"language=javascript\"]);", "short_description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value is replaced. Use an array of strings here\nif you need to send multiple headers with the same name.\n", "ellipsis_description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value ...", "line": 685, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.setHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L685", "name": "setHeader", "path": "http.ServerResponse.setHeader" }, "http.ServerResponse.getHeader": { "id": "http.ServerResponse.getHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The name of the header to retrieve" } ], "description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. This can only be called before headers get\nimplicitly flushed.\n\n#### Example\n\n var stringContentType = response.getHeader('content-type');", "short_description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. This can only be called before headers get\nimplicitly flushed.\n", "ellipsis_description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. ...", "line": 702, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.getHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L702", "name": "getHeader", "path": "http.ServerResponse.getHeader" }, "http.ServerResponse.removeHeader": { "id": "http.ServerResponse.removeHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The header to remove" } ], "description": "Removes a header that's queued for implicit sending.\n\n#### Example\n\n response.removeHeader(\"Content-Encoding\");", "short_description": "Removes a header that's queued for implicit sending.\n", "ellipsis_description": "Removes a header that's queued for implicit sending.\n ...", "line": 717, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.removeHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L717", "name": "removeHeader", "path": "http.ServerResponse.removeHeader" }, "http.ServerResponse.write": { "id": "http.ServerResponse.write", "type": "class method", "signatures": [ { "args": [ { "name": "chunk", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "String", "Buffer" ], "description": "A string or buffer to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (if `chunk` is a string)", "optional": true } ], "description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and flush the implicit headers.\n\nThis sends a chunk of the response body. This method may be called multiple\ntimes to provide successive parts of the body.\n\nNote: This is the raw HTTP body and has nothing to do with higher-level multi-part body encodings that may be used.\n\nThe first time `response.write()` is called, it sends the buffered header\ninformation and the first body to the client. The second time `response.write()`\nis called, Node.js assumes you're going to be streaming data, and sends that\nseparately. That is, the response is buffered up to the first chunk of body.", "short_description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and flush the implicit headers.\n", "ellipsis_description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and fl...", "line": 741, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L741", "name": "write", "path": "http.ServerResponse.write" }, "http.ServerResponse.addTrailers": { "id": "http.ServerResponse.addTrailers", "type": "class method", "signatures": [ { "args": [ { "name": "headers", "types": [ "String" ] } ] } ], "arguments": [ { "name": "headers", "types": [ "String" ], "description": "The trailing header to add" } ], "description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n\nTrailers are only emitted if chunked encoding is used for the response; if it is\nnot (_e.g._ if the request was `'HTTP/1.0'`), they are silently discarded.\n\n#### Example\n\nHTTP requires the `Trailer` header to be sent if you intend to emit trailers,\nwith a list of the header fields in its value. For example:\n\n response.writeHead(200, { 'Content-Type': 'text/plain',\n 'Trailer': 'Content-MD5' });\n response.write(fileData);\n response.addTrailers({'Content-MD5': \"7895bf4b8828b55ceaf47747b4bca667\"});\n response.end();", "short_description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n", "ellipsis_description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n ...", "line": 768, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.addTrailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L768", "name": "addTrailers", "path": "http.ServerResponse.addTrailers" }, "http.ServerResponse.end": { "id": "http.ServerResponse.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "Some data to write before finishing", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding for the data", "optional": true } ], "description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consider this message complete. `response.end()`\n**must** be called on each response.\n\nIf `data` is specified, it is equivalent to calling `response.write(data,\nencoding)` followed by `response.end()`.", "short_description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consider this message complete. `response.end()`\n**must** be called on each response.\n", "ellipsis_description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consid...", "line": 787, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L787", "name": "end", "path": "http.ServerResponse.end" }, "http.ClientRequest": { "id": "http.ClientRequest", "type": "class", "superclass": "http", "description": "This object is created internally and returned from [[http.request\n`http.request()`]]. It represents an _in-progress_ request whose header has\nalready been queued. The header is still mutable using the `setHeader(name,\nvalue)`, `getHeader(name)`, and `removeHeader(name)` methods. The actual header\nwill be sent along with the first data chunk or when closing the connection.\nThis is both a [[streams.WritableStream `Writable Stream`]] and an\n[[eventemitter `EventEmitter`]].\n\nTo get the response, add a listener for `'response'` to the request object.\n`'response'` will be emitted from the request object when the response headers\nhave been received. The `'response'` event is executed with one argument which\nis an instance of `http.ClientResponse`.\n\nNote: Node.js does not check whether `Content-Length`and the length of the body which has been transmitted are equal or not.\n\nDuring the `'response'` event, one can add listeners to the response object,\nparticularly to listen for the `'data'` event. Note that the `'response'` event\nis called before any part of the response body is received, so there is no need\nto worry about racing to catch the first part of the body. As long as a listener\nfor `'data'` is added during the `'response'` event, the entire body will be\ncaught.\n\n#### Example\n\n // Good\n request.on('response', function (response) {\n response.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n });\n\n // Bad - misses all or part of the body\n request.on('response', function (response) {\n setTimeout(function () {\n response.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n }, 10);\n });", "short_description": "This object is created internally and returned from [[http.request\n`http.request()`]]. It represents an _in-progress_ request whose header has\nalready been queued. The header is still mutable using the `setHeader(name,\nvalue)`, `getHeader(name)`, and `removeHeader(name)` methods. The actual header\nwill be sent along with the first data chunk or when closing the connection.\nThis is both a [[streams.WritableStream `Writable Stream`]] and an\n[[eventemitter `EventEmitter`]].\n", "ellipsis_description": "This object is created internally and returned from [[http.request\n`http.request()`]]. It represents an _in-progres...", "line": 836, "aliases": [], "children": [ { "id": "http.ClientRequest.abort", "type": "class method", "signatures": [ { "args": [] } ], "description": "Aborts a request, since NOde.js version 0.3.8.", "short_description": "Aborts a request, since NOde.js version 0.3.8.", "ellipsis_description": "Aborts a request, since NOde.js version 0.3.8. ...", "line": 938, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.abort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L938", "name": "abort", "path": "http.ClientRequest.abort" }, { "id": "http.ClientRequest.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to send at the end", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use for the data", "optional": true } ], "description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request is chunked, this will send the terminating\n`'0\\r\\n\\r\\n'`.\n\nIf `data` is specified, it is equivalent to calling `request.write(data,\nencoding)` followed by `request.end()`.", "short_description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request is chunked, this will send the terminating\n`'0\\r\\n\\r\\n'`.\n", "ellipsis_description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request ...", "line": 927, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L927", "name": "end", "path": "http.ClientRequest.end" }, { "id": "http.ClientRequest.setNoDelay", "type": "class method", "signatures": [ { "args": [ { "name": "noDelay", "default_value": true, "optional": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "noDelay", "types": [ "Boolean" ], "description": "If `true`, then the data is fired off immediately each time the socket is written", "optional": true } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is c...", "line": 963, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setNoDelay", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L963", "name": "setNoDelay", "path": "http.ClientRequest.setNoDelay" }, { "id": "http.ClientRequest.setSocketKeepAlive", "type": "class method", "signatures": [ { "args": [ { "name": "enable", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "initialDelay", "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "enable", "types": [ "Boolean" ], "description": "If `true`, then keep-alive funcitonality is set", "optional": true }, { "name": "initalDelay", "types": [ "Number" ], "description": "Sets the initial delay before the first keep-alive probe is sent on an idle socket" } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] ...", "line": 977, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setSocketKeepAlive", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L977", "name": "setSocketKeepAlive", "path": "http.ClientRequest.setSocketKeepAlive" }, { "id": "http.ClientRequest.setTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeout", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "timeout", "types": [ "Number" ], "description": "The timeout length, in milliseconds" }, { "name": "callback", "types": [ "Function" ], "description": "An optional function to execute once the timeout completes", "optional": true } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is c...", "line": 951, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L951", "name": "setTimeout", "path": "http.ClientRequest.setTimeout" }, { "id": "http.ClientRequest.write", "type": "class method", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Array" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Array" ], "description": "An array of integers or a string to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding of the chunk (only needed if it's a string)", "optional": true } ], "description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in that case, it's suggested you use the\n`['Transfer-Encoding', 'chunked']` header line when creating the request.", "short_description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in that case, it's suggested you use the\n`['Transfer-Encoding', 'chunked']` header line when creating the request.", "ellipsis_description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in tha...", "line": 910, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L910", "name": "write", "path": "http.ClientRequest.write" }, { "id": "http.ClientRequest@continue", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-continue'`. This is an instruction that the\nclient should send the request body.", "short_description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-continue'`. This is an instruction that the\nclient should send the request body.", "ellipsis_description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-...", "line": 895, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@continue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L895", "name": "continue", "path": "http.ClientRequest.event.continue" }, { "id": "http.ClientRequest@response", "type": "event", "signatures": [ { "args": [ { "name": "response", "types": [ "http.ClientResponse" ] } ] } ], "arguments": [ { "name": "response", "types": [ "http.ClientResponse" ], "description": "An instance of `http.ClientResponse`" } ], "description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n\nOptions include:\n\n- host: a domain name or IP address of the server to issue the request to\n- port: the port of remote server\n- socketPath: Unix Domain Socket (use either `host:port` or `socketPath`)", "short_description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n", "ellipsis_description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n ...", "line": 854, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@response", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L854", "name": "response", "path": "http.ClientRequest.event.response" }, { "id": "http.ClientRequest@socket", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "The assigned socket" } ], "description": "Emitted after a socket is assigned to this request.", "short_description": "Emitted after a socket is assigned to this request.", "ellipsis_description": "Emitted after a socket is assigned to this request. ...", "line": 865, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@socket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L865", "name": "socket", "path": "http.ClientRequest.event.socket" }, { "id": "http.ClientRequest@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "response", "types": [ "http.ClientResponse" ] }, { "name": "socket", "types": [ "net.Socket" ] }, { "name": "head", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "response", "types": [ "http.ClientResponse" ], "description": "The client's response" }, { "name": "socket", "types": [ "net.Socket" ], "description": "The assigned socket" }, { "name": "head", "types": [ "Object" ], "description": "The upgrade header" } ], "description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients receiving an upgrade header will have their\nconnections closed.\n\n#### Example\n\n", "short_description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients receiving an upgrade header will have their\nconnections closed.\n", "ellipsis_description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients re...", "line": 883, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L883", "name": "upgrade", "path": "http.ClientRequest.event.upgrade" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L836", "name": "ClientRequest", "path": "http.ClientRequest" }, "http.ClientRequest@response": { "id": "http.ClientRequest@response", "type": "event", "signatures": [ { "args": [ { "name": "response", "types": [ "http.ClientResponse" ] } ] } ], "arguments": [ { "name": "response", "types": [ "http.ClientResponse" ], "description": "An instance of `http.ClientResponse`" } ], "description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n\nOptions include:\n\n- host: a domain name or IP address of the server to issue the request to\n- port: the port of remote server\n- socketPath: Unix Domain Socket (use either `host:port` or `socketPath`)", "short_description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n", "ellipsis_description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n ...", "line": 854, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@response", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L854", "name": "response", "path": "http.ClientRequest.event.response" }, "http.ClientRequest@socket": { "id": "http.ClientRequest@socket", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "The assigned socket" } ], "description": "Emitted after a socket is assigned to this request.", "short_description": "Emitted after a socket is assigned to this request.", "ellipsis_description": "Emitted after a socket is assigned to this request. ...", "line": 865, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@socket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L865", "name": "socket", "path": "http.ClientRequest.event.socket" }, "http.ClientRequest@upgrade": { "id": "http.ClientRequest@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "response", "types": [ "http.ClientResponse" ] }, { "name": "socket", "types": [ "net.Socket" ] }, { "name": "head", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "response", "types": [ "http.ClientResponse" ], "description": "The client's response" }, { "name": "socket", "types": [ "net.Socket" ], "description": "The assigned socket" }, { "name": "head", "types": [ "Object" ], "description": "The upgrade header" } ], "description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients receiving an upgrade header will have their\nconnections closed.\n\n#### Example\n\n", "short_description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients receiving an upgrade header will have their\nconnections closed.\n", "ellipsis_description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients re...", "line": 883, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L883", "name": "upgrade", "path": "http.ClientRequest.event.upgrade" }, "http.ClientRequest@continue": { "id": "http.ClientRequest@continue", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-continue'`. This is an instruction that the\nclient should send the request body.", "short_description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-continue'`. This is an instruction that the\nclient should send the request body.", "ellipsis_description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-...", "line": 895, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@continue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L895", "name": "continue", "path": "http.ClientRequest.event.continue" }, "http.ClientRequest.write": { "id": "http.ClientRequest.write", "type": "class method", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Array" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Array" ], "description": "An array of integers or a string to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding of the chunk (only needed if it's a string)", "optional": true } ], "description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in that case, it's suggested you use the\n`['Transfer-Encoding', 'chunked']` header line when creating the request.", "short_description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in that case, it's suggested you use the\n`['Transfer-Encoding', 'chunked']` header line when creating the request.", "ellipsis_description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in tha...", "line": 910, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L910", "name": "write", "path": "http.ClientRequest.write" }, "http.ClientRequest.end": { "id": "http.ClientRequest.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to send at the end", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use for the data", "optional": true } ], "description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request is chunked, this will send the terminating\n`'0\\r\\n\\r\\n'`.\n\nIf `data` is specified, it is equivalent to calling `request.write(data,\nencoding)` followed by `request.end()`.", "short_description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request is chunked, this will send the terminating\n`'0\\r\\n\\r\\n'`.\n", "ellipsis_description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request ...", "line": 927, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L927", "name": "end", "path": "http.ClientRequest.end" }, "http.ClientRequest.abort": { "id": "http.ClientRequest.abort", "type": "class method", "signatures": [ { "args": [] } ], "description": "Aborts a request, since NOde.js version 0.3.8.", "short_description": "Aborts a request, since NOde.js version 0.3.8.", "ellipsis_description": "Aborts a request, since NOde.js version 0.3.8. ...", "line": 938, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.abort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L938", "name": "abort", "path": "http.ClientRequest.abort" }, "http.ClientRequest.setTimeout": { "id": "http.ClientRequest.setTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeout", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "timeout", "types": [ "Number" ], "description": "The timeout length, in milliseconds" }, { "name": "callback", "types": [ "Function" ], "description": "An optional function to execute once the timeout completes", "optional": true } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is c...", "line": 951, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L951", "name": "setTimeout", "path": "http.ClientRequest.setTimeout" }, "http.ClientRequest.setNoDelay": { "id": "http.ClientRequest.setNoDelay", "type": "class method", "signatures": [ { "args": [ { "name": "noDelay", "default_value": true, "optional": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "noDelay", "types": [ "Boolean" ], "description": "If `true`, then the data is fired off immediately each time the socket is written", "optional": true } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is c...", "line": 963, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setNoDelay", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L963", "name": "setNoDelay", "path": "http.ClientRequest.setNoDelay" }, "http.ClientRequest.setSocketKeepAlive": { "id": "http.ClientRequest.setSocketKeepAlive", "type": "class method", "signatures": [ { "args": [ { "name": "enable", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "initialDelay", "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "enable", "types": [ "Boolean" ], "description": "If `true`, then keep-alive funcitonality is set", "optional": true }, { "name": "initalDelay", "types": [ "Number" ], "description": "Sets the initial delay before the first keep-alive probe is sent on an idle socket" } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] ...", "line": 977, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setSocketKeepAlive", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L977", "name": "setSocketKeepAlive", "path": "http.ClientRequest.setSocketKeepAlive" }, "http.ClientResponse": { "id": "http.ClientResponse", "type": "class", "superclass": "http", "description": "This object is created when making a request with [[http.request\n`http.request()`]]. It is passed to the `'response'` event of the request\nobject.\n\nThe response implements the [[streams.ReadableStream `Readable Stream`]]\ninterface.", "short_description": "This object is created when making a request with [[http.request\n`http.request()`]]. It is passed to the `'response'` event of the request\nobject.\n", "ellipsis_description": "This object is created when making a request with [[http.request\n`http.request()`]]. It is passed to the `'response'...", "line": 991, "aliases": [], "children": [ { "id": "http.ClientResponse.header", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The response headers object.", "short_description": "The response headers object.", "ellipsis_description": "The response headers object. ...", "line": 1058, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.header", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1058", "name": "header", "path": "http.ClientResponse.header" }, { "id": "http.ClientResponse.httpVersion", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the first integer and `response.httpVersionMinor`\nis the second.", "short_description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the first integer and `response.httpVersionMinor`\nis the second.", "ellipsis_description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the f...", "line": 1049, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.httpVersion", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1049", "name": "httpVersion", "path": "http.ClientResponse.httpVersion" }, { "id": "http.ClientResponse.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the response from emitting events. Useful to throttle back a download.", "short_description": "Pauses the response from emitting events. Useful to throttle back a download.", "ellipsis_description": "Pauses the response from emitting events. Useful to throttle back a download. ...", "line": 1090, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1090", "name": "pause", "path": "http.ClientResponse.pause" }, { "id": "http.ClientResponse.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes a paused response.", "short_description": "Resumes a paused response.", "ellipsis_description": "Resumes a paused response. ...", "line": 1097, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1097", "name": "resume", "path": "http.ClientResponse.resume" }, { "id": "http.ClientResponse.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use. Defaults to `null`, which means that the `'data'` event will emit a `Buffer` object.", "optional": true } ], "description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`.", "short_description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`.", "ellipsis_description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`. ...", "line": 1081, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1081", "name": "setEncoding", "path": "http.ClientResponse.setEncoding" }, { "id": "http.ClientResponse.statusCode", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c.", "short_description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c.", "ellipsis_description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c. ...", "line": 1037, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.statusCode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1037", "name": "statusCode", "path": "http.ClientResponse.statusCode" }, { "id": "http.ClientResponse.trailers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The response trailers object. Only populated after the `end` event.", "short_description": "The response trailers object. Only populated after the `end` event.", "ellipsis_description": "The response trailers object. Only populated after the `end` event. ...", "line": 1068, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.trailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1068", "name": "trailers", "path": "http.ClientResponse.trailers" }, { "id": "http.ClientResponse@close", "type": "event", "signatures": [ { "args": [ { "name": "err", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "err", "types": [ "Error" ], "description": "The error object" } ], "description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n\nFor more information, see [[http.ServerRequest]]'s `'close'` event.", "short_description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n", "ellipsis_description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n ...", "line": 1027, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1027", "name": "close", "path": "http.ClientResponse.event.close" }, { "id": "http.ClientResponse@data", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Buffer" ], "description": "The data received" } ], "description": "Emitted when a piece of the message body is received.", "short_description": "Emitted when a piece of the message body is received.", "ellipsis_description": "Emitted when a piece of the message body is received. ...", "line": 1002, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1002", "name": "data", "path": "http.ClientResponse.event.data" }, { "id": "http.ClientResponse@end", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Buffer" ], "description": "The data received" } ], "description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response.", "short_description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response.", "ellipsis_description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response. ...", "line": 1014, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1014", "name": "end", "path": "http.ClientResponse.event.end" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L991", "name": "ClientResponse", "path": "http.ClientResponse" }, "http.ClientResponse@data": { "id": "http.ClientResponse@data", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Buffer" ], "description": "The data received" } ], "description": "Emitted when a piece of the message body is received.", "short_description": "Emitted when a piece of the message body is received.", "ellipsis_description": "Emitted when a piece of the message body is received. ...", "line": 1002, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1002", "name": "data", "path": "http.ClientResponse.event.data" }, "http.ClientResponse@end": { "id": "http.ClientResponse@end", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Buffer" ], "description": "The data received" } ], "description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response.", "short_description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response.", "ellipsis_description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response. ...", "line": 1014, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1014", "name": "end", "path": "http.ClientResponse.event.end" }, "http.ClientResponse@close": { "id": "http.ClientResponse@close", "type": "event", "signatures": [ { "args": [ { "name": "err", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "err", "types": [ "Error" ], "description": "The error object" } ], "description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n\nFor more information, see [[http.ServerRequest]]'s `'close'` event.", "short_description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n", "ellipsis_description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n ...", "line": 1027, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1027", "name": "close", "path": "http.ClientResponse.event.close" }, "http.ClientResponse.statusCode": { "id": "http.ClientResponse.statusCode", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c.", "short_description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c.", "ellipsis_description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c. ...", "line": 1037, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.statusCode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1037", "name": "statusCode", "path": "http.ClientResponse.statusCode" }, "http.ClientResponse.httpVersion": { "id": "http.ClientResponse.httpVersion", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the first integer and `response.httpVersionMinor`\nis the second.", "short_description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the first integer and `response.httpVersionMinor`\nis the second.", "ellipsis_description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the f...", "line": 1049, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.httpVersion", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1049", "name": "httpVersion", "path": "http.ClientResponse.httpVersion" }, "http.ClientResponse.header": { "id": "http.ClientResponse.header", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The response headers object.", "short_description": "The response headers object.", "ellipsis_description": "The response headers object. ...", "line": 1058, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.header", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1058", "name": "header", "path": "http.ClientResponse.header" }, "http.ClientResponse.trailers": { "id": "http.ClientResponse.trailers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The response trailers object. Only populated after the `end` event.", "short_description": "The response trailers object. Only populated after the `end` event.", "ellipsis_description": "The response trailers object. Only populated after the `end` event. ...", "line": 1068, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.trailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1068", "name": "trailers", "path": "http.ClientResponse.trailers" }, "http.ClientResponse.setEncoding": { "id": "http.ClientResponse.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use. Defaults to `null`, which means that the `'data'` event will emit a `Buffer` object.", "optional": true } ], "description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`.", "short_description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`.", "ellipsis_description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`. ...", "line": 1081, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1081", "name": "setEncoding", "path": "http.ClientResponse.setEncoding" }, "http.ClientResponse.pause": { "id": "http.ClientResponse.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the response from emitting events. Useful to throttle back a download.", "short_description": "Pauses the response from emitting events. Useful to throttle back a download.", "ellipsis_description": "Pauses the response from emitting events. Useful to throttle back a download. ...", "line": 1090, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1090", "name": "pause", "path": "http.ClientResponse.pause" }, "http.ClientResponse.resume": { "id": "http.ClientResponse.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes a paused response.", "short_description": "Resumes a paused response.", "ellipsis_description": "Resumes a paused response. ...", "line": 1097, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1097", "name": "resume", "path": "http.ClientResponse.resume" }, "https": { "id": "https", "type": "class", "description": "\nHTTPS is the HTTP protocol over TLS/SSL. In Node.js, this is implemented as a\nseparate module. To use this module, include `require('https')` in your code.\n\nCreating HTTPS servers is somewhat complicated and requires generating\ncertificates.\n\n #### Examples\n\n\n\nOr, with pfx:\n\n", "stability": "3 - Stable", "short_description": "\nHTTPS is the HTTP protocol over TLS/SSL. In Node.js, this is implemented as a\nseparate module. To use this module, include `require('https')` in your code.\n", "ellipsis_description": "\nHTTPS is the HTTP protocol over TLS/SSL. In Node.js, this is implemented as a\nseparate module. To use this module, ...", "line": 21, "aliases": [], "children": [ { "id": "https.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientResponse" ] }, { "name": "response" } ], "callback": true, "optional": true, "types": [ "http.ClientRequest" ] } ], "callback": { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientResponse" ] }, { "name": "response" } ], "callback": true, "optional": true, "types": [ "http.ClientRequest" ] }, "returns": [ { "type": "https.Server" } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "request", "types": [ "http.ClientRequest" ], "description": "Any options you want to pass to the server" }, { "name": "response", "types": [ "http.ClientResponse" ], "description": "An optional listener (related to: tls.createServer)" } ], "description": "Returns a new HTTPS web server object.\n\nThe `options` object has a mix of required and optional values:\n\n - `key`: A string or `Buffer` containing the private key of the server in a\nPEM format. (Required)\n - `cert`: A string or `Buffer` containing the certificate key of the server in\na PEM format. (Required)\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simplier: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `passphrase`: A string of a passphrase for the private key.\n\n - `rejectUnauthorized`: If `true` the server rejects any connection that is\nnot authorized with the list of supplied CAs. This option only has an effect if\n`requestCert` is `true`. This defaults to `false`.\n\n - `requestCert`: If `true` the server requests a certificate from clients that\nconnect and attempt to verify that certificate. This defaults to `false`.\n\n - `sessionIdContext`: A string containing an opaque identifier for session\nresumption. If `requestCert` is `true`, the default is an MD5 hash value\ngenerated from the command line. Otherwise, the default is not provided.\n\n - `SNICallback`: A function that is called if the client supports the SNI TLS\nextension. Only one argument will be passed to it: `servername`. `SNICallback`\nshould return a SecureContext instance. You can use\n`crypto.createCredentials(...).context` to get a proper SecureContext. If\n`SNICallback` wasn't provided, a default callback within the high-level API is\nused (for more information, see below).", "short_description": "Returns a new HTTPS web server object.\n", "ellipsis_description": "Returns a new HTTPS web server object.\n ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L71", "name": "createServer", "path": "https.createServer" }, { "id": "https.get", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" } ], "description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n\nSince most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n\n#### Example\n\n", "short_description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n", "ellipsis_description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n ...", "line": 176, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.get", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L176", "name": "get", "path": "https.get" }, { "id": "https.globalAgent", "type": "class property", "signatures": [ { "returns": [ { "type": "https.Agent" } ] } ], "description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests.", "short_description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests.", "ellipsis_description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests. ...", "line": 184, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.globalAgent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L184", "name": "globalAgent", "path": "https.globalAgent" }, { "id": "https.request", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute" } ], "description": "Makes a request to a secure web server.\n\nAll options from [http.request `httprequest()`]] are valid for `options`:\n\n- host: a domain name or IP address of the server to issue the request to.\nDefaults to `'localhost'`.\n- hostname: this supports `url.parse()`; `hostname` is preferred over `host`\n- port: the port of the remote server. Defaults to `80`.\n- socketPath: the Unix Domain Socket (use either `host:port` or `socketPath`)\n- method: a string specifying the HTTP request method. Defaults to `'GET'`.\n- path: the request path. Defaults to `'/'`. This should include a query string\n(if any) For example, `'/index.html?page=12'`\n- headers: an object containing request headers\n- auth: used for basic authentication. For example, `'user:password'` computes\nan Authorization header.\n- agent: this controls [[https.Agent `https.Agent`]] behavior. When an Agent is\nused, the request defaults to `Connection: keep-alive`. The possible values are:\n - `undefined`: uses [[http.globalAgent globalAgent]] for this host\n and port (default).\n - `Agent` object: this explicitlys use the passed in `Agent`\n - `false`: this opts out of connection pooling with an Agent, and defaults the\nrequest to `Connection: close`.\n\nThe following options from [tls.connect()](tls.html#tls.connect) can also be\nspecified. However, a [[http.globalAgent globalAgent]] silently ignores these.\n\n - `pfx`: Certificate, private key, and CA certificates to use for SSL. The\n default is `null`.\n\n - `key`: A string or `Buffer` containing the private key of the client in aPEM\nformat. The default is `null`.\n\n - `passphrase`: A string of a passphrase for the private key or pfx. The\n default is `null`.\n\n - `cert`: A string or `Buffer` containing the certificate key of the client in\na PEM format; in other words, the public x509 certificate to use. The default is\n`null`.\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n#### Example\n\n\n\nHere's an example specifying these options using a custom `Agent`:\n\n var options = {\n host: 'encrypted.google.com',\n port: 443,\n path: '/',\n method: 'GET',\n key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')\n };\n options.agent = new https.Agent(options);\n\n var req = https.request(options, function(res) {\n ...\n }\n\nOr, if you choose not to use an `Agent`:\n\n var options = {\n host: 'encrypted.google.com',\n port: 443,\n path: '/',\n method: 'GET',\n key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),\n agent: false\n };\n\n var req = https.request(options, function(res) {\n ...\n }", "short_description": "Makes a request to a secure web server.\n", "ellipsis_description": "Makes a request to a secure web server.\n ...", "line": 158, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L158", "name": "request", "path": "https.request" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https", "subclasses": [ "https.Agent", "https.Server" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L21", "name": "https", "path": "https" }, "https.createServer": { "id": "https.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientResponse" ] }, { "name": "response" } ], "callback": true, "optional": true, "types": [ "http.ClientRequest" ] } ], "callback": { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientResponse" ] }, { "name": "response" } ], "callback": true, "optional": true, "types": [ "http.ClientRequest" ] }, "returns": [ { "type": "https.Server" } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "request", "types": [ "http.ClientRequest" ], "description": "Any options you want to pass to the server" }, { "name": "response", "types": [ "http.ClientResponse" ], "description": "An optional listener (related to: tls.createServer)" } ], "description": "Returns a new HTTPS web server object.\n\nThe `options` object has a mix of required and optional values:\n\n - `key`: A string or `Buffer` containing the private key of the server in a\nPEM format. (Required)\n - `cert`: A string or `Buffer` containing the certificate key of the server in\na PEM format. (Required)\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simplier: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `passphrase`: A string of a passphrase for the private key.\n\n - `rejectUnauthorized`: If `true` the server rejects any connection that is\nnot authorized with the list of supplied CAs. This option only has an effect if\n`requestCert` is `true`. This defaults to `false`.\n\n - `requestCert`: If `true` the server requests a certificate from clients that\nconnect and attempt to verify that certificate. This defaults to `false`.\n\n - `sessionIdContext`: A string containing an opaque identifier for session\nresumption. If `requestCert` is `true`, the default is an MD5 hash value\ngenerated from the command line. Otherwise, the default is not provided.\n\n - `SNICallback`: A function that is called if the client supports the SNI TLS\nextension. Only one argument will be passed to it: `servername`. `SNICallback`\nshould return a SecureContext instance. You can use\n`crypto.createCredentials(...).context` to get a proper SecureContext. If\n`SNICallback` wasn't provided, a default callback within the high-level API is\nused (for more information, see below).", "short_description": "Returns a new HTTPS web server object.\n", "ellipsis_description": "Returns a new HTTPS web server object.\n ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L71", "name": "createServer", "path": "https.createServer" }, "https.request": { "id": "https.request", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute" } ], "description": "Makes a request to a secure web server.\n\nAll options from [http.request `httprequest()`]] are valid for `options`:\n\n- host: a domain name or IP address of the server to issue the request to.\nDefaults to `'localhost'`.\n- hostname: this supports `url.parse()`; `hostname` is preferred over `host`\n- port: the port of the remote server. Defaults to `80`.\n- socketPath: the Unix Domain Socket (use either `host:port` or `socketPath`)\n- method: a string specifying the HTTP request method. Defaults to `'GET'`.\n- path: the request path. Defaults to `'/'`. This should include a query string\n(if any) For example, `'/index.html?page=12'`\n- headers: an object containing request headers\n- auth: used for basic authentication. For example, `'user:password'` computes\nan Authorization header.\n- agent: this controls [[https.Agent `https.Agent`]] behavior. When an Agent is\nused, the request defaults to `Connection: keep-alive`. The possible values are:\n - `undefined`: uses [[http.globalAgent globalAgent]] for this host\n and port (default).\n - `Agent` object: this explicitlys use the passed in `Agent`\n - `false`: this opts out of connection pooling with an Agent, and defaults the\nrequest to `Connection: close`.\n\nThe following options from [tls.connect()](tls.html#tls.connect) can also be\nspecified. However, a [[http.globalAgent globalAgent]] silently ignores these.\n\n - `pfx`: Certificate, private key, and CA certificates to use for SSL. The\n default is `null`.\n\n - `key`: A string or `Buffer` containing the private key of the client in aPEM\nformat. The default is `null`.\n\n - `passphrase`: A string of a passphrase for the private key or pfx. The\n default is `null`.\n\n - `cert`: A string or `Buffer` containing the certificate key of the client in\na PEM format; in other words, the public x509 certificate to use. The default is\n`null`.\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n#### Example\n\n\n\nHere's an example specifying these options using a custom `Agent`:\n\n var options = {\n host: 'encrypted.google.com',\n port: 443,\n path: '/',\n method: 'GET',\n key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')\n };\n options.agent = new https.Agent(options);\n\n var req = https.request(options, function(res) {\n ...\n }\n\nOr, if you choose not to use an `Agent`:\n\n var options = {\n host: 'encrypted.google.com',\n port: 443,\n path: '/',\n method: 'GET',\n key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),\n agent: false\n };\n\n var req = https.request(options, function(res) {\n ...\n }", "short_description": "Makes a request to a secure web server.\n", "ellipsis_description": "Makes a request to a secure web server.\n ...", "line": 158, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L158", "name": "request", "path": "https.request" }, "https.get": { "id": "https.get", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" } ], "description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n\nSince most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n\n#### Example\n\n", "short_description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n", "ellipsis_description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n ...", "line": 176, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.get", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L176", "name": "get", "path": "https.get" }, "https.globalAgent": { "id": "https.globalAgent", "type": "class property", "signatures": [ { "returns": [ { "type": "https.Agent" } ] } ], "description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests.", "short_description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests.", "ellipsis_description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests. ...", "line": 184, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.globalAgent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L184", "name": "globalAgent", "path": "https.globalAgent" }, "https.Agent": { "id": "https.Agent", "type": "class", "superclass": "https", "description": "An `Agent` object for HTTPS, similar to [[http.Agent `http.Agent`]]. For more\ninformation, see [[https.request `https.request()`]].", "short_description": "An `Agent` object for HTTPS, similar to [[http.Agent `http.Agent`]]. For more\ninformation, see [[https.request `https.request()`]].", "ellipsis_description": "An `Agent` object for HTTPS, similar to [[http.Agent `http.Agent`]]. For more\ninformation, see [[https.request `http...", "line": 194, "aliases": [], "children": [ { "id": "https.Agent.maxSockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "short_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "ellipsis_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5. ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent.maxSockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L202", "name": "maxSockets", "path": "https.Agent.maxSockets" }, { "id": "https.Agent.sockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "short_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "ellipsis_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!** ...", "line": 210, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent.sockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L210", "name": "sockets", "path": "https.Agent.sockets" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L194", "name": "Agent", "path": "https.Agent" }, "https.Agent.maxSockets": { "id": "https.Agent.maxSockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "short_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "ellipsis_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5. ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent.maxSockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L202", "name": "maxSockets", "path": "https.Agent.maxSockets" }, "https.Agent.sockets": { "id": "https.Agent.sockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "short_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "ellipsis_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!** ...", "line": 210, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent.sockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L210", "name": "sockets", "path": "https.Agent.sockets" }, "https.Server": { "id": "https.Server", "type": "class", "superclass": "https", "description": "This class is a subclass of [[tls.Server `tls.Server`]] and emits the same\nevents as [[http.Server `http.Server`]].\n\nCreating HTTPS servers is somewhat complicated and requires generating\ncertificates.", "short_description": "This class is a subclass of [[tls.Server `tls.Server`]] and emits the same\nevents as [[http.Server `http.Server`]].\n", "ellipsis_description": "This class is a subclass of [[tls.Server `tls.Server`]] and emits the same\nevents as [[http.Server `http.Server`]].\n ...", "line": 221, "aliases": [], "children": [ { "id": "https.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Server.close)\n\nStops the server from accepting new connections.", "short_description": "(related to: net.Server.close)\n", "ellipsis_description": "(related to: net.Server.close)\n ...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L323", "name": "close", "path": "https.Server.close" }, { "id": "https.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to" }, { "name": "hostname", "types": [ "String" ], "description": "The hostname to listen to" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the server has been bound to the port (related to: net.Server.listen)" } ], "description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n\nThis function is asynchronous. The `callback()` is added as a listener for the\n[[net.Server@listening `'listening'` event of `net.Server`.", "short_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n", "ellipsis_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts conne...", "line": 314, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L314", "name": "listen", "path": "https.Server.listen" }, { "id": "https.Server@checkContinue", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of `http.ServerRequest`" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of `http.ServerResponse`" } ], "description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n\nHandling this event involves calling `response.writeContinue` if the client\nshould continue to send the request body, or generating an appropriate HTTP\nresponse (_e.g._ `400 Bad Request`) if the client should not continue to send\nthe request body.\n\nNote: When this event is emitted and handled, the `request` event is not be emitted.", "short_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n", "ellipsis_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the s...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@checkContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L267", "name": "checkContinue", "path": "https.Server.event.checkContinue" }, { "id": "https.Server@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception being thrown" } ], "description": "If a client connection emits an `'error'` event, it's forwarded here.", "short_description": "If a client connection emits an `'error'` event, it's forwarded here.", "ellipsis_description": "If a client connection emits an `'error'` event, it's forwarded here. ...", "line": 293, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L293", "name": "clientError", "path": "https.Server.event.clientError" }, { "id": "https.Server@close", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 249, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L249", "name": "close", "path": "https.Server.event.close" }, { "id": "https.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "short_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "ellipsis_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also b...", "line": 241, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L241", "name": "connection", "path": "https.Server.event.connection" }, { "id": "https.Server@request", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of [[http.ServerRequest]]" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of [[http.ServerResponse]]" } ], "description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "short_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "ellipsis_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple reques...", "line": 231, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L231", "name": "request", "path": "https.Server.event.request" }, { "id": "https.Server@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "socket", "types": [ "Number" ] }, { "name": "head", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "The arguments for the http request, as it is in the request event" }, { "name": "socket", "types": [ "Number" ], "description": "The network socket between the server and client" }, { "name": "head", "types": [ "Buffer" ], "description": "The first packet of the upgraded stream; this can be empty" } ], "description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n\nAfter this event is emitted, the request's socket won't have a `data` event\nlistener, meaning you will need to bind to it in order to handle data sent to\nthe server on that socket.", "short_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n", "ellipsis_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upg...", "line": 283, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L283", "name": "upgrade", "path": "https.Server.event.upgrade" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L221", "name": "Server", "path": "https.Server" }, "https.Server@request": { "id": "https.Server@request", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of [[http.ServerRequest]]" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of [[http.ServerResponse]]" } ], "description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "short_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "ellipsis_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple reques...", "line": 231, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L231", "name": "request", "path": "https.Server.event.request" }, "https.Server@connection": { "id": "https.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "short_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "ellipsis_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also b...", "line": 241, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L241", "name": "connection", "path": "https.Server.event.connection" }, "https.Server@close": { "id": "https.Server@close", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 249, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L249", "name": "close", "path": "https.Server.event.close" }, "https.Server@checkContinue": { "id": "https.Server@checkContinue", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of `http.ServerRequest`" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of `http.ServerResponse`" } ], "description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n\nHandling this event involves calling `response.writeContinue` if the client\nshould continue to send the request body, or generating an appropriate HTTP\nresponse (_e.g._ `400 Bad Request`) if the client should not continue to send\nthe request body.\n\nNote: When this event is emitted and handled, the `request` event is not be emitted.", "short_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n", "ellipsis_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the s...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@checkContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L267", "name": "checkContinue", "path": "https.Server.event.checkContinue" }, "https.Server@upgrade": { "id": "https.Server@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "socket", "types": [ "Number" ] }, { "name": "head", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "The arguments for the http request, as it is in the request event" }, { "name": "socket", "types": [ "Number" ], "description": "The network socket between the server and client" }, { "name": "head", "types": [ "Buffer" ], "description": "The first packet of the upgraded stream; this can be empty" } ], "description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n\nAfter this event is emitted, the request's socket won't have a `data` event\nlistener, meaning you will need to bind to it in order to handle data sent to\nthe server on that socket.", "short_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n", "ellipsis_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upg...", "line": 283, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L283", "name": "upgrade", "path": "https.Server.event.upgrade" }, "https.Server@clientError": { "id": "https.Server@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception being thrown" } ], "description": "If a client connection emits an `'error'` event, it's forwarded here.", "short_description": "If a client connection emits an `'error'` event, it's forwarded here.", "ellipsis_description": "If a client connection emits an `'error'` event, it's forwarded here. ...", "line": 293, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L293", "name": "clientError", "path": "https.Server.event.clientError" }, "https.Server.listen": { "id": "https.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to" }, { "name": "hostname", "types": [ "String" ], "description": "The hostname to listen to" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the server has been bound to the port (related to: net.Server.listen)" } ], "description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n\nThis function is asynchronous. The `callback()` is added as a listener for the\n[[net.Server@listening `'listening'` event of `net.Server`.", "short_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n", "ellipsis_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts conne...", "line": 314, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L314", "name": "listen", "path": "https.Server.listen" }, "https.Server.close": { "id": "https.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Server.close)\n\nStops the server from accepting new connections.", "short_description": "(related to: net.Server.close)\n", "ellipsis_description": "(related to: net.Server.close)\n ...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L323", "name": "close", "path": "https.Server.close" }, "Index": { "id": "Index", "type": "class", "description": "Node.js is a server-side Javascript environment. It's event-driven,\nasynchronous, and allows you to write a web server in a relatively quick amount\nof time.\n\nThis section is the Node.js Reference API in its entirety. You can change the\nversion of the Node.js documentation by using the dropdown in the toolbar.", "short_description": "Node.js is a server-side Javascript environment. It's event-driven,\nasynchronous, and allows you to write a web server in a relatively quick amount\nof time.\n", "ellipsis_description": "Node.js is a server-side Javascript environment. It's event-driven,\nasynchronous, and allows you to write a web serv...", "line": 13, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/index.markdown", "fileName": "index", "resultingFile": "index.html#Index", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/index.markdown#L13", "name": "Index", "path": "Index" }, "Modules": { "id": "Modules", "type": "class", "description": "\nNode.js has a simple module loading system. In Node.js, files and modules are in\none-to-one correspondence.\n\nFor example, imagine a scenario where `foo.js` loads the module `circle.js` in\nthe same directory.\n\nThe contents of `foo.js` are:\n\n var circle = require('./circle.js');\n console.log( 'The area of a circle of radius 4 is '\n + circle.area(4));\n\nThe contents of `circle.js` are:\n\n var PI = Math.PI;\n\n exports.area = function (r) {\n return PI * r * r;\n };\n\n exports.circumference = function (r) {\n return 2 * PI * r;\n };\n\nThe module `circle.js` has exported the functions `area()` and\n`circumference()`. To export an object, add to the special\n[`exports`](#module.exports) object.\n\nVariables local to a module are private. In this example, the variable `PI` is\nprivate to `circle.js`.\n\n#### Cycles\n\nWhenever there are circular `require()` calls, a module might not be done being\nexecuted when it is returned.\n\nConsider this situation with the following files. In `a.js':\n\n console.log('a starting');\n exports.done = false;\n var b = require('./b.js');\n console.log('in a, b.done = %j', b.done);\n exports.done = true;\n console.log('a done');\n\nIn `b.js`:\n\n console.log('b starting');\n exports.done = false;\n var a = require('./a.js');\n console.log('in b, a.done = %j', a.done);\n exports.done = true;\n console.log('b done');\n\nAnd in `main.js`:\n\n console.log('main starting');\n var a = require('./a.js');\n var b = require('./b.js');\n console.log('in main, a.done=%j, b.done=%j', a.done, b.done);\n\nWhen `main.js` loads `a.js`, `a.js` loads `b.js`. At that point, `b.js` tries to\nload `a.js`. In order to prevent an infinite loop an \"unfinished copy\" of the\n`a.js` exports object is returned to the `b.js` module. `b.js` then finishes\nloading, and its exports object is provided to the `a.js` module.\n\nBy the time `main.js` finishes loading both modules, they've both finished\nexecuting. The output of this program would thus be:\n\n $ node main.js\n main starting\n a starting\n b starting\n in b, a.done = false\n b done\n in a, b.done = true\n a done\n in main, a.done=true, b.done=true\n\nIf you have cyclic module dependencies in your program, make sure to plan\naccordingly.\n\n#### Core Modules\n\nNode.js has several modules compiled into the binary. These modules are\ndescribed in greater detail elsewhere in this documentation.\n\nThe core modules are defined in Node's source in the `lib/` folder.\n\nCore modules are always preferentially loaded if their identifier is passed to\n`require()`. For instance, `require('http')` always returns the built in HTTP\nmodule, even if there is a file by that name.\n\n#### File Modules\n\nIf the exact filename is not found, then Node.js attempts to load the required\nfilename with the added extension of `.js`, `.json`, and then `.node`.\n\n`.js` files are interpreted as Javascript text files, and `.json` files are\nparsed as JSON text files. `.node` files are interpreted as compiled addon\nmodules loaded with `dlopen`.\n\nA module prefixed with `'/'` is an absolute path to the file. For example,\n`require('/home/marco/foo.js')` loads the file at `/home/marco/foo.js`.\n\nA module prefixed with `'./'` is relative to the file calling `require()`. That\nis, `circle.js` must be in the same directory as `foo.js` for\n`require('./circle')` to find it.\n\nWithout a leading `'/'` or `'./'` to indicate a file, the module is either a\n\"core module\" or is loaded from the `node_modules` folder.\n\nFor example, if the file at `'/home/ry/projects/foo.js'` is called by\n`require('bar.js')`, then Node.js looks for it in the following locations, in\nthis order:\n\n* `/home/ry/projects/node_modules/bar.js`\n* `/home/ry/node_modules/bar.js`\n* `/home/node_modules/bar.js`\n* `/node_modules/bar.js`\n\nThis allows programs to localize their dependencies, so that they don't clash.\n\n#### Folders as Modules\n\nIt is convenient to organize programs and libraries into self-contained\ndirectories, and then provide a single entry point to that library.\n\nThere are three ways in which a folder may be passed to `require()` as an\nargument.\n\nThe first is to create a `package.json` file in the root of the folder, which\nspecifies a `main` module. An example `package.json` file might look like this:\n\n { \"name\" : \"some-library\",\n \"main\" : \"./lib/some-library.js\" }\n\nIf this was in a folder at `./some-library`, then `require('./some-library')`\nwould attempt to load `./some-library/lib/some-library.js`.\n\nThis is the extent of Node's awareness of `package.json` files.\n\nIf there is no `package.json` file present in the directory, then Node.js\nattempts to load an `index.js` or `index.node` file out of that directory. For\nexample, if there was no `package.json` file in the above example, then\n`require('./some-library')` would attempt to load:\n\n* `./some-library/index.js`\n* `./some-library/index.node`\n\n#### Caching\n\nModules are cached after the first time they are loaded. This means (among\nother things) that every call to `require('foo')` gets exactly the same object\nreturned, if it would resolve to the same file.\n\nMultiple calls to `require('foo')` may not cause the module code to be executed\nmultiple times. This is an important feature. With it, \"partially done\"\nobjects can be returned, thus allowing transitive dependencies to be loaded even\nwhen they would cause cycles.\n\nIf you want to have a module execute code multiple times, then export a\nfunction, and call that function.\n\n#### Module Caching Caveats\n\nModules are cached based on their resolved filename. Since modules may resolve\nto a different filename based on the location of the calling module (loading\nfrom `node_modules` folders), it is not a guarantee that `require('foo')` always\nreturns the exact same object, if it would resolve to different files.\n\n#### The `module` Object\n\nIn each module, the `module` variable is a reference to the object representing\nthe current module. In particular, `module.exports` is the same as the `exports`\nobject.\n\n`module` isn't actually a global, but rather local to each module.\n\n\n\nThe `exports` object is created by the Module system. Sometimes, this is not\nacceptable, as some developers want their module to be an instance of some\nclass.\n\nTo do this assign the desired export object to `module.exports`. For example\nsuppose we were making a module called `a.js`\n\n var EventEmitter = require('events').EventEmitter;\n\n module.exports = new EventEmitter();\n\n // Do some work, and after some time emit\n // the 'ready' event from the module itself.\n setTimeout(function() {\n module.exports.emit('ready');\n }, 1000);\n\nThen, in another file we could do\n\n var a = require('./a');\n a.on('ready', function() {\n console.log('module a is ready');\n });\n\n\nNote that the assignment to `module.exports` must be done immediately. It can't\nbe done in any callbacks. For example, this does not work:\n\nIn a file called `x.js`:\n\n setTimeout(function() {\n module.exports = { a: \"hello\" };\n }, 0);\n\nIn a file called `y.js`:\n\n var x = require('./x');\n console.log(x.a);\n\n\n#### All Together Now\n\nTo get the exact filename that will be loaded when `require()` is called, use\nthe `require.resolve()` function.\n\nPutting together all of the above, here is the high-level algorithm (in\npseudocode) of what `require.resolve()` does:\n\n
\n
To `require(X)` from module at path Y:
\n
\n
\n    1. If X is a core module,\n        a. return the core module\n        b. STOP\n    2. If X begins with './' or '/' or '../'\n        a. LOAD_AS_FILE(Y + X)\n        b. LOAD_AS_DIRECTORY(Y + X)\n    3. LOAD_NODE_MODULES(X, dirname(Y))\n    4. THROW \"not found\"\n    
\n
\n
To `LOAD_AS_FILE(X)`:
\n
\n
\n    1. If X is a file, load X as Javascript text.  STOP\n    2. If X.js is a file, load X.js as Javascript text.  STOP\n    3. If X.node is a file, load X.node as binary addon.  STOP\n    
\n
\n
To `LOAD_AS_DIRECTORY(X)`:
\n
\n
\n    1. If X/package.json is a file,\n       a. Parse X/package.json, and look for \"main\" field.\n       b. let M = X + (json main field)\n       c. LOAD_AS_FILE(M)\n    2. If X/index.js is a file, load X/index.js as Javascript text.  STOP\n    3. If X/index.node is a file, load X/index.node as binary addon.  STOP\n    
\n
\n
To `LOAD_NODE_MODULES(X, START)`:
\n
\n
\n    1. let DIRS=NODE_MODULES_PATHS(START)\n    2. for each DIR in DIRS:\n       a. LOAD_AS_FILE(DIR/X)\n       b. LOAD_AS_DIRECTORY(DIR/X)\n    
\n
\n
To `NODE_MODULES_PATHS(START)`:
\n
\n
\n    1. let PARTS = path split(START)\n    2. let ROOT = index of first instance of \"node_modules\" in PARTS, or 0\n    3. let I = count of PARTS - 1\n    4. let DIRS = []\n    5. while I > ROOT,\n       a. if PARTS[I] = \"node_modules\" CONTINUE\n       c. DIR = path join(PARTS[0 .. I] + \"node_modules\")\n       b. DIRS = DIRS + DIR\n       c. let I = I - 1\n    6. return DIRS\n    
\n
\n\n#### Loading from the global folders\n\nIf the `NODE_PATH` environment variable is set to a colon-delimited list of\nabsolute paths, then Node.js searches those paths for modules if they are not\nfound elsewhere. (Note: On Windows, `NODE_PATH` is delimited by semicolons\ninstead of colons.)\n\nAdditionally, Node.js searches in the following locations:\n\n* 1: `$HOME/.node_modules`\n* 2: `$HOME/.node_libraries`\n* 3: `$PREFIX/lib/node`\n\nWhere `$HOME` is the user's home directory, and `$PREFIX` is Node's configured\n`installPrefix`.\n\nThese are mostly for historic reasons. You are highly encouraged to place your\ndependencies locally in `node_modules` folders. They will be loaded faster, and\nmore reliably.\n\n#### Accessing the `main` module\n\nWhen a file is run directly from Node.js, `require.main` is set to its `module`.\nThat means that you can determine whether a file has been run directly by\ntesting for the following:\n\n require.main === module\n\nFor a file `foo.js`, this is `true` if run via `node foo.js`, but `false` if run\nby `require('./foo')`.\n\nBecause `module` provides a `filename` property (normally equivalent to\n`__filename`), the entry point of the current application can be obtained by\nchecking `require.main.filename`.\n\n#### Package Manager Tips\n\nThe semantics of Node's `require()` function were designed to be general enough\nto support a number of sane directory structures. Package manager programs such\nas `dpkg`, `rpm`, and `npm` will hopefully find it possible to build native\npackages from Node modules without modification.\n\nBelow we give a suggested directory structure that could work:\n\nLet's say that we wanted to have the folder at\n`/usr/lib/node//` hold the contents of a specific\nversion of a package.\n\nPackages can depend on one another. In order to install package `foo`, you may\nhave to install a specific version of package `bar`. The `bar` package may\nitself have dependencies, and in some cases, these dependencies may even collide\nor form cycles.\n\nSince Node.js looks up the `realpath` of any modules it loads (that is, resolves\nsymlinks), and then looks for their dependencies in the `node_modules` folders\nas described above, this situation is very simple to resolve with the following\narchitecture:\n\n* `/usr/lib/node/foo/1.2.3/` - Contents of the `foo` package, version 1.2.3.\n* `/usr/lib/node/bar/4.3.2/` - Contents of the `bar` package that `foo` depends\non.\n* `/usr/lib/node/foo/1.2.3/node_modules/bar` - Symbolic link to\n`/usr/lib/node/bar/4.3.2/`.\n* `/usr/lib/node/bar/4.3.2/node_modules/*` - Symbolic links to the packages that\n`bar` depends on.\n\nThus, even if a cycle is encountered, or if there are dependency conflicts,\nevery module will be able to get a version of its dependency that it can use.\n\nWhen the code in the `foo` package does `require('bar')`, it gets the version\nthat is symlinked into `/usr/lib/node/foo/1.2.3/node_modules/bar`. Then, when\nthe code in the `bar` package calls `require('quux')`, it gets the version that\nis symlinked into `/usr/lib/node/bar/4.3.2/node_modules/quux`.\n\nFurthermore, to make the module lookup process even more optimal, rather than\nputting packages directly in `/usr/lib/node`, we could put them in\n`/usr/lib/node_modules//`. Then Node.js doesn't bother looking\nfor missing dependencies in `/usr/node_modules` or `/node_modules`.\n\nIn order to make modules available to the Node.js REPL, it might be useful to\nalso add the `/usr/lib/node_modules` folder to the `$NODE_PATH` environment\nvariable. Since the module lookups using `node_modules` folders are all\nrelative, and based on the real path of the files making the calls to\n`require()`, the packages themselves can be anywhere.", "stability": "5 - Locked", "short_description": "\nNode.js has a simple module loading system. In Node.js, files and modules are in\none-to-one correspondence.\n", "ellipsis_description": "\nNode.js has a simple module loading system. In Node.js, files and modules are in\none-to-one correspondence.\n ...", "line": 379, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#Modules", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L379", "name": "Modules", "path": "Modules" }, "module.require": { "id": "module.require", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "id", "types": [ "String" ], "description": "The name of the module" } ], "description": "The `module.require` method provides a way to load a module as if `require()`\nwas called from the original module. The object returned is actually the\n`exports` from the resolved module.\n\nNote that in order to do this, you must get a reference to the `module` object.\nSince `require()` returns the `exports`, and the `module` is typically *only*\navailable within a specific module's code, it must be explicitly exported in\norder to be used.", "short_description": "The `module.require` method provides a way to load a module as if `require()`\nwas called from the original module. The object returned is actually the\n`exports` from the resolved module.\n", "ellipsis_description": "The `module.require` method provides a way to load a module as if `require()`\nwas called from the original module. T...", "line": 394, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.require", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L394", "name": "require", "path": "module.require" }, "module.id": { "id": "module.id", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The identifier for the module. Typically this is the fully resolved filename.", "short_description": "The identifier for the module. Typically this is the fully resolved filename.", "ellipsis_description": "The identifier for the module. Typically this is the fully resolved filename. ...", "line": 401, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.id", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L401", "name": "id", "path": "module.id" }, "module.filename": { "id": "module.filename", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The fully resolved filename to the module.", "short_description": "The fully resolved filename to the module.", "ellipsis_description": "The fully resolved filename to the module. ...", "line": 408, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.filename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L408", "name": "filename", "path": "module.filename" }, "module.loaded": { "id": "module.loaded", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Identifies wether or not the module is done loading (`true`), or is in the\nprocess of loading.", "short_description": "Identifies wether or not the module is done loading (`true`), or is in the\nprocess of loading.", "ellipsis_description": "Identifies wether or not the module is done loading (`true`), or is in the\nprocess of loading. ...", "line": 416, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.loaded", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L416", "name": "loaded", "path": "module.loaded" }, "module.parent": { "id": "module.parent", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The module that required this one.", "short_description": "The module that required this one.", "ellipsis_description": "The module that required this one. ...", "line": 423, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.parent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L423", "name": "parent", "path": "module.parent" }, "module.children": { "id": "module.children", "type": "class property", "signatures": [ { "returns": [ { "type": "Array" } ] } ], "description": "The module objects required by this one.", "short_description": "The module objects required by this one.", "ellipsis_description": "The module objects required by this one. ...", "line": 430, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.children", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L430", "name": "children", "path": "module.children" }, "net": { "id": "net", "type": "class", "description": "\nThe `net` module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers and clients (called streams). You can include\nthis module in your code with `require('net');`\n\n\n#### Example\n\nHere is an example of a echo server which listens for connections on port 8124:\n\n\n\nYou can test this by using `telnet`:\n\n telnet localhost 8124\n\nTo listen on the socket `/tmp/echo.sock` the third line from the last would just\nbe changed to\n\n server.listen('/tmp/echo.sock', function() { //'listening' listener\n\nYou can use `nc` to connect to a UNIX domain socket server:\n\n nc -U /tmp/echo.sock", "stability": "3 - Stable", "short_description": "\nThe `net` module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers and clients (called streams). You can include\nthis module in your code with `require('net');`\n", "ellipsis_description": "\nThe `net` module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers a...", "line": 31, "aliases": [], "children": [ { "id": "net.connect", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event (alias of: createConnection)" } ], "description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n\nThe arguments for these methods change the type of connection. For example, if\nyou include `host`, you create a TCP connection to `port` on `host`. If you\ndon't include it, you create a unix socket connection to `path`.", "short_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n", "ellipsis_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connec...", "line": 66, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L66", "name": "connect", "path": "net.connect" }, { "id": "net.createConnection", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event" } ], "description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n\nThe arguments for these methods change the type of connection. For example, if\nyou include `host`, you create a TCP connection to `port` on `host`. If you\ndon't include it, you create a unix socket connection to `path`.", "short_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n", "ellipsis_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connec...", "line": 83, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.createConnection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L83", "name": "createConnection", "path": "net.createConnection" }, { "id": "net.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "default_value": { "allowHalfOpen": false }, "optional": true, "types": [ "Object" ] }, { "name": "connectionListener", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "An object with any options you want to include", "optional": true }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event", "optional": true } ], "description": "Creates a new TCP server.\n\nIf `allowHalfOpen` is `true`, then the socket won't automatically send FIN\npacket when the other end of the socket sends a FIN packet. The socket becomes\nnon-readable, but still writable. You should call the `end()` method explicitly.\nSee [[net.Socket@end `'end'`]] event for more information.", "short_description": "Creates a new TCP server.\n", "ellipsis_description": "Creates a new TCP server.\n ...", "line": 48, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L48", "name": "createServer", "path": "net.createServer" }, { "id": "net.isIP", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and returns `6` for IP version 6 addresses.", "short_description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and returns `6` for IP version 6 addresses.", "ellipsis_description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and retu...", "line": 93, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIP", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L93", "name": "isIP", "path": "net.isIP" }, { "id": "net.isIPv4", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Returns `true` if input is a version 4 IP address.", "short_description": "Returns `true` if input is a version 4 IP address.", "ellipsis_description": "Returns `true` if input is a version 4 IP address. ...", "line": 101, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIPv4", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L101", "name": "isIPv4", "path": "net.isIPv4" }, { "id": "net.isIPv6", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Returns `true` if input is a version 6 IP address.", "short_description": "Returns `true` if input is a version 6 IP address.", "ellipsis_description": "Returns `true` if input is a version 6 IP address. ...", "line": 109, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIPv6", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L109", "name": "isIPv6", "path": "net.isIPv6" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net", "subclasses": [ "net.Server", "net.Socket" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L31", "name": "net", "path": "net" }, "net.createServer": { "id": "net.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "default_value": { "allowHalfOpen": false }, "optional": true, "types": [ "Object" ] }, { "name": "connectionListener", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "An object with any options you want to include", "optional": true }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event", "optional": true } ], "description": "Creates a new TCP server.\n\nIf `allowHalfOpen` is `true`, then the socket won't automatically send FIN\npacket when the other end of the socket sends a FIN packet. The socket becomes\nnon-readable, but still writable. You should call the `end()` method explicitly.\nSee [[net.Socket@end `'end'`]] event for more information.", "short_description": "Creates a new TCP server.\n", "ellipsis_description": "Creates a new TCP server.\n ...", "line": 48, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L48", "name": "createServer", "path": "net.createServer" }, "net.connect": { "id": "net.connect", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event (alias of: createConnection)" } ], "description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n\nThe arguments for these methods change the type of connection. For example, if\nyou include `host`, you create a TCP connection to `port` on `host`. If you\ndon't include it, you create a unix socket connection to `path`.", "short_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n", "ellipsis_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connec...", "line": 66, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L66", "name": "connect", "path": "net.connect" }, "net.createConnection": { "id": "net.createConnection", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event" } ], "description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n\nThe arguments for these methods change the type of connection. For example, if\nyou include `host`, you create a TCP connection to `port` on `host`. If you\ndon't include it, you create a unix socket connection to `path`.", "short_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n", "ellipsis_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connec...", "line": 83, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.createConnection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L83", "name": "createConnection", "path": "net.createConnection" }, "net.isIP": { "id": "net.isIP", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and returns `6` for IP version 6 addresses.", "short_description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and returns `6` for IP version 6 addresses.", "ellipsis_description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and retu...", "line": 93, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIP", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L93", "name": "isIP", "path": "net.isIP" }, "net.isIPv4": { "id": "net.isIPv4", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Returns `true` if input is a version 4 IP address.", "short_description": "Returns `true` if input is a version 4 IP address.", "ellipsis_description": "Returns `true` if input is a version 4 IP address. ...", "line": 101, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIPv4", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L101", "name": "isIPv4", "path": "net.isIPv4" }, "net.isIPv6": { "id": "net.isIPv6", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Returns `true` if input is a version 6 IP address.", "short_description": "Returns `true` if input is a version 6 IP address.", "ellipsis_description": "Returns `true` if input is a version 6 IP address. ...", "line": 109, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIPv6", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L109", "name": "isIPv6", "path": "net.isIPv6" }, "net.Server": { "id": "net.Server", "type": "class", "superclass": "net", "description": "This class is used to create a TCP or UNIX server. A server is a `net.Socket`\nthat can listen for new incoming connections.\n\n#### Example\n\n", "short_description": "This class is used to create a TCP or UNIX server. A server is a `net.Socket`\nthat can listen for new incoming connections.\n", "ellipsis_description": "This class is used to create a TCP or UNIX server. A server is a `net.Socket`\nthat can listen for new incoming conne...", "line": 121, "aliases": [], "children": [ { "id": "net.Server.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was assigned when giving getting an\nOS-assigned address.\n\nThis returns an object with two properties, like this:\n\n {\"address\":\"127.0.0.1\", \"port\":2121}`\n\n#### Example\n\n", "short_description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was assigned when giving getting an\nOS-assigned address.\n", "ellipsis_description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was ...", "line": 226, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L226", "name": "address", "path": "net.Server.address" }, { "id": "net.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close' event.", "short_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close' event.", "ellipsis_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed wh...", "line": 209, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L209", "name": "close", "path": "net.Server.close" }, { "id": "net.Server.connections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of concurrent connections on the server.", "short_description": "The number of concurrent connections on the server.", "ellipsis_description": "The number of concurrent connections on the server. ...", "line": 242, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L242", "name": "connections", "path": "net.Server.connections" }, { "id": "net.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@listening `'listening'`]] event" } ], "description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). A port value of zero will assign a random port.\n\nThis function is asynchronous. When the server has been bound, the\n`'listening'` event is emitted.\n\nOne issue some users run into is getting `EADDRINUSE` errors. This means that\nanother server is already running on the requested port. One way of handling\nthis would be to wait a second and then try again. This can be done with\n\n server.on('error', function (e) {\n if (e.code == 'EADDRINUSE') {\n console.log('Address in use, retrying...');\n setTimeout(function () {\n server.close();\n server.listen(PORT, HOST);\n }, 1000);\n }\n });\n\nNote: All sockets in Node.js set `SO_REUSEADDR` already.", "short_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). A port value of zero will assign a random port.\n", "ellipsis_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connec...", "line": 190, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L190", "name": "listen", "path": "net.Server.listen" }, { "id": "net.Server.maxConnections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Set this property to reject connections when the server's connection count gets\nhigh.", "short_description": "Set this property to reject connections when the server's connection count gets\nhigh.", "ellipsis_description": "Set this property to reject connections when the server's connection count gets\nhigh. ...", "line": 235, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.maxConnections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L235", "name": "maxConnections", "path": "net.Server.maxConnections" }, { "id": "net.Server.pause", "type": "class method", "signatures": [ { "args": [ { "name": "msecs", "default_value": 1000, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "msecs", "types": [ "Number" ], "description": "The number of milliseconds to pause for" } ], "description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "short_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "ellipsis_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections...", "line": 200, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L200", "name": "pause", "path": "net.Server.pause" }, { "id": "net.Server@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L146", "name": "close", "path": "net.Server.event.close" }, { "id": "net.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An instance of `net.Socket`" } ], "description": "Emitted when a new connection is made.", "short_description": "Emitted when a new connection is made.", "ellipsis_description": "Emitted when a new connection is made. ...", "line": 138, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L138", "name": "connection", "path": "net.Server.event.connection" }, { "id": "net.Server@error", "type": "event", "signatures": [ { "args": [ { "name": "exception" } ] } ], "description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the discussion of [[net.Server.listen\n`net.Server.listen`]]", "short_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the discussion of [[net.Server.listen\n`net.Server.listen`]]", "ellipsis_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the d...", "line": 156, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L156", "name": "error", "path": "net.Server.event.error" }, { "id": "net.Server@listening", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server has been bound after calling `server.listen`.", "short_description": "Emitted when the server has been bound after calling `server.listen`.", "ellipsis_description": "Emitted when the server has been bound after calling `server.listen`. ...", "line": 130, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L130", "name": "listening", "path": "net.Server.event.listening" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L121", "name": "Server", "path": "net.Server" }, "net.Server@listening": { "id": "net.Server@listening", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server has been bound after calling `server.listen`.", "short_description": "Emitted when the server has been bound after calling `server.listen`.", "ellipsis_description": "Emitted when the server has been bound after calling `server.listen`. ...", "line": 130, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L130", "name": "listening", "path": "net.Server.event.listening" }, "net.Server@connection": { "id": "net.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An instance of `net.Socket`" } ], "description": "Emitted when a new connection is made.", "short_description": "Emitted when a new connection is made.", "ellipsis_description": "Emitted when a new connection is made. ...", "line": 138, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L138", "name": "connection", "path": "net.Server.event.connection" }, "net.Server@close": { "id": "net.Server@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L146", "name": "close", "path": "net.Server.event.close" }, "net.Server@error": { "id": "net.Server@error", "type": "event", "signatures": [ { "args": [ { "name": "exception" } ] } ], "description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the discussion of [[net.Server.listen\n`net.Server.listen`]]", "short_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the discussion of [[net.Server.listen\n`net.Server.listen`]]", "ellipsis_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the d...", "line": 156, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L156", "name": "error", "path": "net.Server.event.error" }, "net.Server.listen": { "id": "net.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@listening `'listening'`]] event" } ], "description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). A port value of zero will assign a random port.\n\nThis function is asynchronous. When the server has been bound, the\n`'listening'` event is emitted.\n\nOne issue some users run into is getting `EADDRINUSE` errors. This means that\nanother server is already running on the requested port. One way of handling\nthis would be to wait a second and then try again. This can be done with\n\n server.on('error', function (e) {\n if (e.code == 'EADDRINUSE') {\n console.log('Address in use, retrying...');\n setTimeout(function () {\n server.close();\n server.listen(PORT, HOST);\n }, 1000);\n }\n });\n\nNote: All sockets in Node.js set `SO_REUSEADDR` already.", "short_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). A port value of zero will assign a random port.\n", "ellipsis_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connec...", "line": 190, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L190", "name": "listen", "path": "net.Server.listen" }, "net.Server.pause": { "id": "net.Server.pause", "type": "class method", "signatures": [ { "args": [ { "name": "msecs", "default_value": 1000, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "msecs", "types": [ "Number" ], "description": "The number of milliseconds to pause for" } ], "description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "short_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "ellipsis_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections...", "line": 200, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L200", "name": "pause", "path": "net.Server.pause" }, "net.Server.close": { "id": "net.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close' event.", "short_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close' event.", "ellipsis_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed wh...", "line": 209, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L209", "name": "close", "path": "net.Server.close" }, "net.Server.address": { "id": "net.Server.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was assigned when giving getting an\nOS-assigned address.\n\nThis returns an object with two properties, like this:\n\n {\"address\":\"127.0.0.1\", \"port\":2121}`\n\n#### Example\n\n", "short_description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was assigned when giving getting an\nOS-assigned address.\n", "ellipsis_description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was ...", "line": 226, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L226", "name": "address", "path": "net.Server.address" }, "net.Server.maxConnections": { "id": "net.Server.maxConnections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Set this property to reject connections when the server's connection count gets\nhigh.", "short_description": "Set this property to reject connections when the server's connection count gets\nhigh.", "ellipsis_description": "Set this property to reject connections when the server's connection count gets\nhigh. ...", "line": 235, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.maxConnections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L235", "name": "maxConnections", "path": "net.Server.maxConnections" }, "net.Server.connections": { "id": "net.Server.connections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of concurrent connections on the server.", "short_description": "The number of concurrent connections on the server.", "ellipsis_description": "The number of concurrent connections on the server. ...", "line": 242, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L242", "name": "connections", "path": "net.Server.connections" }, "net.Socket": { "id": "net.Socket", "type": "class", "superclass": "net", "description": "This object is an abstraction of a TCP or UNIX socket. `net.Socket` instances\nimplement a duplex Stream interface. They can be created by the user and used\nas a client (with `connect()`) or they can be created by Node.js and passed to\nthe user through the `'connection'` event of a server.", "short_description": "This object is an abstraction of a TCP or UNIX socket. `net.Socket` instances\nimplement a duplex Stream interface. They can be created by the user and used\nas a client (with `connect()`) or they can be created by Node.js and passed to\nthe user through the `'connection'` event of a server.", "ellipsis_description": "This object is an abstraction of a TCP or UNIX socket. `net.Socket` instances\nimplement a duplex Stream interface. ...", "line": 253, "aliases": [], "children": [ { "id": "net.Socket.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two properties that looks like this:\n\n\t\t{\"address\":\"192.168.57.1\", \"port\":62053}", "short_description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two properties that looks like this:\n", "ellipsis_description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two pro...", "line": 452, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L452", "name": "address", "path": "net.Socket.address" }, { "id": "net.Socket.bufferSize", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. The computer can't always keep up with\nthe amount of data that is written to a socket—the network connection simply\nmight be too slow. Node.js will internally queue up the data written to a socket\nand send it out over the wire whenever it's possible. (Internally, it's polling\non the socket's file descriptor for being writable.)\n\nThe consequence of this internal buffering is that memory may grow. This\nproperty shows the number of characters currently buffered to be written. The\nnumber of characters is approximately equal to the number of bytes to be\nwritten, but the buffer may contain strings, and the strings are lazily encoded,\nso the _exact_ number of bytes is not known.\n\nNote: Users who experience a large or growing `bufferSize` should attempt to \"throttle\" the data flows in their program with `pause()` and `resume()`.", "short_description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. The computer can't always keep up with\nthe amount of data that is written to a socket—the network connection simply\nmight be too slow. Node.js will internally queue up the data written to a socket\nand send it out over the wire whenever it's possible. (Internally, it's polling\non the socket's file descriptor for being writable.)\n", "ellipsis_description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. ...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bufferSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L323", "name": "bufferSize", "path": "net.Socket.bufferSize" }, { "id": "net.Socket.bytesRead", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The amount of received bytes.", "short_description": "The amount of received bytes.", "ellipsis_description": "The amount of received bytes. ...", "line": 477, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bytesRead", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L477", "name": "bytesRead", "path": "net.Socket.bytesRead" }, { "id": "net.Socket.bytesWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The amount of bytes sent.", "short_description": "The amount of bytes sent.", "ellipsis_description": "The amount of bytes sent. ...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bytesWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L485", "name": "bytesWritten", "path": "net.Socket.bytesWritten" }, { "id": "net.Socket.close", "type": "class method", "signatures": [ { "args": [ { "name": "had_error", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "had_error", "types": [ "Boolean" ], "description": "A `true` boolean if the socket was closed due to a transmission error" } ], "description": "Emitted once the socket is fully closed.", "short_description": "Emitted once the socket is fully closed.", "ellipsis_description": "Emitted once the socket is fully closed. ...", "line": 557, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L557", "name": "close", "path": "net.Socket.close" }, { "id": "net.Socket.connect", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "default_value": "localhost", "optional": true, "types": [ "String" ] }, { "name": "connectionListener", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "connectionListener", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to; it's entirely optional, as you can just use `(port, connectListener)` if you wish", "optional": true }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event", "optional": true } ], "description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. If a `path` is given, the socket is opened\nas a Unix socket to that path.\n\nNormally this method isn't needed, as `net.createConnection()` opens the socket.\nUse this only if you are implementing a custom Socket or if a Socket is closed\nand you want to reuse it to connect to another server.\n\nThis function is asynchronous. When the `'connect'` event is emitted the socket\nis established. If there is a problem connecting, the `'connect'` event isn't\nemitted, and the `'error'` event is emitted with the exception.", "short_description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. If a `path` is given, the socket is opened\nas a Unix socket to that path.\n", "ellipsis_description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. ...", "line": 302, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L302", "name": "connect", "path": "net.Socket.connect" }, { "id": "net.Socket.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error).", "short_description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error).", "ellipsis_description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error). ...", "line": 379, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L379", "name": "destroy", "path": "net.Socket.destroy" }, { "id": "net.Socket.drain", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Socket.write)\n\nEmitted when the write buffer becomes empty. Can be used to throttle uploads.", "short_description": "(related to: net.Socket.write)\n", "ellipsis_description": "(related to: net.Socket.write)\n ...", "line": 539, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.drain", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L539", "name": "drain", "path": "net.Socket.drain" }, { "id": "net.Socket.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to write first", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true } ], "description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n\nIf `data` is specified, it's equivalent to calling `socket.write(data,\nencoding)` followed by `socket.end()`.", "short_description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n", "ellipsis_description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n ...", "line": 371, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L371", "name": "end", "path": "net.Socket.end" }, { "id": "net.Socket.error", "type": "class method", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "Any exceptions encountered" } ], "description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event.", "short_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event.", "ellipsis_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. ...", "line": 548, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L548", "name": "error", "path": "net.Socket.error" }, { "id": "new net.Socket", "type": "constructor", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "An object of options you can pass" } ], "description": "Constructs a new socket object.\n\n`options` is an object with the following defaults:\n\n {\n fd: null\n type: null\n allowHalfOpen: false\n }\n\nwhere\n\n* `fd` allows you to specify the existing file descriptor of socket.\n* `type` specifies the underlying protocol. It can be `'tcp4'`, `'tcp6'`, or\n`'unix'`.\n* `allowHalfOpen` is a boolean indicating how the socket should end. For more\ninformation, see the [[net.createServer `createServer()`]] method and the\n[[net.Socket@end `'end'`]] event.", "short_description": "Constructs a new socket object.\n", "ellipsis_description": "Constructs a new socket object.\n ...", "line": 279, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L279", "name": "new", "path": "net.Socket.new" }, { "id": "net.Socket.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload.", "short_description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload.", "ellipsis_description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload. ...", "line": 388, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L388", "name": "pause", "path": "net.Socket.pause" }, { "id": "net.Socket.remoteAddress", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "short_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "ellipsis_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`. ...", "line": 461, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.remoteAddress", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L461", "name": "remoteAddress", "path": "net.Socket.remoteAddress" }, { "id": "net.Socket.remotePort", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The numeric representation of the remote port. For example, `80` or `21`.", "short_description": "The numeric representation of the remote port. For example, `80` or `21`.", "ellipsis_description": "The numeric representation of the remote port. For example, `80` or `21`. ...", "line": 469, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.remotePort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L469", "name": "remotePort", "path": "net.Socket.remotePort" }, { "id": "net.Socket.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes reading after a call to `pause()`.", "short_description": "Resumes reading after a call to `pause()`.", "ellipsis_description": "Resumes reading after a call to `pause()`. ...", "line": 395, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L395", "name": "resume", "path": "net.Socket.resume" }, { "id": "net.Socket.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (either `'ascii'`, `'utf8'`, or `'base64'`)", "optional": true } ], "description": "Sets the encoding for data that is received.", "short_description": "Sets the encoding for data that is received.", "ellipsis_description": "Sets the encoding for data that is received. ...", "line": 332, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L332", "name": "setEncoding", "path": "net.Socket.setEncoding" }, { "id": "net.Socket.setKeepAlive", "type": "class method", "signatures": [ { "args": [ { "name": "enable", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "initialDelay", "default_value": 0, "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "enable", "types": [ "Boolean" ], "description": "Enables or disables whether to stay alive", "optional": true }, { "name": "initialDelay", "types": [ "Number" ], "description": "The delay (in milliseconds) between the last data packet received and the first keepalive probe", "optional": true } ], "description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n\nSetting `initialDelay` to 0 for leaves the value unchanged from the default (or\nprevious) setting.\n\n\n#### Example\n\n", "short_description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n", "ellipsis_description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe i...", "line": 442, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setKeepAlive", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L442", "name": "setKeepAlive", "path": "net.Socket.setKeepAlive" }, { "id": "net.Socket.setNoDelay", "type": "class method", "signatures": [ { "args": [ { "name": "noDelay", "default_value": true, "optional": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "noDelay", "types": [ "Boolean" ], "description": "If `true`, immediately fires off data each time `socket.write()` is called.", "optional": true } ], "description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the Nagle algorithm, they buffer data before\nsending it off.", "short_description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the Nagle algorithm, they buffer data before\nsending it off.", "ellipsis_description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the N...", "line": 423, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setNoDelay", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L423", "name": "setNoDelay", "path": "net.Socket.setNoDelay" }, { "id": "net.Socket.setSecure", "type": "class method", "signatures": [ { "args": [] } ], "description": "(deprecated: 0.3.0)\n\nThis function was used to upgrade the connection to SSL/TLS. See the [[tls TLS]]\nsection for the new API.", "short_description": "(deprecated: 0.3.0)\n", "ellipsis_description": "(deprecated: 0.3.0)\n ...", "line": 343, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setSecure", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L343", "name": "setSecure", "path": "net.Socket.setSecure" }, { "id": "net.Socket.setTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeout", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "timeout", "types": [ "Number" ], "description": "The timeout length (in milliseconds)" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute as a one time listener for the `'timeout'` event.", "optional": true } ], "description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't have a timeout.\n\nWhen an idle timeout is triggered the socket will receive a `'timeout'` event\nbut the connection will not be severed. The user must manually `end()` or\n`destroy()` the socket.\n\nIf `timeout` is 0, then the existing idle timeout is disabled.", "short_description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't have a timeout.\n", "ellipsis_description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't h...", "line": 412, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L412", "name": "setTimeout", "path": "net.Socket.setTimeout" }, { "id": "net.Socket.timeout", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Socket.setTimeout)\n\nEmitted if the socket times out from inactivity. This is only to notify that the\nsocket has been idle. The user must manually close the connection.", "short_description": "(related to: net.Socket.setTimeout)\n", "ellipsis_description": "(related to: net.Socket.setTimeout)\n ...", "line": 529, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.timeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L529", "name": "timeout", "path": "net.Socket.timeout" }, { "id": "net.Socket.write", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to write" }, { "name": "enocding", "types": [ "String" ], "description": "The encoding to use" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the write is finished", "optional": true } ], "description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 encoding.\n\nReturns `true` if the entire data was flushed successfully to the kernel buffer.\nReturns `false` if all or part of the data was queued in user memory. `'drain'`\nis emitted when the buffer is again free.", "short_description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 encoding.\n", "ellipsis_description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 en...", "line": 358, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L358", "name": "write", "path": "net.Socket.write" }, { "id": "net.Socket@connect", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connect()`]].", "short_description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connect()`]].", "ellipsis_description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connec...", "line": 494, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L494", "name": "connect", "path": "net.Socket.event.connect" }, { "id": "net.Socket@data", "type": "event", "signatures": [ { "args": [ { "name": "data", "types": [ "Buffer", "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "Buffer", "String" ], "description": "A `Buffer` or `String`, depending on what it is" } ], "description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n\nFor more information, see the [[streams.ReadableStream ReadableStream]] section.", "short_description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n", "ellipsis_description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n ...", "line": 505, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L505", "name": "data", "path": "net.Socket.event.data" }, { "id": "net.Socket@end", "type": "event", "signatures": [ { "args": [] } ], "description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pending write queue. However, by setting\n`allowHalfOpen == true` the socket won't automatically `end()` its side,\nallowing the user to write arbitrary amounts of data, with the caveat that the\nuser is required to `end()` their side now.\n\nEmitted when the other end of the socket sends a FIN packet.", "short_description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pending write queue. However, by setting\n`allowHalfOpen == true` the socket won't automatically `end()` its side,\nallowing the user to write arbitrary amounts of data, with the caveat that the\nuser is required to `end()` their side now.\n", "ellipsis_description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pend...", "line": 518, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L518", "name": "end", "path": "net.Socket.event.end" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L253", "name": "Socket", "path": "net.Socket" }, "net.Socket.new": { "id": "new net.Socket", "type": "constructor", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "An object of options you can pass" } ], "description": "Constructs a new socket object.\n\n`options` is an object with the following defaults:\n\n {\n fd: null\n type: null\n allowHalfOpen: false\n }\n\nwhere\n\n* `fd` allows you to specify the existing file descriptor of socket.\n* `type` specifies the underlying protocol. It can be `'tcp4'`, `'tcp6'`, or\n`'unix'`.\n* `allowHalfOpen` is a boolean indicating how the socket should end. For more\ninformation, see the [[net.createServer `createServer()`]] method and the\n[[net.Socket@end `'end'`]] event.", "short_description": "Constructs a new socket object.\n", "ellipsis_description": "Constructs a new socket object.\n ...", "line": 279, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L279", "name": "new", "path": "net.Socket.new" }, "net.Socket.connect": { "id": "net.Socket.connect", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "default_value": "localhost", "optional": true, "types": [ "String" ] }, { "name": "connectionListener", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "connectionListener", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to; it's entirely optional, as you can just use `(port, connectListener)` if you wish", "optional": true }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event", "optional": true } ], "description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. If a `path` is given, the socket is opened\nas a Unix socket to that path.\n\nNormally this method isn't needed, as `net.createConnection()` opens the socket.\nUse this only if you are implementing a custom Socket or if a Socket is closed\nand you want to reuse it to connect to another server.\n\nThis function is asynchronous. When the `'connect'` event is emitted the socket\nis established. If there is a problem connecting, the `'connect'` event isn't\nemitted, and the `'error'` event is emitted with the exception.", "short_description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. If a `path` is given, the socket is opened\nas a Unix socket to that path.\n", "ellipsis_description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. ...", "line": 302, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L302", "name": "connect", "path": "net.Socket.connect" }, "net.Socket.bufferSize": { "id": "net.Socket.bufferSize", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. The computer can't always keep up with\nthe amount of data that is written to a socket—the network connection simply\nmight be too slow. Node.js will internally queue up the data written to a socket\nand send it out over the wire whenever it's possible. (Internally, it's polling\non the socket's file descriptor for being writable.)\n\nThe consequence of this internal buffering is that memory may grow. This\nproperty shows the number of characters currently buffered to be written. The\nnumber of characters is approximately equal to the number of bytes to be\nwritten, but the buffer may contain strings, and the strings are lazily encoded,\nso the _exact_ number of bytes is not known.\n\nNote: Users who experience a large or growing `bufferSize` should attempt to \"throttle\" the data flows in their program with `pause()` and `resume()`.", "short_description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. The computer can't always keep up with\nthe amount of data that is written to a socket—the network connection simply\nmight be too slow. Node.js will internally queue up the data written to a socket\nand send it out over the wire whenever it's possible. (Internally, it's polling\non the socket's file descriptor for being writable.)\n", "ellipsis_description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. ...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bufferSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L323", "name": "bufferSize", "path": "net.Socket.bufferSize" }, "net.Socket.setEncoding": { "id": "net.Socket.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (either `'ascii'`, `'utf8'`, or `'base64'`)", "optional": true } ], "description": "Sets the encoding for data that is received.", "short_description": "Sets the encoding for data that is received.", "ellipsis_description": "Sets the encoding for data that is received. ...", "line": 332, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L332", "name": "setEncoding", "path": "net.Socket.setEncoding" }, "net.Socket.setSecure": { "id": "net.Socket.setSecure", "type": "class method", "signatures": [ { "args": [] } ], "description": "(deprecated: 0.3.0)\n\nThis function was used to upgrade the connection to SSL/TLS. See the [[tls TLS]]\nsection for the new API.", "short_description": "(deprecated: 0.3.0)\n", "ellipsis_description": "(deprecated: 0.3.0)\n ...", "line": 343, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setSecure", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L343", "name": "setSecure", "path": "net.Socket.setSecure" }, "net.Socket.write": { "id": "net.Socket.write", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to write" }, { "name": "enocding", "types": [ "String" ], "description": "The encoding to use" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the write is finished", "optional": true } ], "description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 encoding.\n\nReturns `true` if the entire data was flushed successfully to the kernel buffer.\nReturns `false` if all or part of the data was queued in user memory. `'drain'`\nis emitted when the buffer is again free.", "short_description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 encoding.\n", "ellipsis_description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 en...", "line": 358, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L358", "name": "write", "path": "net.Socket.write" }, "net.Socket.end": { "id": "net.Socket.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to write first", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true } ], "description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n\nIf `data` is specified, it's equivalent to calling `socket.write(data,\nencoding)` followed by `socket.end()`.", "short_description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n", "ellipsis_description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n ...", "line": 371, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L371", "name": "end", "path": "net.Socket.end" }, "net.Socket.destroy": { "id": "net.Socket.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error).", "short_description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error).", "ellipsis_description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error). ...", "line": 379, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L379", "name": "destroy", "path": "net.Socket.destroy" }, "net.Socket.pause": { "id": "net.Socket.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload.", "short_description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload.", "ellipsis_description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload. ...", "line": 388, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L388", "name": "pause", "path": "net.Socket.pause" }, "net.Socket.resume": { "id": "net.Socket.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes reading after a call to `pause()`.", "short_description": "Resumes reading after a call to `pause()`.", "ellipsis_description": "Resumes reading after a call to `pause()`. ...", "line": 395, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L395", "name": "resume", "path": "net.Socket.resume" }, "net.Socket.setTimeout": { "id": "net.Socket.setTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeout", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "timeout", "types": [ "Number" ], "description": "The timeout length (in milliseconds)" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute as a one time listener for the `'timeout'` event.", "optional": true } ], "description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't have a timeout.\n\nWhen an idle timeout is triggered the socket will receive a `'timeout'` event\nbut the connection will not be severed. The user must manually `end()` or\n`destroy()` the socket.\n\nIf `timeout` is 0, then the existing idle timeout is disabled.", "short_description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't have a timeout.\n", "ellipsis_description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't h...", "line": 412, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L412", "name": "setTimeout", "path": "net.Socket.setTimeout" }, "net.Socket.setNoDelay": { "id": "net.Socket.setNoDelay", "type": "class method", "signatures": [ { "args": [ { "name": "noDelay", "default_value": true, "optional": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "noDelay", "types": [ "Boolean" ], "description": "If `true`, immediately fires off data each time `socket.write()` is called.", "optional": true } ], "description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the Nagle algorithm, they buffer data before\nsending it off.", "short_description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the Nagle algorithm, they buffer data before\nsending it off.", "ellipsis_description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the N...", "line": 423, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setNoDelay", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L423", "name": "setNoDelay", "path": "net.Socket.setNoDelay" }, "net.Socket.setKeepAlive": { "id": "net.Socket.setKeepAlive", "type": "class method", "signatures": [ { "args": [ { "name": "enable", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "initialDelay", "default_value": 0, "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "enable", "types": [ "Boolean" ], "description": "Enables or disables whether to stay alive", "optional": true }, { "name": "initialDelay", "types": [ "Number" ], "description": "The delay (in milliseconds) between the last data packet received and the first keepalive probe", "optional": true } ], "description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n\nSetting `initialDelay` to 0 for leaves the value unchanged from the default (or\nprevious) setting.\n\n\n#### Example\n\n", "short_description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n", "ellipsis_description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe i...", "line": 442, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setKeepAlive", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L442", "name": "setKeepAlive", "path": "net.Socket.setKeepAlive" }, "net.Socket.address": { "id": "net.Socket.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two properties that looks like this:\n\n\t\t{\"address\":\"192.168.57.1\", \"port\":62053}", "short_description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two properties that looks like this:\n", "ellipsis_description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two pro...", "line": 452, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L452", "name": "address", "path": "net.Socket.address" }, "net.Socket.remoteAddress": { "id": "net.Socket.remoteAddress", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "short_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "ellipsis_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`. ...", "line": 461, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.remoteAddress", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L461", "name": "remoteAddress", "path": "net.Socket.remoteAddress" }, "net.Socket.remotePort": { "id": "net.Socket.remotePort", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The numeric representation of the remote port. For example, `80` or `21`.", "short_description": "The numeric representation of the remote port. For example, `80` or `21`.", "ellipsis_description": "The numeric representation of the remote port. For example, `80` or `21`. ...", "line": 469, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.remotePort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L469", "name": "remotePort", "path": "net.Socket.remotePort" }, "net.Socket.bytesRead": { "id": "net.Socket.bytesRead", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The amount of received bytes.", "short_description": "The amount of received bytes.", "ellipsis_description": "The amount of received bytes. ...", "line": 477, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bytesRead", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L477", "name": "bytesRead", "path": "net.Socket.bytesRead" }, "net.Socket.bytesWritten": { "id": "net.Socket.bytesWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The amount of bytes sent.", "short_description": "The amount of bytes sent.", "ellipsis_description": "The amount of bytes sent. ...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bytesWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L485", "name": "bytesWritten", "path": "net.Socket.bytesWritten" }, "net.Socket@connect": { "id": "net.Socket@connect", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connect()`]].", "short_description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connect()`]].", "ellipsis_description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connec...", "line": 494, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L494", "name": "connect", "path": "net.Socket.event.connect" }, "net.Socket@data": { "id": "net.Socket@data", "type": "event", "signatures": [ { "args": [ { "name": "data", "types": [ "Buffer", "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "Buffer", "String" ], "description": "A `Buffer` or `String`, depending on what it is" } ], "description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n\nFor more information, see the [[streams.ReadableStream ReadableStream]] section.", "short_description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n", "ellipsis_description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n ...", "line": 505, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L505", "name": "data", "path": "net.Socket.event.data" }, "net.Socket@end": { "id": "net.Socket@end", "type": "event", "signatures": [ { "args": [] } ], "description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pending write queue. However, by setting\n`allowHalfOpen == true` the socket won't automatically `end()` its side,\nallowing the user to write arbitrary amounts of data, with the caveat that the\nuser is required to `end()` their side now.\n\nEmitted when the other end of the socket sends a FIN packet.", "short_description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pending write queue. However, by setting\n`allowHalfOpen == true` the socket won't automatically `end()` its side,\nallowing the user to write arbitrary amounts of data, with the caveat that the\nuser is required to `end()` their side now.\n", "ellipsis_description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pend...", "line": 518, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L518", "name": "end", "path": "net.Socket.event.end" }, "net.Socket.timeout": { "id": "net.Socket.timeout", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Socket.setTimeout)\n\nEmitted if the socket times out from inactivity. This is only to notify that the\nsocket has been idle. The user must manually close the connection.", "short_description": "(related to: net.Socket.setTimeout)\n", "ellipsis_description": "(related to: net.Socket.setTimeout)\n ...", "line": 529, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.timeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L529", "name": "timeout", "path": "net.Socket.timeout" }, "net.Socket.drain": { "id": "net.Socket.drain", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Socket.write)\n\nEmitted when the write buffer becomes empty. Can be used to throttle uploads.", "short_description": "(related to: net.Socket.write)\n", "ellipsis_description": "(related to: net.Socket.write)\n ...", "line": 539, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.drain", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L539", "name": "drain", "path": "net.Socket.drain" }, "net.Socket.error": { "id": "net.Socket.error", "type": "class method", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "Any exceptions encountered" } ], "description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event.", "short_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event.", "ellipsis_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. ...", "line": 548, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L548", "name": "error", "path": "net.Socket.error" }, "net.Socket.close": { "id": "net.Socket.close", "type": "class method", "signatures": [ { "args": [ { "name": "had_error", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "had_error", "types": [ "Boolean" ], "description": "A `true` boolean if the socket was closed due to a transmission error" } ], "description": "Emitted once the socket is fully closed.", "short_description": "Emitted once the socket is fully closed.", "ellipsis_description": "Emitted once the socket is fully closed. ...", "line": 557, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L557", "name": "close", "path": "net.Socket.close" }, "os": { "id": "os", "type": "class", "description": "\nThis provides a way to retrieve various information about the underlaying\noperating system. Add `require('os')` in your code to access this module.\n\n#### Example\n\n", "stability": "4 - API Frozen", "short_description": "\nThis provides a way to retrieve various information about the underlaying\noperating system. Add `require('os')` in your code to access this module.\n", "ellipsis_description": "\nThis provides a way to retrieve various information about the underlaying\noperating system. Add `require('os')` in ...", "line": 15, "aliases": [], "children": [ { "id": "os.arch", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system CPU architecture.", "short_description": "Returns the operating system CPU architecture.", "ellipsis_description": "Returns the operating system CPU architecture. ...", "line": 23, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.arch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L23", "name": "arch", "path": "os.arch" }, { "id": "os.cpus", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": [ "Object" ], "array": true } ] } ], "description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and times (an object containing the number\nof CPU ticks spent in: user, nice, sys, idle, and irq).\n\n#### Example\n\nExample inspection of os.cpus:\n\n [ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 252020,\n nice: 0,\n sys: 30340,\n idle: 1070356870,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 306960,\n nice: 0,\n sys: 26980,\n idle: 1071569080,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 248450,\n nice: 0,\n sys: 21750,\n idle: 1070919370,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 256880,\n nice: 0,\n sys: 19430,\n idle: 1070905480,\n irq: 20 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 511580,\n nice: 20,\n sys: 40900,\n idle: 1070842510,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 291660,\n nice: 0,\n sys: 34360,\n idle: 1070888000,\n irq: 10 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 308260,\n nice: 0,\n sys: 55410,\n idle: 1071129970,\n irq: 880 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 266450,\n nice: 1480,\n sys: 34920,\n idle: 1072572010,\n irq: 30 } } ]", "short_description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and times (an object containing the number\nof CPU ticks spent in: user, nice, sys, idle, and irq).\n", "ellipsis_description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and tim...", "line": 103, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.cpus", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L103", "name": "cpus", "path": "os.cpus" }, { "id": "os.freemem", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the amount of free system memory in bytes.", "short_description": "Returns the amount of free system memory in bytes.", "ellipsis_description": "Returns the amount of free system memory in bytes. ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.freemem", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L114", "name": "freemem", "path": "os.freemem" }, { "id": "os.hostname", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the hostname of the operating system.", "short_description": "Returns the hostname of the operating system.", "ellipsis_description": "Returns the hostname of the operating system. ...", "line": 125, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.hostname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L125", "name": "hostname", "path": "os.hostname" }, { "id": "os.loadavg", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": [ "Number" ], "array": true } ] } ], "description": "Returns an array containing the 1, 5, and 15 minute load averages.", "short_description": "Returns an array containing the 1, 5, and 15 minute load averages.", "ellipsis_description": "Returns an array containing the 1, 5, and 15 minute load averages. ...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.loadavg", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L162", "name": "loadavg", "path": "os.loadavg" }, { "id": "os.networkInterfaces", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns a list of network interfaces.\n\n#### Example\n\n { lo0:\n [ { address: '::1', family: 'IPv6', internal: true },\n { address: 'fe80::1', family: 'IPv6', internal: true },\n { address: '127.0.0.1', family: 'IPv4', internal: true } ],\n en1:\n [ { address: 'fe80::cabc:c8ff:feef:f996', family: 'IPv6',\n internal: false },\n { address: '10.0.1.123', family: 'IPv4', internal: false } ],\n vmnet1: [ { address: '10.99.99.254', family: 'IPv4', internal: false } ],\n vmnet8: [ { address: '10.88.88.1', family: 'IPv4', internal: false } ],\n ppp0: [ { address: '10.2.0.231', family: 'IPv4', internal: false } ] }", "short_description": "Returns a list of network interfaces.\n", "ellipsis_description": "Returns a list of network interfaces.\n ...", "line": 151, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.networkInterfaces", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L151", "name": "networkInterfaces", "path": "os.networkInterfaces" }, { "id": "os.platform", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system platform.", "short_description": "Returns the operating system platform.", "ellipsis_description": "Returns the operating system platform. ...", "line": 173, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.platform", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L173", "name": "platform", "path": "os.platform" }, { "id": "os.release", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system release.", "short_description": "Returns the operating system release.", "ellipsis_description": "Returns the operating system release. ...", "line": 184, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.release", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L184", "name": "release", "path": "os.release" }, { "id": "os.totalmem", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the total amount of system memory in bytes.", "short_description": "Returns the total amount of system memory in bytes.", "ellipsis_description": "Returns the total amount of system memory in bytes. ...", "line": 194, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.totalmem", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L194", "name": "totalmem", "path": "os.totalmem" }, { "id": "os.type", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system name.", "short_description": "Returns the operating system name.", "ellipsis_description": "Returns the operating system name. ...", "line": 204, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.type", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L204", "name": "type", "path": "os.type" }, { "id": "os.uptime", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the system uptime in seconds.", "short_description": "Returns the system uptime in seconds.", "ellipsis_description": "Returns the system uptime in seconds. ...", "line": 214, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.uptime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L214", "name": "uptime", "path": "os.uptime" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L15", "name": "os", "path": "os" }, "os.arch": { "id": "os.arch", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system CPU architecture.", "short_description": "Returns the operating system CPU architecture.", "ellipsis_description": "Returns the operating system CPU architecture. ...", "line": 23, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.arch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L23", "name": "arch", "path": "os.arch" }, "os.cpus": { "id": "os.cpus", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": [ "Object" ], "array": true } ] } ], "description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and times (an object containing the number\nof CPU ticks spent in: user, nice, sys, idle, and irq).\n\n#### Example\n\nExample inspection of os.cpus:\n\n [ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 252020,\n nice: 0,\n sys: 30340,\n idle: 1070356870,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 306960,\n nice: 0,\n sys: 26980,\n idle: 1071569080,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 248450,\n nice: 0,\n sys: 21750,\n idle: 1070919370,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 256880,\n nice: 0,\n sys: 19430,\n idle: 1070905480,\n irq: 20 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 511580,\n nice: 20,\n sys: 40900,\n idle: 1070842510,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 291660,\n nice: 0,\n sys: 34360,\n idle: 1070888000,\n irq: 10 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 308260,\n nice: 0,\n sys: 55410,\n idle: 1071129970,\n irq: 880 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 266450,\n nice: 1480,\n sys: 34920,\n idle: 1072572010,\n irq: 30 } } ]", "short_description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and times (an object containing the number\nof CPU ticks spent in: user, nice, sys, idle, and irq).\n", "ellipsis_description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and tim...", "line": 103, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.cpus", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L103", "name": "cpus", "path": "os.cpus" }, "os.freemem": { "id": "os.freemem", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the amount of free system memory in bytes.", "short_description": "Returns the amount of free system memory in bytes.", "ellipsis_description": "Returns the amount of free system memory in bytes. ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.freemem", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L114", "name": "freemem", "path": "os.freemem" }, "os.hostname": { "id": "os.hostname", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the hostname of the operating system.", "short_description": "Returns the hostname of the operating system.", "ellipsis_description": "Returns the hostname of the operating system. ...", "line": 125, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.hostname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L125", "name": "hostname", "path": "os.hostname" }, "os.networkInterfaces": { "id": "os.networkInterfaces", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns a list of network interfaces.\n\n#### Example\n\n { lo0:\n [ { address: '::1', family: 'IPv6', internal: true },\n { address: 'fe80::1', family: 'IPv6', internal: true },\n { address: '127.0.0.1', family: 'IPv4', internal: true } ],\n en1:\n [ { address: 'fe80::cabc:c8ff:feef:f996', family: 'IPv6',\n internal: false },\n { address: '10.0.1.123', family: 'IPv4', internal: false } ],\n vmnet1: [ { address: '10.99.99.254', family: 'IPv4', internal: false } ],\n vmnet8: [ { address: '10.88.88.1', family: 'IPv4', internal: false } ],\n ppp0: [ { address: '10.2.0.231', family: 'IPv4', internal: false } ] }", "short_description": "Returns a list of network interfaces.\n", "ellipsis_description": "Returns a list of network interfaces.\n ...", "line": 151, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.networkInterfaces", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L151", "name": "networkInterfaces", "path": "os.networkInterfaces" }, "os.loadavg": { "id": "os.loadavg", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": [ "Number" ], "array": true } ] } ], "description": "Returns an array containing the 1, 5, and 15 minute load averages.", "short_description": "Returns an array containing the 1, 5, and 15 minute load averages.", "ellipsis_description": "Returns an array containing the 1, 5, and 15 minute load averages. ...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.loadavg", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L162", "name": "loadavg", "path": "os.loadavg" }, "os.platform": { "id": "os.platform", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system platform.", "short_description": "Returns the operating system platform.", "ellipsis_description": "Returns the operating system platform. ...", "line": 173, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.platform", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L173", "name": "platform", "path": "os.platform" }, "os.release": { "id": "os.release", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system release.", "short_description": "Returns the operating system release.", "ellipsis_description": "Returns the operating system release. ...", "line": 184, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.release", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L184", "name": "release", "path": "os.release" }, "os.totalmem": { "id": "os.totalmem", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the total amount of system memory in bytes.", "short_description": "Returns the total amount of system memory in bytes.", "ellipsis_description": "Returns the total amount of system memory in bytes. ...", "line": 194, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.totalmem", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L194", "name": "totalmem", "path": "os.totalmem" }, "os.type": { "id": "os.type", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system name.", "short_description": "Returns the operating system name.", "ellipsis_description": "Returns the operating system name. ...", "line": 204, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.type", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L204", "name": "type", "path": "os.type" }, "os.uptime": { "id": "os.uptime", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the system uptime in seconds.", "short_description": "Returns the system uptime in seconds.", "ellipsis_description": "Returns the system uptime in seconds. ...", "line": 214, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.uptime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L214", "name": "uptime", "path": "os.uptime" }, "path": { "id": "path", "type": "class", "description": "\nThis module contains utilities for handling and transforming file paths. Add\n`require('path')` to your code to use this module.\n\nAlmost all these methods perform only string transformations. **The file system\nis not consulted to check whether paths are valid.** `path.exists` and\n`path.existsSync` are the exceptions, and should logically be found in the fs\nmodule as they do access the file system.\n\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThis module contains utilities for handling and transforming file paths. Add\n`require('path')` to your code to use this module.\n", "ellipsis_description": "\nThis module contains utilities for handling and transforming file paths. Add\n`require('path')` to your code to use ...", "line": 21, "aliases": [], "children": [ { "id": "path.basename", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] }, { "name": "ext", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" }, { "name": "ext", "types": [ "String" ], "description": "If provided, the extension to omit", "optional": true } ], "description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.ht\nml) command.\n\n#### Example\n\n", "short_description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.ht\nml) command.\n", "ellipsis_description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/page...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.basename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L146", "name": "basename", "path": "path.basename" }, { "id": "path.dirname", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" } ], "description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.htm\nl) command.\n\n#### Example\n\n", "short_description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.htm\nl) command.\n", "ellipsis_description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pag...", "line": 129, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.dirname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L129", "name": "dirname", "path": "path.dirname" }, { "id": "path.exists", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "exists", "type": [ "Boolean" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "exists", "type": [ "Boolean" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path to check" }, { "name": "callback", "types": [ "Function" ], "description": "A callback to execute once the method completes", "optional": true }, { "name": "exists", "types": [ "Boolean" ], "description": "This is `true` if the path actually exists" } ], "description": "Tests whether or not the given path exists by checking with the file system.\n\n#### Example\n\n", "short_description": "Tests whether or not the given path exists by checking with the file system.\n", "ellipsis_description": "Tests whether or not the given path exists by checking with the file system.\n ...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.exists", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L178", "name": "exists", "path": "path.exists" }, { "id": "path.existsSync", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path to check" } ], "description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n\n#### Returns\n`true` if the path exists, `false` otherwise.", "short_description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n", "ellipsis_description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n ...", "line": 192, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.existsSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L192", "name": "existsSync", "path": "path.existsSync" }, { "id": "path.extname", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" } ], "description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is no '.' in the last portion of the path or the\nfirst character of it is '.', then the method returns an empty string.\n\n#### Examples\n\n", "short_description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is no '.' in the last portion of the path or the\nfirst character of it is '.', then the method returns an empty string.\n", "ellipsis_description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is n...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.extname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L162", "name": "extname", "path": "path.extname" }, { "id": "path.join", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] }, { "name": "paths", "ellipsis": true, "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The first path to join" }, { "name": "path2", "types": [ "String" ], "description": "The second path to join" }, { "name": "paths", "types": [ "String" ], "description": "Additional paths to join", "optional": true } ], "description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n\n#### Example\n\n", "short_description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n", "ellipsis_description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n ...", "line": 55, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.join", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L55", "name": "join", "path": "path.join" }, { "id": "path.normalize", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "The path to normalize" } ], "description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n\nWhen multiple slashes are found, they're replaced by a single one; when the path\ncontains a trailing slash, it is preserved. On Windows backslashes are used.\n\n#### Example\n\n", "short_description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n", "ellipsis_description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n ...", "line": 38, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.normalize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L38", "name": "normalize", "path": "path.normalize" }, { "id": "path.relative", "type": "class method", "signatures": [ { "args": [ { "name": "from", "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "The starting path" }, { "name": "to", "types": [ "String" ], "description": "To final path" } ], "description": "Solve the relative path from `from` to `to`.\n\nAt times, you have two absolute paths, and you need to derive the relative path\nfrom one to the other. This is actually the reverse transform of [[path.resolve\n`path.resolve()`]], which means you'll see that:\n\n path.resolve(from, path.relative(from, to)) == path.resolve(to)\n\n#### Example\n\n", "short_description": "Solve the relative path from `from` to `to`.\n", "ellipsis_description": "Solve the relative path from `from` to `to`.\n ...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.relative", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L113", "name": "relative", "path": "path.relative" }, { "id": "path.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "from", "ellipsis": true, "optional": true, "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "Paths to prepend (and append) to `to`", "optional": true }, { "name": "to", "types": [ "String" ], "description": "The path to resolve" } ], "description": "Resolves `to` to an absolute path.\n\nIf `to` isn't already absolute, the `from` arguments are prepended in right to\nleft order, until an absolute path is found. If, after using all the `from`\npaths still no absolute path is found, the current working directory is used as\nwell. The resulting path is normalized, and trailing slashes are removed unless\nthe path gets resolved to the root directory. Non-string arguments are ignored.\n\nAnother way to think of it is as a sequence of `cd` commands in a shell. The\nfollowing call:\n\n path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')\n\nis similar to:\n\n cd foo/bar\n cd /tmp/file/\n cd ..\n cd a/../subfile\n pwd\n\nThe difference is that the different paths don't need to exist and may also be\nfiles.\n\n#### Examples\n\n", "short_description": "Resolves `to` to an absolute path.\n", "ellipsis_description": "Resolves `to` to an absolute path.\n ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L92", "name": "resolve", "path": "path.resolve" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L21", "name": "path", "path": "path" }, "path.normalize": { "id": "path.normalize", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "The path to normalize" } ], "description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n\nWhen multiple slashes are found, they're replaced by a single one; when the path\ncontains a trailing slash, it is preserved. On Windows backslashes are used.\n\n#### Example\n\n", "short_description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n", "ellipsis_description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n ...", "line": 38, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.normalize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L38", "name": "normalize", "path": "path.normalize" }, "path.join": { "id": "path.join", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] }, { "name": "paths", "ellipsis": true, "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The first path to join" }, { "name": "path2", "types": [ "String" ], "description": "The second path to join" }, { "name": "paths", "types": [ "String" ], "description": "Additional paths to join", "optional": true } ], "description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n\n#### Example\n\n", "short_description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n", "ellipsis_description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n ...", "line": 55, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.join", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L55", "name": "join", "path": "path.join" }, "path.resolve": { "id": "path.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "from", "ellipsis": true, "optional": true, "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "Paths to prepend (and append) to `to`", "optional": true }, { "name": "to", "types": [ "String" ], "description": "The path to resolve" } ], "description": "Resolves `to` to an absolute path.\n\nIf `to` isn't already absolute, the `from` arguments are prepended in right to\nleft order, until an absolute path is found. If, after using all the `from`\npaths still no absolute path is found, the current working directory is used as\nwell. The resulting path is normalized, and trailing slashes are removed unless\nthe path gets resolved to the root directory. Non-string arguments are ignored.\n\nAnother way to think of it is as a sequence of `cd` commands in a shell. The\nfollowing call:\n\n path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')\n\nis similar to:\n\n cd foo/bar\n cd /tmp/file/\n cd ..\n cd a/../subfile\n pwd\n\nThe difference is that the different paths don't need to exist and may also be\nfiles.\n\n#### Examples\n\n", "short_description": "Resolves `to` to an absolute path.\n", "ellipsis_description": "Resolves `to` to an absolute path.\n ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L92", "name": "resolve", "path": "path.resolve" }, "path.relative": { "id": "path.relative", "type": "class method", "signatures": [ { "args": [ { "name": "from", "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "The starting path" }, { "name": "to", "types": [ "String" ], "description": "To final path" } ], "description": "Solve the relative path from `from` to `to`.\n\nAt times, you have two absolute paths, and you need to derive the relative path\nfrom one to the other. This is actually the reverse transform of [[path.resolve\n`path.resolve()`]], which means you'll see that:\n\n path.resolve(from, path.relative(from, to)) == path.resolve(to)\n\n#### Example\n\n", "short_description": "Solve the relative path from `from` to `to`.\n", "ellipsis_description": "Solve the relative path from `from` to `to`.\n ...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.relative", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L113", "name": "relative", "path": "path.relative" }, "path.dirname": { "id": "path.dirname", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" } ], "description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.htm\nl) command.\n\n#### Example\n\n", "short_description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.htm\nl) command.\n", "ellipsis_description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pag...", "line": 129, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.dirname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L129", "name": "dirname", "path": "path.dirname" }, "path.basename": { "id": "path.basename", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] }, { "name": "ext", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" }, { "name": "ext", "types": [ "String" ], "description": "If provided, the extension to omit", "optional": true } ], "description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.ht\nml) command.\n\n#### Example\n\n", "short_description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.ht\nml) command.\n", "ellipsis_description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/page...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.basename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L146", "name": "basename", "path": "path.basename" }, "path.extname": { "id": "path.extname", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" } ], "description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is no '.' in the last portion of the path or the\nfirst character of it is '.', then the method returns an empty string.\n\n#### Examples\n\n", "short_description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is no '.' in the last portion of the path or the\nfirst character of it is '.', then the method returns an empty string.\n", "ellipsis_description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is n...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.extname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L162", "name": "extname", "path": "path.extname" }, "path.exists": { "id": "path.exists", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "exists", "type": [ "Boolean" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "exists", "type": [ "Boolean" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path to check" }, { "name": "callback", "types": [ "Function" ], "description": "A callback to execute once the method completes", "optional": true }, { "name": "exists", "types": [ "Boolean" ], "description": "This is `true` if the path actually exists" } ], "description": "Tests whether or not the given path exists by checking with the file system.\n\n#### Example\n\n", "short_description": "Tests whether or not the given path exists by checking with the file system.\n", "ellipsis_description": "Tests whether or not the given path exists by checking with the file system.\n ...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.exists", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L178", "name": "exists", "path": "path.exists" }, "path.existsSync": { "id": "path.existsSync", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path to check" } ], "description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n\n#### Returns\n`true` if the path exists, `false` otherwise.", "short_description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n", "ellipsis_description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n ...", "line": 192, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.existsSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L192", "name": "existsSync", "path": "path.existsSync" }, "process": { "id": "process", "type": "class", "metadata": { "type": "global" }, "description": "The `process` object is a global object, and can be accessed from anywhere. It\nis an instance of [[eventemitter `EventEmitter`]].\n\n\n#### Example: Handling Signal Events\n\nSignal events are emitted when processes receive a signal. See\n[sigaction(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/sigaction.2\n.html) for a list of standard POSIX signal names such as SIGINT, SIGUSR1, etc.\n\n#### Example: Listening for `SIGINT`:\n\n", "short_description": "The `process` object is a global object, and can be accessed from anywhere. It\nis an instance of [[eventemitter `EventEmitter`]].\n", "ellipsis_description": "The `process` object is a global object, and can be accessed from anywhere. It\nis an instance of [[eventemitter `Eve...", "line": 21, "aliases": [], "children": [ { "id": "process.arch", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n\n#### Example\n\n", "short_description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n", "ellipsis_description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n ...", "line": 290, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.arch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L290", "name": "arch", "path": "process.arch" }, { "id": "process.argv", "type": "class property", "signatures": [ { "returns": [ { "type": "Array" } ] } ], "description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of the Javascript file. The next elements\nwill be any additional command line arguments.\n\n#### Example\n\nFirst, create a file called process.argv.js:\n\n\n\nThen, using the Node.js REPL, type the following command:\n\n $ node process-2.js one two=three four\n\nYou should see the following results:\n\n 0: node\n 1: /process.js\n 2: one\n 3: two=three\n 4: four", "short_description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of the Javascript file. The next elements\nwill be any additional command line arguments.\n", "ellipsis_description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of ...", "line": 320, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.argv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L320", "name": "argv", "path": "process.argv" }, { "id": "process.chdir", "type": "class method", "signatures": [ { "args": [ { "name": "directory", "types": [ "String" ] } ] } ], "arguments": [ { "name": "directory", "types": [ "String" ], "description": "The directory name to change to" } ], "description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n\n#### Example\n\n console.log('Starting at directory: ' + process.cwd());\n try {\n process.chdir('/tmp');\n console.log('New directory: ' + process.cwd());\n }\n catch (err) {\n console.log('chdir failed: ' + err);\n }", "short_description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n", "ellipsis_description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n ...", "line": 86, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.chdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L86", "name": "chdir", "path": "process.chdir" }, { "id": "process.cwd", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the current working directory of the process. For example:\n\n console.log('Current directory: ' + process.cwd());", "short_description": "Returns the current working directory of the process. For example:\n", "ellipsis_description": "Returns the current working directory of the process. For example:\n ...", "line": 99, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.cwd", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L99", "name": "cwd", "path": "process.cwd" }, { "id": "process.env", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/online/pages/man7/environ.7.html).", "short_description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/online/pages/man7/environ.7.html).", "ellipsis_description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/on...", "line": 443, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.env", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L443", "name": "env", "path": "process.env" }, { "id": "process.execPath", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "This is the absolute pathname of the executable that started the process.\n\n#### Example\n\n", "short_description": "This is the absolute pathname of the executable that started the process.\n", "ellipsis_description": "This is the absolute pathname of the executable that started the process.\n ...", "line": 333, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.execPath", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L333", "name": "execPath", "path": "process.execPath" }, { "id": "process.exit", "type": "class method", "signatures": [ { "args": [ { "name": "code", "default_value": 0, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "code", "types": [ "Number" ], "description": "The code to end with" } ], "description": "Ends the process with the specified `code`.\n\n#### Example: Exiting with a 'failure' code:\n\n process.exit(1);\n\nThe shell that executed this should see the exit code as `1`.", "short_description": "Ends the process with the specified `code`.\n", "ellipsis_description": "Ends the process with the specified `code`.\n ...", "line": 116, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L116", "name": "exit", "path": "process.exit" }, { "id": "process.getgid", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, see\n[getgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getgid.2.html).\n\n#### Example\n\n", "short_description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, see\n[getgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getgid.2.html).\n", "ellipsis_description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, se...", "line": 132, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.getgid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L132", "name": "getgid", "path": "process.getgid" }, { "id": "process.getuid", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more information, see\n[getuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getuid.2.html).\n\n#### Example\n\n", "short_description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more information, see\n[getuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getuid.2.html).\n", "ellipsis_description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more informatio...", "line": 148, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.getuid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L148", "name": "getuid", "path": "process.getuid" }, { "id": "process.installPrefix", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A compiled-in property that exposes the `NODE_PREFIX`.\n\n#### Example\n\n", "short_description": "A compiled-in property that exposes the `NODE_PREFIX`.\n", "ellipsis_description": "A compiled-in property that exposes the `NODE_PREFIX`.\n ...", "line": 417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.installPrefix", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L417", "name": "installPrefix", "path": "process.installPrefix" }, { "id": "process.kill", "type": "class method", "signatures": [ { "args": [ { "name": "pid", "types": [ "Number" ] }, { "name": "signal", "default_value": "SIGTERM", "types": [ "String" ] } ] } ], "arguments": [ { "name": "pid", "types": [ "Number" ], "description": "The process id to kill" }, { "name": "signal", "types": [ "String" ], "description": "A string describing the signal to send; the default is `SIGTERM`." } ], "description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[kill(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n\nNote: Just because the name of this function is `process.kill`, it is really just a signal sender, like the `kill` system call. The signal sent may do something other than kill the target process.\n\n#### Example: Sending a signal to yourself\n\n process.on('SIGHUP', function () {\n console.log('Got SIGHUP signal.');\n });\n\n setTimeout(function () {\n console.log('Exiting.');\n process.exit(0);\n }, 100);\n\n process.kill(process.pid, 'SIGHUP');", "short_description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[kill(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n", "ellipsis_description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[ki...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.kill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L178", "name": "kill", "path": "process.kill" }, { "id": "process.memoryUsage", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n\n#### Example\n\n\n\nThis generates:\n\n { rss: 4935680,\n heapTotal: 1826816,\n heapUsed: 650472 }\n\nIn this object, `heapTotal` and `heapUsed` refer to V8's memory usage.", "short_description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n", "ellipsis_description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n ...", "line": 201, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.memoryUsage", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L201", "name": "memoryUsage", "path": "process.memoryUsage" }, { "id": "process.nextTick", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "The callback function to execute on the next tick" } ], "description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it's much more efficient.\n\n#### Example\n\n", "short_description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it's much more efficient.\n", "ellipsis_description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it...", "line": 216, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.nextTick", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L216", "name": "nextTick", "path": "process.nextTick" }, { "id": "process.pid", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Returns the PID of the process.\n\n#### Example\n\n", "short_description": "Returns the PID of the process.\n", "ellipsis_description": "Returns the PID of the process.\n ...", "line": 346, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.pid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L346", "name": "pid", "path": "process.pid" }, { "id": "process.platform", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n\n#### Example\n\n", "short_description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n", "ellipsis_description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n ...", "line": 359, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.platform", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L359", "name": "platform", "path": "process.platform" }, { "id": "process.setgid", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "id", "types": [ "Number" ], "description": "The new identity for the group process" } ], "description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is specified, this method blocks while\nresolving it to a numerical ID. For more information, see\n[setgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setgid.2.html).\n\n#### Example\n\n", "short_description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is specified, this method blocks while\nresolving it to a numerical ID. For more information, see\n[setgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setgid.2.html).\n", "ellipsis_description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is ...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.setgid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L233", "name": "setgid", "path": "process.setgid" }, { "id": "process.setuid", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "id", "types": [ "Number" ], "description": "The new identity for the user process" } ], "description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is specified, this method blocks while resolving\nit to a numerical ID. For more information, see\n[setuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setuid.2.html).\n\n#### Example\n\n", "short_description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is specified, this method blocks while resolving\nit to a numerical ID. For more information, see\n[setuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setuid.2.html).\n", "ellipsis_description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is sp...", "line": 250, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.setuid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L250", "name": "setuid", "path": "process.setuid" }, { "id": "process.stderr", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.WriteStream" } ] } ], "description": "A writable stream to stderr.\n\n`process.stderr` and `process.stdout` are unlike other streams in Node.js in\nthat writes to them are usually blocking. They are blocking in the case that\nthey refer to regular files or TTY file descriptors. In the case they refer to\npipes, they are non-blocking like other streams.", "short_description": "A writable stream to stderr.\n", "ellipsis_description": "A writable stream to stderr.\n ...", "line": 432, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stderr", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L432", "name": "stderr", "path": "process.stderr" }, { "id": "process.stdin", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.ReadStream" } ] } ], "description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to read from it.\n\n#### Example\n\nHere's an example of opening standard input and listening for both events:\n\n", "short_description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to read from it.\n", "ellipsis_description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to r...", "line": 459, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stdin", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L459", "name": "stdin", "path": "process.stdin" }, { "id": "process.stdout", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.WriteStream" } ] } ], "description": "A writable stream to `stdout`.\n\n`process.stderr` and `process.stdout` are unlike other streams in Node.js in\nthat writes to them are usually blocking. They are blocking in the case that\nthey refer to regular files or TTY file descriptors. In the case they refer to\npipes, they are non-blocking like other streams.\n\nAs an aside, here's what the innards of `console.log()` look like:\n\n console.log (d) {\n process.stdout.write(d + '\\n');\n };", "short_description": "A writable stream to `stdout`.\n", "ellipsis_description": "A writable stream to `stdout`.\n ...", "line": 481, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stdout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L481", "name": "stdout", "path": "process.stdout" }, { "id": "process.title", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A getter and setter to set what is displayed in `ps`.", "short_description": "A getter and setter to set what is displayed in `ps`.", "ellipsis_description": "A getter and setter to set what is displayed in `ps`. ...", "line": 368, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.title", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L368", "name": "title", "path": "process.title" }, { "id": "process.umask", "type": "class method", "signatures": [ { "args": [ { "name": "mask", "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "mask", "types": [ "Number" ], "description": "The mode creation mask to get or set", "optional": true } ], "description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Returns the old mask if `mask` argument is given,\notherwise returns the current mask.\n\n#### Example\n\n", "short_description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Returns the old mask if `mask` argument is given,\notherwise returns the current mask.\n", "ellipsis_description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Retur...", "line": 266, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.umask", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L266", "name": "umask", "path": "process.umask" }, { "id": "process.uptime", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the number of seconds Node.js has been running.", "short_description": "Returns the number of seconds Node.js has been running.", "ellipsis_description": "Returns the number of seconds Node.js has been running. ...", "line": 276, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.uptime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L276", "name": "uptime", "path": "process.uptime" }, { "id": "process.version", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A compiled-in property that exposes the `NODE_VERSION`.\n\n#### Example\n\n", "short_description": "A compiled-in property that exposes the `NODE_VERSION`.\n", "ellipsis_description": "A compiled-in property that exposes the `NODE_VERSION`.\n ...", "line": 381, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.version", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L381", "name": "version", "path": "process.version" }, { "id": "process.versions", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "A property exposing version strings of Node.js and its dependencies.\n\n#### Example\n\nThe following code:\n\n\n\noutputs something similar to:\n\n { node: '0.4.12',\n v8: '3.1.8.26',\n ares: '1.7.4',\n ev: '4.4',\n openssl: '1.0.0e-fips' }", "short_description": "A property exposing version strings of Node.js and its dependencies.\n", "ellipsis_description": "A property exposing version strings of Node.js and its dependencies.\n ...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.versions", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L404", "name": "versions", "path": "process.versions" }, { "id": "process@exit", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's state (like for unit tests). The main\nevent loop will no longer be run after the `exit` callback finishes, so timers\nmay not be scheduled.\n\n#### Example: Listening for an `'exit'` event:\n\n process.on('exit', function () {\n process.nextTick(function () {\n console.log('This will not run');\n });\n console.log('About to exit.');\n });", "short_description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's state (like for unit tests). The main\nevent loop will no longer be run after the `exit` callback finishes, so timers\nmay not be scheduled.\n", "ellipsis_description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's stat...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process@exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L43", "name": "exit", "path": "process.event.exit" }, { "id": "process@uncaughtException", "type": "event", "signatures": [ { "args": [ { "name": "err", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "err", "types": [ "Error" ], "description": "The standard Error Object" } ], "description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the default action (which is to print a\nstack trace and exit) won't occur.\n\n#### Example: Listening for an `'uncaughtException'`:\n\n\n\nNote: An `uncaughtException` is a very crude mechanism for exception handling. Using `try / catch` in your program gives you more control over your program's flow. Especially for server programs that are designed to stay running forever, `uncaughtException` can be a useful safety mechanism.", "short_description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the default action (which is to print a\nstack trace and exit) won't occur.\n", "ellipsis_description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the...", "line": 63, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process@uncaughtException", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L63", "name": "uncaughtException", "path": "process.event.uncaughtException" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L21", "name": "process", "path": "process" }, "process@exit": { "id": "process@exit", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's state (like for unit tests). The main\nevent loop will no longer be run after the `exit` callback finishes, so timers\nmay not be scheduled.\n\n#### Example: Listening for an `'exit'` event:\n\n process.on('exit', function () {\n process.nextTick(function () {\n console.log('This will not run');\n });\n console.log('About to exit.');\n });", "short_description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's state (like for unit tests). The main\nevent loop will no longer be run after the `exit` callback finishes, so timers\nmay not be scheduled.\n", "ellipsis_description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's stat...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process@exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L43", "name": "exit", "path": "process.event.exit" }, "process@uncaughtException": { "id": "process@uncaughtException", "type": "event", "signatures": [ { "args": [ { "name": "err", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "err", "types": [ "Error" ], "description": "The standard Error Object" } ], "description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the default action (which is to print a\nstack trace and exit) won't occur.\n\n#### Example: Listening for an `'uncaughtException'`:\n\n\n\nNote: An `uncaughtException` is a very crude mechanism for exception handling. Using `try / catch` in your program gives you more control over your program's flow. Especially for server programs that are designed to stay running forever, `uncaughtException` can be a useful safety mechanism.", "short_description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the default action (which is to print a\nstack trace and exit) won't occur.\n", "ellipsis_description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the...", "line": 63, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process@uncaughtException", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L63", "name": "uncaughtException", "path": "process.event.uncaughtException" }, "process.chdir": { "id": "process.chdir", "type": "class method", "signatures": [ { "args": [ { "name": "directory", "types": [ "String" ] } ] } ], "arguments": [ { "name": "directory", "types": [ "String" ], "description": "The directory name to change to" } ], "description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n\n#### Example\n\n console.log('Starting at directory: ' + process.cwd());\n try {\n process.chdir('/tmp');\n console.log('New directory: ' + process.cwd());\n }\n catch (err) {\n console.log('chdir failed: ' + err);\n }", "short_description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n", "ellipsis_description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n ...", "line": 86, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.chdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L86", "name": "chdir", "path": "process.chdir" }, "process.cwd": { "id": "process.cwd", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the current working directory of the process. For example:\n\n console.log('Current directory: ' + process.cwd());", "short_description": "Returns the current working directory of the process. For example:\n", "ellipsis_description": "Returns the current working directory of the process. For example:\n ...", "line": 99, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.cwd", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L99", "name": "cwd", "path": "process.cwd" }, "process.exit": { "id": "process.exit", "type": "class method", "signatures": [ { "args": [ { "name": "code", "default_value": 0, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "code", "types": [ "Number" ], "description": "The code to end with" } ], "description": "Ends the process with the specified `code`.\n\n#### Example: Exiting with a 'failure' code:\n\n process.exit(1);\n\nThe shell that executed this should see the exit code as `1`.", "short_description": "Ends the process with the specified `code`.\n", "ellipsis_description": "Ends the process with the specified `code`.\n ...", "line": 116, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L116", "name": "exit", "path": "process.exit" }, "process.getgid": { "id": "process.getgid", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, see\n[getgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getgid.2.html).\n\n#### Example\n\n", "short_description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, see\n[getgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getgid.2.html).\n", "ellipsis_description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, se...", "line": 132, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.getgid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L132", "name": "getgid", "path": "process.getgid" }, "process.getuid": { "id": "process.getuid", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more information, see\n[getuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getuid.2.html).\n\n#### Example\n\n", "short_description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more information, see\n[getuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getuid.2.html).\n", "ellipsis_description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more informatio...", "line": 148, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.getuid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L148", "name": "getuid", "path": "process.getuid" }, "process.kill": { "id": "process.kill", "type": "class method", "signatures": [ { "args": [ { "name": "pid", "types": [ "Number" ] }, { "name": "signal", "default_value": "SIGTERM", "types": [ "String" ] } ] } ], "arguments": [ { "name": "pid", "types": [ "Number" ], "description": "The process id to kill" }, { "name": "signal", "types": [ "String" ], "description": "A string describing the signal to send; the default is `SIGTERM`." } ], "description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[kill(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n\nNote: Just because the name of this function is `process.kill`, it is really just a signal sender, like the `kill` system call. The signal sent may do something other than kill the target process.\n\n#### Example: Sending a signal to yourself\n\n process.on('SIGHUP', function () {\n console.log('Got SIGHUP signal.');\n });\n\n setTimeout(function () {\n console.log('Exiting.');\n process.exit(0);\n }, 100);\n\n process.kill(process.pid, 'SIGHUP');", "short_description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[kill(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n", "ellipsis_description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[ki...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.kill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L178", "name": "kill", "path": "process.kill" }, "process.memoryUsage": { "id": "process.memoryUsage", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n\n#### Example\n\n\n\nThis generates:\n\n { rss: 4935680,\n heapTotal: 1826816,\n heapUsed: 650472 }\n\nIn this object, `heapTotal` and `heapUsed` refer to V8's memory usage.", "short_description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n", "ellipsis_description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n ...", "line": 201, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.memoryUsage", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L201", "name": "memoryUsage", "path": "process.memoryUsage" }, "process.nextTick": { "id": "process.nextTick", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "The callback function to execute on the next tick" } ], "description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it's much more efficient.\n\n#### Example\n\n", "short_description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it's much more efficient.\n", "ellipsis_description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it...", "line": 216, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.nextTick", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L216", "name": "nextTick", "path": "process.nextTick" }, "process.setgid": { "id": "process.setgid", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "id", "types": [ "Number" ], "description": "The new identity for the group process" } ], "description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is specified, this method blocks while\nresolving it to a numerical ID. For more information, see\n[setgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setgid.2.html).\n\n#### Example\n\n", "short_description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is specified, this method blocks while\nresolving it to a numerical ID. For more information, see\n[setgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setgid.2.html).\n", "ellipsis_description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is ...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.setgid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L233", "name": "setgid", "path": "process.setgid" }, "process.setuid": { "id": "process.setuid", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "id", "types": [ "Number" ], "description": "The new identity for the user process" } ], "description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is specified, this method blocks while resolving\nit to a numerical ID. For more information, see\n[setuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setuid.2.html).\n\n#### Example\n\n", "short_description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is specified, this method blocks while resolving\nit to a numerical ID. For more information, see\n[setuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setuid.2.html).\n", "ellipsis_description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is sp...", "line": 250, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.setuid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L250", "name": "setuid", "path": "process.setuid" }, "process.umask": { "id": "process.umask", "type": "class method", "signatures": [ { "args": [ { "name": "mask", "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "mask", "types": [ "Number" ], "description": "The mode creation mask to get or set", "optional": true } ], "description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Returns the old mask if `mask` argument is given,\notherwise returns the current mask.\n\n#### Example\n\n", "short_description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Returns the old mask if `mask` argument is given,\notherwise returns the current mask.\n", "ellipsis_description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Retur...", "line": 266, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.umask", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L266", "name": "umask", "path": "process.umask" }, "process.uptime": { "id": "process.uptime", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the number of seconds Node.js has been running.", "short_description": "Returns the number of seconds Node.js has been running.", "ellipsis_description": "Returns the number of seconds Node.js has been running. ...", "line": 276, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.uptime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L276", "name": "uptime", "path": "process.uptime" }, "process.arch": { "id": "process.arch", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n\n#### Example\n\n", "short_description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n", "ellipsis_description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n ...", "line": 290, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.arch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L290", "name": "arch", "path": "process.arch" }, "process.argv": { "id": "process.argv", "type": "class property", "signatures": [ { "returns": [ { "type": "Array" } ] } ], "description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of the Javascript file. The next elements\nwill be any additional command line arguments.\n\n#### Example\n\nFirst, create a file called process.argv.js:\n\n\n\nThen, using the Node.js REPL, type the following command:\n\n $ node process-2.js one two=three four\n\nYou should see the following results:\n\n 0: node\n 1: /process.js\n 2: one\n 3: two=three\n 4: four", "short_description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of the Javascript file. The next elements\nwill be any additional command line arguments.\n", "ellipsis_description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of ...", "line": 320, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.argv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L320", "name": "argv", "path": "process.argv" }, "process.execPath": { "id": "process.execPath", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "This is the absolute pathname of the executable that started the process.\n\n#### Example\n\n", "short_description": "This is the absolute pathname of the executable that started the process.\n", "ellipsis_description": "This is the absolute pathname of the executable that started the process.\n ...", "line": 333, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.execPath", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L333", "name": "execPath", "path": "process.execPath" }, "process.pid": { "id": "process.pid", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Returns the PID of the process.\n\n#### Example\n\n", "short_description": "Returns the PID of the process.\n", "ellipsis_description": "Returns the PID of the process.\n ...", "line": 346, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.pid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L346", "name": "pid", "path": "process.pid" }, "process.platform": { "id": "process.platform", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n\n#### Example\n\n", "short_description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n", "ellipsis_description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n ...", "line": 359, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.platform", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L359", "name": "platform", "path": "process.platform" }, "process.title": { "id": "process.title", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A getter and setter to set what is displayed in `ps`.", "short_description": "A getter and setter to set what is displayed in `ps`.", "ellipsis_description": "A getter and setter to set what is displayed in `ps`. ...", "line": 368, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.title", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L368", "name": "title", "path": "process.title" }, "process.version": { "id": "process.version", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A compiled-in property that exposes the `NODE_VERSION`.\n\n#### Example\n\n", "short_description": "A compiled-in property that exposes the `NODE_VERSION`.\n", "ellipsis_description": "A compiled-in property that exposes the `NODE_VERSION`.\n ...", "line": 381, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.version", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L381", "name": "version", "path": "process.version" }, "process.versions": { "id": "process.versions", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "A property exposing version strings of Node.js and its dependencies.\n\n#### Example\n\nThe following code:\n\n\n\noutputs something similar to:\n\n { node: '0.4.12',\n v8: '3.1.8.26',\n ares: '1.7.4',\n ev: '4.4',\n openssl: '1.0.0e-fips' }", "short_description": "A property exposing version strings of Node.js and its dependencies.\n", "ellipsis_description": "A property exposing version strings of Node.js and its dependencies.\n ...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.versions", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L404", "name": "versions", "path": "process.versions" }, "process.installPrefix": { "id": "process.installPrefix", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A compiled-in property that exposes the `NODE_PREFIX`.\n\n#### Example\n\n", "short_description": "A compiled-in property that exposes the `NODE_PREFIX`.\n", "ellipsis_description": "A compiled-in property that exposes the `NODE_PREFIX`.\n ...", "line": 417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.installPrefix", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L417", "name": "installPrefix", "path": "process.installPrefix" }, "process.stderr": { "id": "process.stderr", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.WriteStream" } ] } ], "description": "A writable stream to stderr.\n\n`process.stderr` and `process.stdout` are unlike other streams in Node.js in\nthat writes to them are usually blocking. They are blocking in the case that\nthey refer to regular files or TTY file descriptors. In the case they refer to\npipes, they are non-blocking like other streams.", "short_description": "A writable stream to stderr.\n", "ellipsis_description": "A writable stream to stderr.\n ...", "line": 432, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stderr", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L432", "name": "stderr", "path": "process.stderr" }, "process.env": { "id": "process.env", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/online/pages/man7/environ.7.html).", "short_description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/online/pages/man7/environ.7.html).", "ellipsis_description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/on...", "line": 443, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.env", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L443", "name": "env", "path": "process.env" }, "process.stdin": { "id": "process.stdin", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.ReadStream" } ] } ], "description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to read from it.\n\n#### Example\n\nHere's an example of opening standard input and listening for both events:\n\n", "short_description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to read from it.\n", "ellipsis_description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to r...", "line": 459, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stdin", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L459", "name": "stdin", "path": "process.stdin" }, "process.stdout": { "id": "process.stdout", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.WriteStream" } ] } ], "description": "A writable stream to `stdout`.\n\n`process.stderr` and `process.stdout` are unlike other streams in Node.js in\nthat writes to them are usually blocking. They are blocking in the case that\nthey refer to regular files or TTY file descriptors. In the case they refer to\npipes, they are non-blocking like other streams.\n\nAs an aside, here's what the innards of `console.log()` look like:\n\n console.log (d) {\n process.stdout.write(d + '\\n');\n };", "short_description": "A writable stream to `stdout`.\n", "ellipsis_description": "A writable stream to `stdout`.\n ...", "line": 481, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stdout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L481", "name": "stdout", "path": "process.stdout" }, "querystring": { "id": "querystring", "type": "class", "description": "\nThis module provides utilities for dealing with query strings in URLs. To\ninclude this module, add `require('querystring')` to your code.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThis module provides utilities for dealing with query strings in URLs. To\ninclude this module, add `require('querystring')` to your code.\n", "ellipsis_description": "\nThis module provides utilities for dealing with query strings in URLs. To\ninclude this module, add `require('querys...", "line": 15, "aliases": [], "children": [ { "id": "querystring.escape", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary.", "short_description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary.", "ellipsis_description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary. ...", "line": 26, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.escape", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L26", "name": "escape", "path": "querystring.escape" }, { "id": "querystring.parse", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] }, { "name": "sep", "default_value": "&", "optional": true, "types": [ "String" ] }, { "name": "eq", "default_value": "=", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The query string to parse" }, { "name": "sep", "types": [ "String" ], "description": "The separator character", "optional": true }, { "name": "eq", "types": [ "String" ], "description": "The equivalency character", "optional": true } ], "description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignment characters.\n\n#### Example\n\n", "short_description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignment characters.\n", "ellipsis_description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignm...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.parse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L43", "name": "parse", "path": "querystring.parse" }, { "id": "querystring.stringify", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] }, { "name": "sep", "default_value": "&", "optional": true, "types": [ "String" ] }, { "name": "eq", "default_value": "=", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "The JSON object to serialize" }, { "name": "sep", "types": [ "String" ], "description": "The separator character", "optional": true }, { "name": "eq", "types": [ "String" ], "description": "The equivalency character", "optional": true } ], "description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignment characters.\n\n#### Examples\n\n", "short_description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignment characters.\n", "ellipsis_description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignmen...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.stringify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L59", "name": "stringify", "path": "querystring.stringify" }, { "id": "querystring.unescape", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary.", "short_description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary.", "ellipsis_description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary. ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.unescape", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L71", "name": "unescape", "path": "querystring.unescape" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L15", "name": "querystring", "path": "querystring" }, "querystring.escape": { "id": "querystring.escape", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary.", "short_description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary.", "ellipsis_description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary. ...", "line": 26, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.escape", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L26", "name": "escape", "path": "querystring.escape" }, "querystring.parse": { "id": "querystring.parse", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] }, { "name": "sep", "default_value": "&", "optional": true, "types": [ "String" ] }, { "name": "eq", "default_value": "=", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The query string to parse" }, { "name": "sep", "types": [ "String" ], "description": "The separator character", "optional": true }, { "name": "eq", "types": [ "String" ], "description": "The equivalency character", "optional": true } ], "description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignment characters.\n\n#### Example\n\n", "short_description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignment characters.\n", "ellipsis_description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignm...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.parse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L43", "name": "parse", "path": "querystring.parse" }, "querystring.stringify": { "id": "querystring.stringify", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] }, { "name": "sep", "default_value": "&", "optional": true, "types": [ "String" ] }, { "name": "eq", "default_value": "=", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "The JSON object to serialize" }, { "name": "sep", "types": [ "String" ], "description": "The separator character", "optional": true }, { "name": "eq", "types": [ "String" ], "description": "The equivalency character", "optional": true } ], "description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignment characters.\n\n#### Examples\n\n", "short_description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignment characters.\n", "ellipsis_description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignmen...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.stringify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L59", "name": "stringify", "path": "querystring.stringify" }, "querystring.unescape": { "id": "querystring.unescape", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary.", "short_description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary.", "ellipsis_description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary. ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.unescape", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L71", "name": "unescape", "path": "querystring.unescape" }, "readline": { "id": "readline", "type": "class", "description": "\nReadline allows you to read of a stream (such as STDIN) on a line-by-line basis.\nTo use this module, add `require('readline')` to your code.\n\nNote: Once you've invoked this module, your Node.js program won't terminate until you've closed the interface, and the STDIN stream. Here's how to allow your program to gracefully terminate:\n\n\n\n\n#### Example: Crafting a tiny command line interface:\n\n\n\nFor more real-life use cases, take a look at this slightly more complicated\n[example](https://gist.github.com/901104), as well as the\n[http-console](https://github.com/cloudhead/http-console) module.", "stability": "3 - Stable", "short_description": "\nReadline allows you to read of a stream (such as STDIN) on a line-by-line basis.\nTo use this module, add `require('readline')` to your code.\n", "ellipsis_description": "\nReadline allows you to read of a stream (such as STDIN) on a line-by-line basis.\nTo use this module, add `require('...", "line": 24, "aliases": [], "children": [ { "id": "readline.createInterface", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "streams.ReadableStream" ] }, { "name": "output", "optional": true, "types": [ "streams.WritableStream" ] }, { "name": "completer", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "completer", "args": [], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "readline.interface" } ] } ], "arguments": [ { "name": "input", "types": [ "streams.ReadableStream" ], "description": "The readable stream" }, { "name": "output", "types": [ "streams.WritableStream" ], "description": "The writeable stream", "optional": true }, { "name": "completer", "types": [ "Function" ], "description": "A function to use for autocompletion" } ], "description": "Takes two streams and creates a readline interface.\n\nWhen passed a substring, `completer()` returns `[[substr1, substr2, ...],\noriginalsubstring]`.\n\n`completer()` runs in an asynchronous manner if it accepts just two arguments:\n\n function completer(linePartial, callback) {\n callback(null, [['123'], linePartial]);\n }\n\n#### Example\n\n`createInterface()` is commonly used with `process.stdin` and `process.stdout`\nin order to accept user input:\n\n var readline = require('readline');\n\n var myTerminal = readline.createInterface(process.stdin, process.stdout);", "short_description": "Takes two streams and creates a readline interface.\n", "ellipsis_description": "Takes two streams and creates a readline interface.\n ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.createInterface", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L54", "name": "createInterface", "path": "readline.createInterface" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline", "subclasses": [ "readline.interface" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L24", "name": "readline", "path": "readline" }, "readline.createInterface": { "id": "readline.createInterface", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "streams.ReadableStream" ] }, { "name": "output", "optional": true, "types": [ "streams.WritableStream" ] }, { "name": "completer", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "completer", "args": [], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "readline.interface" } ] } ], "arguments": [ { "name": "input", "types": [ "streams.ReadableStream" ], "description": "The readable stream" }, { "name": "output", "types": [ "streams.WritableStream" ], "description": "The writeable stream", "optional": true }, { "name": "completer", "types": [ "Function" ], "description": "A function to use for autocompletion" } ], "description": "Takes two streams and creates a readline interface.\n\nWhen passed a substring, `completer()` returns `[[substr1, substr2, ...],\noriginalsubstring]`.\n\n`completer()` runs in an asynchronous manner if it accepts just two arguments:\n\n function completer(linePartial, callback) {\n callback(null, [['123'], linePartial]);\n }\n\n#### Example\n\n`createInterface()` is commonly used with `process.stdin` and `process.stdout`\nin order to accept user input:\n\n var readline = require('readline');\n\n var myTerminal = readline.createInterface(process.stdin, process.stdout);", "short_description": "Takes two streams and creates a readline interface.\n", "ellipsis_description": "Takes two streams and creates a readline interface.\n ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.createInterface", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L54", "name": "createInterface", "path": "readline.createInterface" }, "readline.interface": { "id": "readline.interface", "type": "class", "superclass": "readline", "description": "The class that represents a readline interface with a stdin and stdout stream.", "short_description": "The class that represents a readline interface with a stdin and stdout stream.", "ellipsis_description": "The class that represents a readline interface with a stdin and stdout stream. ...", "line": 62, "aliases": [], "children": [ { "id": "readline.interface.close", "type": "class method", "signatures": [ { "args": [ { "name": "line" } ] } ], "description": "Closes the `tty`. Without this call, your program will run indefinitely.", "short_description": "Closes the `tty`. Without this call, your program will run indefinitely.", "ellipsis_description": "Closes the `tty`. Without this call, your program will run indefinitely. ...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L80", "name": "close", "path": "readline.interface.close" }, { "id": "readline.interface.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the `tty`.", "short_description": "Pauses the `tty`.", "ellipsis_description": "Pauses the `tty`. ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L71", "name": "pause", "path": "readline.interface.pause" }, { "id": "readline.interface.prompt", "type": "class method", "signatures": [ { "args": [] } ], "description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user a new spot to write.", "short_description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user a new spot to write.", "ellipsis_description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user...", "line": 91, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.prompt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L91", "name": "prompt", "path": "readline.interface.prompt" }, { "id": "readline.interface.question", "type": "class method", "signatures": [ { "args": [ { "name": "query", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "query", "types": [ "String" ], "description": "A string to display the user" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" } ], "description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n\n#### Example\n\n readline.interface.question('What is your favorite food?', function(answer)\n{\n console.log('Oh, so your favorite food is ' + answer);\n });", "short_description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n", "ellipsis_description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.question", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L112", "name": "question", "path": "readline.interface.question" }, { "id": "readline.interface.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes `tty`.", "short_description": "Resumes `tty`.", "ellipsis_description": "Resumes `tty`. ...", "line": 122, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L122", "name": "resume", "path": "readline.interface.resume" }, { "id": "readline.interface.setPrompt", "type": "class method", "signatures": [ { "args": [ { "name": "prompt", "types": [ "String" ] }, { "name": "length", "types": [ "String" ] } ] } ], "arguments": [ { "name": "prompt", "types": [ "String" ], "description": "The prompting character; this can also be a phrase" }, { "name": "length", "types": [ "String" ], "description": "The length before line wrapping" } ], "description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's prompt.", "short_description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's prompt.", "ellipsis_description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's pr...", "line": 135, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.setPrompt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L135", "name": "setPrompt", "path": "readline.interface.setPrompt" }, { "id": "readline.interface.write", "type": "class method", "signatures": [ { "args": [] } ], "description": "Writes to the `tty`.", "short_description": "Writes to the `tty`.", "ellipsis_description": "Writes to the `tty`. ...", "line": 144, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L144", "name": "write", "path": "readline.interface.write" }, { "id": "readline.interface@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is finished using your program.\n\n#### Example\n\nExample of listening for `close`, and exiting the program afterward:\n\n", "short_description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is finished using your program.\n", "ellipsis_description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is ...", "line": 161, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L161", "name": "close", "path": "readline.interface.event.close" }, { "id": "readline.interface@line", "type": "event", "signatures": [ { "args": [ { "name": "line", "types": [ "String" ] } ] } ], "arguments": [ { "name": "line", "types": [ "String" ], "description": "The line that prompted the event" } ], "description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a good hook to listen for user input.\n\n#### Example\n\n", "short_description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a good hook to listen for user input.\n", "ellipsis_description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a go...", "line": 174, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface@line", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L174", "name": "line", "path": "readline.interface.event.line" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L62", "name": "interface", "path": "readline.interface" }, "readline.interface.pause": { "id": "readline.interface.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the `tty`.", "short_description": "Pauses the `tty`.", "ellipsis_description": "Pauses the `tty`. ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L71", "name": "pause", "path": "readline.interface.pause" }, "readline.interface.close": { "id": "readline.interface.close", "type": "class method", "signatures": [ { "args": [ { "name": "line" } ] } ], "description": "Closes the `tty`. Without this call, your program will run indefinitely.", "short_description": "Closes the `tty`. Without this call, your program will run indefinitely.", "ellipsis_description": "Closes the `tty`. Without this call, your program will run indefinitely. ...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L80", "name": "close", "path": "readline.interface.close" }, "readline.interface.prompt": { "id": "readline.interface.prompt", "type": "class method", "signatures": [ { "args": [] } ], "description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user a new spot to write.", "short_description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user a new spot to write.", "ellipsis_description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user...", "line": 91, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.prompt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L91", "name": "prompt", "path": "readline.interface.prompt" }, "readline.interface.question": { "id": "readline.interface.question", "type": "class method", "signatures": [ { "args": [ { "name": "query", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "query", "types": [ "String" ], "description": "A string to display the user" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" } ], "description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n\n#### Example\n\n readline.interface.question('What is your favorite food?', function(answer)\n{\n console.log('Oh, so your favorite food is ' + answer);\n });", "short_description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n", "ellipsis_description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.question", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L112", "name": "question", "path": "readline.interface.question" }, "readline.interface.resume": { "id": "readline.interface.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes `tty`.", "short_description": "Resumes `tty`.", "ellipsis_description": "Resumes `tty`. ...", "line": 122, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L122", "name": "resume", "path": "readline.interface.resume" }, "readline.interface.setPrompt": { "id": "readline.interface.setPrompt", "type": "class method", "signatures": [ { "args": [ { "name": "prompt", "types": [ "String" ] }, { "name": "length", "types": [ "String" ] } ] } ], "arguments": [ { "name": "prompt", "types": [ "String" ], "description": "The prompting character; this can also be a phrase" }, { "name": "length", "types": [ "String" ], "description": "The length before line wrapping" } ], "description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's prompt.", "short_description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's prompt.", "ellipsis_description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's pr...", "line": 135, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.setPrompt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L135", "name": "setPrompt", "path": "readline.interface.setPrompt" }, "readline.interface.write": { "id": "readline.interface.write", "type": "class method", "signatures": [ { "args": [] } ], "description": "Writes to the `tty`.", "short_description": "Writes to the `tty`.", "ellipsis_description": "Writes to the `tty`. ...", "line": 144, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L144", "name": "write", "path": "readline.interface.write" }, "readline.interface@close": { "id": "readline.interface@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is finished using your program.\n\n#### Example\n\nExample of listening for `close`, and exiting the program afterward:\n\n", "short_description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is finished using your program.\n", "ellipsis_description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is ...", "line": 161, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L161", "name": "close", "path": "readline.interface.event.close" }, "readline.interface@line": { "id": "readline.interface@line", "type": "event", "signatures": [ { "args": [ { "name": "line", "types": [ "String" ] } ] } ], "arguments": [ { "name": "line", "types": [ "String" ], "description": "The line that prompted the event" } ], "description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a good hook to listen for user input.\n\n#### Example\n\n", "short_description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a good hook to listen for user input.\n", "ellipsis_description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a go...", "line": 174, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface@line", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L174", "name": "line", "path": "readline.interface.event.line" }, "repl": { "id": "repl", "type": "class", "description": "A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. REPL provides a way to interactively run\nJavascript and see the results. It can be used for debugging, testing, or just\ntrying things out.\n\nBy executing `node` without any arguments from the command line, you'll be\ndropped into the REPL. It has a simplistic emacs line-editing:\n\n mjr:~$ node\n Type '.help' for options.\n > a = [ 1, 2, 3];\n [ 1, 2, 3 ]\n > a.forEach(function (v) {\n ... console.log(v);\n ... });\n 1\n 2\n 3\n\nFor advanced line-editors, start `node` with the environmental variable\n`NODE_NO_READLINE=1`. This starts the REPL in canonical terminal settings which\nallow you to use with `rlwrap`.\n\nFor a quicker configuration, you could add this to your `.bashrc` file:\n\n alias node=\"env NODE_NO_READLINE=1 rlwrap node\"\n\n#### REPL Features\n\nInside the REPL, multi-line expressions can be input, and tab completion is\nsupported for both global and local variables.\n\nThe special variable `_` contains the result of the last expression, like so:\n\n > [ \"a\", \"b\", \"c\" ]\n [ 'a', 'b', 'c' ]\n > _.length\n 3\n > _ += 1\n 4\n\nThe REPL provides access to any variables in the global scope. You can expose a\nvariable to the REPL explicitly by assigning it to the `context` object\nassociated with each `REPLServer`. For example:\n\n // repl_test.js\n var repl = require(\"repl\"),\n msg = \"message\";\n\n repl.start().context.m = msg;\n\nThings in the `context` object appear as local within the REPL:\n\n mjr:~$ node repl_test.js\n > m\n 'message'\n\n#### Special Commands\n\nThere are a few special REPL commands:\n\n - `.break`: while inputting a multi-line expression, sometimes you get lost or\njust don't care about completing it; this wipes it out so you can start over\n - `.clear`: resets the `context` object to an empty object and clears any\nmulti-line expression.\n - `.exit`: closes the I/O stream, which causes the REPL to exit.\n - `.help`: shows this list of special commands\n - `.save`: save the current REPL session to a file, like so: `>.save\n./file/to/save.js`\n - `.load`: loads a file into the current REPL session, like so: `>.load\n./file/to/load.js`\n\n#### Key Combinations\n\nThe following key combinations in the REPL have special effects:\n\n - `C` - Similar to the `.break` keyword, this terminates the current\ncommand. Press twice on a blank line to forcibly exit the REPL.\n - `D` - Similar to the `.exit` keyword, it closes to stream and exits\nthe REPL", "short_description": "A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. REPL provides a way to interactively run\nJavascript and see the results. It can be used for debugging, testing, or just\ntrying things out.\n", "ellipsis_description": "A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. RE...", "line": 87, "aliases": [], "children": [ { "id": "repl.start", "type": "class method", "signatures": [ { "args": [ { "name": "prompt", "default_value": "> ", "optional": true, "types": [ "String" ] }, { "name": "stream", "default_value": "process.stdin", "optional": true, "types": [ "String" ] }, { "name": "eval", "default_value": "eval", "optional": true, "types": [ "String" ] }, { "name": "useGlobal", "default_value": false, "optional": true, "types": [ "String" ] }, { "name": "ignoreUndefined", "default_value": false, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "prompt", "types": [ "String" ], "description": "The starting prompt", "optional": true }, { "name": "stream", "types": [ "String" ], "description": "The stream to read from", "optional": true }, { "name": "eval", "types": [ "String" ], "description": "An asynchronous wrapper function that executes after each line", "optional": true }, { "name": "useGlobal", "types": [ "String" ], "description": "If `true`, then the REPL uses the global objectm instead of scripts in a separate context", "optional": true }, { "name": "ignoreUndefined", "types": [ "String" ], "description": "If `true`, the REPL won't output return valyes of a command if it's `undefined`", "optional": true } ], "description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n\nYou can use your own `eval` function if it has the following signature:\n\n function eval(cmd, callback) {\n callback(null, result);\n }\n\nMultiple REPLs can be started against the same running instance of node. Each\nshare the same global object but will have unique I/O.\n\n#### Example\n\nHere's an example that starts a REPL on stdin, a Unix socket, and a TCP socket:\n\n var net = require(\"net\"),\n repl = require(\"repl\");\n\n connections = 0;\n\n repl.start(\"node via stdin> \");\n\n net.createServer(function (socket) {\n connections += 1;\n repl.start(\"node via Unix socket> \", socket);\n }).listen(\"/tmp/node-repl-sock\");\n\n net.createServer(function (socket) {\n connections += 1;\n repl.start(\"node via TCP socket> \", socket);\n }).listen(5001);", "short_description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n", "ellipsis_description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n ...", "line": 133, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/repl.markdown", "fileName": "repl", "resultingFile": "repl.html#repl.start", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/repl.markdown#L133", "name": "start", "path": "repl.start" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/repl.markdown", "fileName": "repl", "resultingFile": "repl.html#repl", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/repl.markdown#L87", "name": "repl", "path": "repl" }, "repl.start": { "id": "repl.start", "type": "class method", "signatures": [ { "args": [ { "name": "prompt", "default_value": "> ", "optional": true, "types": [ "String" ] }, { "name": "stream", "default_value": "process.stdin", "optional": true, "types": [ "String" ] }, { "name": "eval", "default_value": "eval", "optional": true, "types": [ "String" ] }, { "name": "useGlobal", "default_value": false, "optional": true, "types": [ "String" ] }, { "name": "ignoreUndefined", "default_value": false, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "prompt", "types": [ "String" ], "description": "The starting prompt", "optional": true }, { "name": "stream", "types": [ "String" ], "description": "The stream to read from", "optional": true }, { "name": "eval", "types": [ "String" ], "description": "An asynchronous wrapper function that executes after each line", "optional": true }, { "name": "useGlobal", "types": [ "String" ], "description": "If `true`, then the REPL uses the global objectm instead of scripts in a separate context", "optional": true }, { "name": "ignoreUndefined", "types": [ "String" ], "description": "If `true`, the REPL won't output return valyes of a command if it's `undefined`", "optional": true } ], "description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n\nYou can use your own `eval` function if it has the following signature:\n\n function eval(cmd, callback) {\n callback(null, result);\n }\n\nMultiple REPLs can be started against the same running instance of node. Each\nshare the same global object but will have unique I/O.\n\n#### Example\n\nHere's an example that starts a REPL on stdin, a Unix socket, and a TCP socket:\n\n var net = require(\"net\"),\n repl = require(\"repl\");\n\n connections = 0;\n\n repl.start(\"node via stdin> \");\n\n net.createServer(function (socket) {\n connections += 1;\n repl.start(\"node via Unix socket> \", socket);\n }).listen(\"/tmp/node-repl-sock\");\n\n net.createServer(function (socket) {\n connections += 1;\n repl.start(\"node via TCP socket> \", socket);\n }).listen(5001);", "short_description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n", "ellipsis_description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n ...", "line": 133, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/repl.markdown", "fileName": "repl", "resultingFile": "repl.html#repl.start", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/repl.markdown#L133", "name": "start", "path": "repl.start" }, "console": { "id": "console", "type": "class", "metadata": { "type": "global" }, "description": "\nThese methods are useful for printing to stdout and stderr. They are similar to\nthe `console` object functions provided by most web browsers. The `console`\nobject is global, so you don't need to `require` anything.\n\nIt's important to note that printing to stdout and stderr is synchronous, and\ntherefore, blocking.", "stability": "3 - Stable", "short_description": "\nThese methods are useful for printing to stdout and stderr. They are similar to\nthe `console` object functions provided by most web browsers. The `console`\nobject is global, so you don't need to `require` anything.\n", "ellipsis_description": "\nThese methods are useful for printing to stdout and stderr. They are similar to\nthe `console` object functions prov...", "line": 16, "aliases": [], "children": [ { "id": "console.assert", "type": "class method", "signatures": [ { "args": [] } ], "description": "(alias of: assert.ok)\n\nAn alias to `assert.ok()`.", "short_description": "(alias of: assert.ok)\n", "ellipsis_description": "(alias of: assert.ok)\n ...", "line": 27, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.assert", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L27", "name": "assert", "path": "console.assert" }, { "id": "console.dir", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "An object to inspect (alias of: util.inspect)" } ], "description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr.", "short_description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr.", "ellipsis_description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr. ...", "line": 38, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.dir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L38", "name": "dir", "path": "console.dir" }, { "id": "console.error", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "An object to inspect (related to: console.log)" } ], "description": "This performs the same role as `console.log()`, but prints to stderr instead.", "short_description": "This performs the same role as `console.log()`, but prints to stderr instead.", "ellipsis_description": "This performs the same role as `console.log()`, but prints to stderr instead. ...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L59", "name": "error", "path": "console.error" }, { "id": "console.info", "type": "class method", "signatures": [ { "args": [] } ], "description": "(alias of: console.log)\n\nThis is just an alias to `console.log()`.", "short_description": "(alias of: console.log)\n", "ellipsis_description": "(alias of: console.log)\n ...", "line": 69, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.info", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L69", "name": "info", "path": "console.info" }, { "id": "console.log", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "arg", "types": [ "String" ], "description": "The string to print, and any additional formatting arguments (alias of: util.format)", "optional": true } ], "description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n\nEach placeholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n* `%s` - String.\n* `%d` - Number (both integer and float).\n* `%j` - JSON.\n* `%%` - single percent sign (`'%'`). This does not consume an argument.\n\nIf formatting elements are not found in the first string then [[util.inspect\n`util.inspect()`]] is used on each argument.\n\n#### Example\n\n", "short_description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n", "ellipsis_description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedi...", "line": 95, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.log", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L95", "name": "log", "path": "console.log" }, { "id": "console.time", "type": "class method", "signatures": [ { "args": [ { "name": "label", "types": [ "String" ] } ] } ], "arguments": [ { "name": "label", "types": [ "String" ], "description": "An identifying string (related to: console.timeEnd)" } ], "description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n\n#### Example\n\n", "short_description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n", "ellipsis_description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n ...", "line": 110, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.time", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L110", "name": "time", "path": "console.time" }, { "id": "console.timeEnd", "type": "class method", "signatures": [ { "args": [ { "name": "label", "types": [ "String" ] } ] } ], "arguments": [ { "name": "label", "types": [ "String" ], "description": "An identifying string (related to: console.time)" } ], "description": "Finish the previous timer and prints output.\n\n#### Example\n\n\n\nconsole.trace()\n\nPrints a stack trace to stderr of the current position.", "short_description": "Finish the previous timer and prints output.\n", "ellipsis_description": "Finish the previous timer and prints output.\n ...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.timeEnd", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L126", "name": "timeEnd", "path": "console.timeEnd" }, { "id": "console.warn", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "warn", "types": [ "String" ], "description": "A message to send (related to: console.log)" } ], "description": "This performs the same role as `console.log()`, but prints to stderr instead.", "short_description": "This performs the same role as `console.log()`, but prints to stderr instead.", "ellipsis_description": "This performs the same role as `console.log()`, but prints to stderr instead. ...", "line": 48, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.warn", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L48", "name": "warn", "path": "console.warn" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L16", "name": "console", "path": "console" }, "console.assert": { "id": "console.assert", "type": "class method", "signatures": [ { "args": [] } ], "description": "(alias of: assert.ok)\n\nAn alias to `assert.ok()`.", "short_description": "(alias of: assert.ok)\n", "ellipsis_description": "(alias of: assert.ok)\n ...", "line": 27, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.assert", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L27", "name": "assert", "path": "console.assert" }, "console.dir": { "id": "console.dir", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "An object to inspect (alias of: util.inspect)" } ], "description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr.", "short_description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr.", "ellipsis_description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr. ...", "line": 38, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.dir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L38", "name": "dir", "path": "console.dir" }, "console.warn": { "id": "console.warn", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "warn", "types": [ "String" ], "description": "A message to send (related to: console.log)" } ], "description": "This performs the same role as `console.log()`, but prints to stderr instead.", "short_description": "This performs the same role as `console.log()`, but prints to stderr instead.", "ellipsis_description": "This performs the same role as `console.log()`, but prints to stderr instead. ...", "line": 48, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.warn", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L48", "name": "warn", "path": "console.warn" }, "console.error": { "id": "console.error", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "An object to inspect (related to: console.log)" } ], "description": "This performs the same role as `console.log()`, but prints to stderr instead.", "short_description": "This performs the same role as `console.log()`, but prints to stderr instead.", "ellipsis_description": "This performs the same role as `console.log()`, but prints to stderr instead. ...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L59", "name": "error", "path": "console.error" }, "console.info": { "id": "console.info", "type": "class method", "signatures": [ { "args": [] } ], "description": "(alias of: console.log)\n\nThis is just an alias to `console.log()`.", "short_description": "(alias of: console.log)\n", "ellipsis_description": "(alias of: console.log)\n ...", "line": 69, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.info", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L69", "name": "info", "path": "console.info" }, "console.log": { "id": "console.log", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "arg", "types": [ "String" ], "description": "The string to print, and any additional formatting arguments (alias of: util.format)", "optional": true } ], "description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n\nEach placeholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n* `%s` - String.\n* `%d` - Number (both integer and float).\n* `%j` - JSON.\n* `%%` - single percent sign (`'%'`). This does not consume an argument.\n\nIf formatting elements are not found in the first string then [[util.inspect\n`util.inspect()`]] is used on each argument.\n\n#### Example\n\n", "short_description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n", "ellipsis_description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedi...", "line": 95, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.log", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L95", "name": "log", "path": "console.log" }, "console.time": { "id": "console.time", "type": "class method", "signatures": [ { "args": [ { "name": "label", "types": [ "String" ] } ] } ], "arguments": [ { "name": "label", "types": [ "String" ], "description": "An identifying string (related to: console.timeEnd)" } ], "description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n\n#### Example\n\n", "short_description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n", "ellipsis_description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n ...", "line": 110, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.time", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L110", "name": "time", "path": "console.time" }, "console.timeEnd": { "id": "console.timeEnd", "type": "class method", "signatures": [ { "args": [ { "name": "label", "types": [ "String" ] } ] } ], "arguments": [ { "name": "label", "types": [ "String" ], "description": "An identifying string (related to: console.time)" } ], "description": "Finish the previous timer and prints output.\n\n#### Example\n\n\n\nconsole.trace()\n\nPrints a stack trace to stderr of the current position.", "short_description": "Finish the previous timer and prints output.\n", "ellipsis_description": "Finish the previous timer and prints output.\n ...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.timeEnd", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L126", "name": "timeEnd", "path": "console.timeEnd" }, "streams": { "id": "streams", "type": "class", "description": "\nA stream is an abstract interface implemented by various objects in Node.js. For\nexample, a request to an HTTP server is a stream, as is stdout. Streams can be\nreadable, writable, or both. All streams are instances of [[eventemitter\n`EventEmitter`]].\n\nFor more information, see [this article on understanding\nstreams](../nodejs_dev_guide/understanding_streams.html).\n\n#### Example: Printing to the console\n\n\n\n#### Example: Reading from the console\n\n", "stability": "2 - Unstable", "short_description": "\nA stream is an abstract interface implemented by various objects in Node.js. For\nexample, a request to an HTTP server is a stream, as is stdout. Streams can be\nreadable, writable, or both. All streams are instances of [[eventemitter\n`EventEmitter`]].\n", "ellipsis_description": "\nA stream is an abstract interface implemented by various objects in Node.js. For\nexample, a request to an HTTP serv...", "line": 23, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams", "subclasses": [ "streams.ReadableStream", "streams.WritableStream" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L23", "name": "streams", "path": "streams" }, "streams.ReadableStream": { "id": "streams.ReadableStream", "type": "class", "superclass": "streams", "description": "", "short_description": "", "ellipsis_description": " ...", "line": 30, "aliases": [], "children": [ { "id": "streams.ReadableStream.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Closes the underlying file descriptor. The stream will not emit any more events.", "short_description": "Closes the underlying file descriptor. The stream will not emit any more events.", "ellipsis_description": "Closes the underlying file descriptor. The stream will not emit any more events. ...", "line": 94, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L94", "name": "destroy", "path": "streams.ReadableStream.destroy" }, { "id": "streams.ReadableStream.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pause any incoming `'data'` events.", "short_description": "Pause any incoming `'data'` events.", "ellipsis_description": "Pause any incoming `'data'` events. ...", "line": 104, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L104", "name": "pause", "path": "streams.ReadableStream.pause" }, { "id": "streams.ReadableStream.pipe", "type": "class method", "signatures": [ { "args": [ { "name": "destination", "types": [ "streams.WritableStream" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "streams" } ] } ], "arguments": [ { "name": "destination", "types": [ "streams.WritableStream" ], "description": "The WriteStream to connect to" }, { "name": "options", "types": [ "Object" ], "description": "Any optional commands to send", "optional": true } ], "description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destination`. Incoming data on this stream is\nthen written to `destination`. The destination and source streams are kept in\nsync by Node.js pausing and resuming as necessary.\n\nThis function returns the `destination` stream.\n\nBy default, `end()` is called on the destination when the source stream emits\n`end`, so that `destination` is no longer writable. Pass `{ end: false }` into\n`options` to keep the destination stream open.\n\n#### Example\n\nEmulating the Unix `cat` command:\n\n process.stdin.resume(); // process.stdin is paused by default, so we need to\nstart it up\n process.stdin.pipe(process.stdout); // type something into the console &\nwatch it repeat\n\nThis keeps `process.stdout` open so that \"Goodbye\" can be written at the end.\n\n process.stdin.resume();\n\n process.stdin.pipe(process.stdout, { end: false });\n\n process.stdin.on(\"end\", function() {\n process.stdout.write(\"Goodbye\\n\");\n });\n\n\n\n\n/** related to: streams.ReadableStream.data\nstreams.ReadableStream.setEncoding(encoding)\n- encoding {String} The encoding to use; this can be `'utf8'`, `'ascii'`, or\n`'base64'`.\n\nMakes the `data` event emit a string instead of a `Buffer`.", "short_description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destination`. Incoming data on this stream is\nthen written to `destination`. The destination and source streams are kept in\nsync by Node.js pausing and resuming as necessary.\n", "ellipsis_description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destin...", "line": 154, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.pipe", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L154", "name": "pipe", "path": "streams.ReadableStream.pipe" }, { "id": "streams.ReadableStream.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes the incoming `'data'` events after a `pause()`.", "short_description": "Resumes the incoming `'data'` events after a `pause()`.", "ellipsis_description": "Resumes the incoming `'data'` events after a `pause()`. ...", "line": 163, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L163", "name": "resume", "path": "streams.ReadableStream.resume" }, { "id": "streams.ReadableStream@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HTTP request don't emit `close`.", "short_description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HTTP request don't emit `close`.", "ellipsis_description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HT...", "line": 41, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L41", "name": "close", "path": "streams.ReadableStream.event.close" }, { "id": "streams.ReadableStream@data", "type": "event", "signatures": [ { "args": [ { "name": "data", "types": [ "Buffer", "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "Buffer", "String" ], "description": "The data being emitted" } ], "description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream.", "short_description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream.", "ellipsis_description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream. ...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L53", "name": "data", "path": "streams.ReadableStream.event.data" }, { "id": "streams.ReadableStream@end", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happen. If the stream is also writable, it may\nbe possible to continue writing.", "short_description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happen. If the stream is also writable, it may\nbe possible to continue writing.", "ellipsis_description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happ...", "line": 65, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L65", "name": "end", "path": "streams.ReadableStream.event.end" }, { "id": "streams.ReadableStream@error", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted if there was an error receiving data.", "short_description": "Emitted if there was an error receiving data.", "ellipsis_description": "Emitted if there was an error receiving data. ...", "line": 74, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L74", "name": "error", "path": "streams.ReadableStream.event.error" }, { "id": "streams.ReadableStream@pipe", "type": "event", "signatures": [ { "args": [ { "name": "src", "types": [ "streams.ReadableStream" ] } ] } ], "arguments": [ { "name": "src", "types": [ "streams.ReadableStream" ], "description": "The readable stream" } ], "description": "Emitted when the stream is passed to a readable stream's pipe method.", "short_description": "Emitted when the stream is passed to a readable stream's pipe method.", "ellipsis_description": "Emitted when the stream is passed to a readable stream's pipe method. ...", "line": 85, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@pipe", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L85", "name": "pipe", "path": "streams.ReadableStream.event.pipe" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L30", "name": "ReadableStream", "path": "streams.ReadableStream" }, "streams.ReadableStream@close": { "id": "streams.ReadableStream@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HTTP request don't emit `close`.", "short_description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HTTP request don't emit `close`.", "ellipsis_description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HT...", "line": 41, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L41", "name": "close", "path": "streams.ReadableStream.event.close" }, "streams.ReadableStream@data": { "id": "streams.ReadableStream@data", "type": "event", "signatures": [ { "args": [ { "name": "data", "types": [ "Buffer", "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "Buffer", "String" ], "description": "The data being emitted" } ], "description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream.", "short_description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream.", "ellipsis_description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream. ...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L53", "name": "data", "path": "streams.ReadableStream.event.data" }, "streams.ReadableStream@end": { "id": "streams.ReadableStream@end", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happen. If the stream is also writable, it may\nbe possible to continue writing.", "short_description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happen. If the stream is also writable, it may\nbe possible to continue writing.", "ellipsis_description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happ...", "line": 65, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L65", "name": "end", "path": "streams.ReadableStream.event.end" }, "streams.ReadableStream@error": { "id": "streams.ReadableStream@error", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted if there was an error receiving data.", "short_description": "Emitted if there was an error receiving data.", "ellipsis_description": "Emitted if there was an error receiving data. ...", "line": 74, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L74", "name": "error", "path": "streams.ReadableStream.event.error" }, "streams.ReadableStream@pipe": { "id": "streams.ReadableStream@pipe", "type": "event", "signatures": [ { "args": [ { "name": "src", "types": [ "streams.ReadableStream" ] } ] } ], "arguments": [ { "name": "src", "types": [ "streams.ReadableStream" ], "description": "The readable stream" } ], "description": "Emitted when the stream is passed to a readable stream's pipe method.", "short_description": "Emitted when the stream is passed to a readable stream's pipe method.", "ellipsis_description": "Emitted when the stream is passed to a readable stream's pipe method. ...", "line": 85, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@pipe", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L85", "name": "pipe", "path": "streams.ReadableStream.event.pipe" }, "streams.ReadableStream.destroy": { "id": "streams.ReadableStream.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Closes the underlying file descriptor. The stream will not emit any more events.", "short_description": "Closes the underlying file descriptor. The stream will not emit any more events.", "ellipsis_description": "Closes the underlying file descriptor. The stream will not emit any more events. ...", "line": 94, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L94", "name": "destroy", "path": "streams.ReadableStream.destroy" }, "streams.ReadableStream.pause": { "id": "streams.ReadableStream.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pause any incoming `'data'` events.", "short_description": "Pause any incoming `'data'` events.", "ellipsis_description": "Pause any incoming `'data'` events. ...", "line": 104, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L104", "name": "pause", "path": "streams.ReadableStream.pause" }, "streams.ReadableStream.pipe": { "id": "streams.ReadableStream.pipe", "type": "class method", "signatures": [ { "args": [ { "name": "destination", "types": [ "streams.WritableStream" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "streams" } ] } ], "arguments": [ { "name": "destination", "types": [ "streams.WritableStream" ], "description": "The WriteStream to connect to" }, { "name": "options", "types": [ "Object" ], "description": "Any optional commands to send", "optional": true } ], "description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destination`. Incoming data on this stream is\nthen written to `destination`. The destination and source streams are kept in\nsync by Node.js pausing and resuming as necessary.\n\nThis function returns the `destination` stream.\n\nBy default, `end()` is called on the destination when the source stream emits\n`end`, so that `destination` is no longer writable. Pass `{ end: false }` into\n`options` to keep the destination stream open.\n\n#### Example\n\nEmulating the Unix `cat` command:\n\n process.stdin.resume(); // process.stdin is paused by default, so we need to\nstart it up\n process.stdin.pipe(process.stdout); // type something into the console &\nwatch it repeat\n\nThis keeps `process.stdout` open so that \"Goodbye\" can be written at the end.\n\n process.stdin.resume();\n\n process.stdin.pipe(process.stdout, { end: false });\n\n process.stdin.on(\"end\", function() {\n process.stdout.write(\"Goodbye\\n\");\n });\n\n\n\n\n/** related to: streams.ReadableStream.data\nstreams.ReadableStream.setEncoding(encoding)\n- encoding {String} The encoding to use; this can be `'utf8'`, `'ascii'`, or\n`'base64'`.\n\nMakes the `data` event emit a string instead of a `Buffer`.", "short_description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destination`. Incoming data on this stream is\nthen written to `destination`. The destination and source streams are kept in\nsync by Node.js pausing and resuming as necessary.\n", "ellipsis_description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destin...", "line": 154, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.pipe", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L154", "name": "pipe", "path": "streams.ReadableStream.pipe" }, "streams.ReadableStream.resume": { "id": "streams.ReadableStream.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes the incoming `'data'` events after a `pause()`.", "short_description": "Resumes the incoming `'data'` events after a `pause()`.", "ellipsis_description": "Resumes the incoming `'data'` events after a `pause()`. ...", "line": 163, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L163", "name": "resume", "path": "streams.ReadableStream.resume" }, "streams.WritableStream": { "id": "streams.WritableStream", "type": "class", "superclass": "streams", "description": "", "short_description": "", "ellipsis_description": " ...", "line": 170, "aliases": [], "children": [ { "id": "streams.WritableStream.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent.", "short_description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent.", "ellipsis_description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent. ...", "line": 225, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L225", "name": "destroy", "path": "streams.WritableStream.destroy" }, { "id": "streams.WritableStream.destroySoon", "type": "class method", "signatures": [ { "args": [] } ], "description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, as long as there is no data\nleft in the queue for writes.", "short_description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, as long as there is no data\nleft in the queue for writes.", "ellipsis_description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, ...", "line": 237, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.destroySoon", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L237", "name": "destroySoon", "path": "streams.WritableStream.destroySoon" }, { "id": "streams.WritableStream.end", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The message to send" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to send" } ], "description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n\nFor `streams.WritableStream.end(string, encoding)`, a `string` with the given\n`encoding` is sent. This is useful to reduce the number of packets sent.\n\nFor `streams.WritableStream.end(Buffer)`, a `buffer` is sent.", "short_description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n", "ellipsis_description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n ...", "line": 258, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L258", "name": "end", "path": "streams.WritableStream.end" }, { "id": "streams.WritableStream.writable", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`, or if `destroy()` was called.", "short_description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`, or if `destroy()` was called.", "ellipsis_description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`...", "line": 180, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.writable", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L180", "name": "writable", "path": "streams.WritableStream.writable" }, { "id": "streams.WritableStream.write", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The string to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" }, { "name": "fd", "types": [ "Number" ], "description": "An optional file descriptor to pass" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" } ], "description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been flushed to the kernel buffer. Returns\n`false` to indicate that the kernel buffer is full, and the data will be sent\nout in the future. The `drain` event indicates when the kernel buffer is empty\nagain.\n\nIf `fd` is specified, it's interpreted as an integral file descriptor to be sent\nover the stream. This is only supported for UNIX streams, and is ignored\notherwise. When writing a file descriptor in this manner, closing the descripton\nbefore the stream drains risks sending an invalid (closed) FD.", "short_description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been flushed to the kernel buffer. Returns\n`false` to indicate that the kernel buffer is full, and the data will be sent\nout in the future. The `drain` event indicates when the kernel buffer is empty\nagain.\n", "ellipsis_description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been fl...", "line": 283, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L283", "name": "write", "path": "streams.WritableStream.write" }, { "id": "streams.WritableStream@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the underlying file descriptor has been closed.", "short_description": "Emitted when the underlying file descriptor has been closed.", "ellipsis_description": "Emitted when the underlying file descriptor has been closed. ...", "line": 192, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L192", "name": "close", "path": "streams.WritableStream.event.close" }, { "id": "streams.WritableStream@drain", "type": "event", "signatures": [ { "args": [] } ], "description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again.", "short_description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again.", "ellipsis_description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again. ...", "line": 203, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@drain", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L203", "name": "drain", "path": "streams.WritableStream.event.drain" }, { "id": "streams.WritableStream@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception that was received" } ], "description": "Emitted when there's an error with the exception `exception`.", "short_description": "Emitted when there's an error with the exception `exception`.", "ellipsis_description": "Emitted when there's an error with the exception `exception`. ...", "line": 214, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L214", "name": "error", "path": "streams.WritableStream.event.error" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L170", "name": "WritableStream", "path": "streams.WritableStream" }, "streams.WritableStream.writable": { "id": "streams.WritableStream.writable", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`, or if `destroy()` was called.", "short_description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`, or if `destroy()` was called.", "ellipsis_description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`...", "line": 180, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.writable", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L180", "name": "writable", "path": "streams.WritableStream.writable" }, "streams.WritableStream@close": { "id": "streams.WritableStream@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the underlying file descriptor has been closed.", "short_description": "Emitted when the underlying file descriptor has been closed.", "ellipsis_description": "Emitted when the underlying file descriptor has been closed. ...", "line": 192, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L192", "name": "close", "path": "streams.WritableStream.event.close" }, "streams.WritableStream@drain": { "id": "streams.WritableStream@drain", "type": "event", "signatures": [ { "args": [] } ], "description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again.", "short_description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again.", "ellipsis_description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again. ...", "line": 203, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@drain", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L203", "name": "drain", "path": "streams.WritableStream.event.drain" }, "streams.WritableStream@error": { "id": "streams.WritableStream@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception that was received" } ], "description": "Emitted when there's an error with the exception `exception`.", "short_description": "Emitted when there's an error with the exception `exception`.", "ellipsis_description": "Emitted when there's an error with the exception `exception`. ...", "line": 214, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L214", "name": "error", "path": "streams.WritableStream.event.error" }, "streams.WritableStream.destroy": { "id": "streams.WritableStream.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent.", "short_description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent.", "ellipsis_description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent. ...", "line": 225, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L225", "name": "destroy", "path": "streams.WritableStream.destroy" }, "streams.WritableStream.destroySoon": { "id": "streams.WritableStream.destroySoon", "type": "class method", "signatures": [ { "args": [] } ], "description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, as long as there is no data\nleft in the queue for writes.", "short_description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, as long as there is no data\nleft in the queue for writes.", "ellipsis_description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, ...", "line": 237, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.destroySoon", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L237", "name": "destroySoon", "path": "streams.WritableStream.destroySoon" }, "streams.WritableStream.end": { "id": "streams.WritableStream.end", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The message to send" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to send" } ], "description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n\nFor `streams.WritableStream.end(string, encoding)`, a `string` with the given\n`encoding` is sent. This is useful to reduce the number of packets sent.\n\nFor `streams.WritableStream.end(Buffer)`, a `buffer` is sent.", "short_description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n", "ellipsis_description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n ...", "line": 258, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L258", "name": "end", "path": "streams.WritableStream.end" }, "streams.WritableStream.write": { "id": "streams.WritableStream.write", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The string to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" }, { "name": "fd", "types": [ "Number" ], "description": "An optional file descriptor to pass" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" } ], "description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been flushed to the kernel buffer. Returns\n`false` to indicate that the kernel buffer is full, and the data will be sent\nout in the future. The `drain` event indicates when the kernel buffer is empty\nagain.\n\nIf `fd` is specified, it's interpreted as an integral file descriptor to be sent\nover the stream. This is only supported for UNIX streams, and is ignored\notherwise. When writing a file descriptor in this manner, closing the descripton\nbefore the stream drains risks sending an invalid (closed) FD.", "short_description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been flushed to the kernel buffer. Returns\n`false` to indicate that the kernel buffer is full, and the data will be sent\nout in the future. The `drain` event indicates when the kernel buffer is empty\nagain.\n", "ellipsis_description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been fl...", "line": 283, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L283", "name": "write", "path": "streams.WritableStream.write" }, "string_decoder": { "id": "string_decoder", "type": "class", "description": "\nStringDecoder decodes a [[Buffer buffer]] to a string. It is a simple interface\n to `buffer.toString()` but provides additional support for utf8.\n\n To use this module, add `require('string_decoder')` to your code.\n\n #### Example\n\n", "stability": "3 - Stable", "short_description": "\nStringDecoder decodes a [[Buffer buffer]] to a string. It is a simple interface\n to `buffer.toString()` but provides additional support for utf8.\n", "ellipsis_description": "\nStringDecoder decodes a [[Buffer buffer]] to a string. It is a simple interface\n to `buffer.toString()` but provide...", "line": 16, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/string_decoder.markdown", "fileName": "string_decoder", "resultingFile": "string_decoder.html#string_decoder", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/string_decoder.markdown#L16", "name": "string_decoder", "path": "string_decoder" }, "StringDecoder.new": { "id": "new StringDecoder", "type": "constructor", "signatures": [ { "args": [ { "name": "encoding", "default_value": "utf8", "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding that the string is in" } ], "description": "Creates a new `StringDecoder`.", "short_description": "Creates a new `StringDecoder`.", "ellipsis_description": "Creates a new `StringDecoder`. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/string_decoder.markdown", "fileName": "string_decoder", "resultingFile": "string_decoder.html#StringDecoder.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/string_decoder.markdown#L24", "name": "new", "path": "StringDecoder.new" }, "StringDecoder.write": { "id": "StringDecoder.write", "type": "class method", "signatures": [ { "args": [ { "name": "buffer", "types": [ "Buffer" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to convert (related to: buffer.toString)" } ], "description": "Returns a decoded string.", "short_description": "Returns a decoded string.", "ellipsis_description": "Returns a decoded string. ...", "line": 32, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/string_decoder.markdown", "fileName": "string_decoder", "resultingFile": "string_decoder.html#StringDecoder.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/string_decoder.markdown#L32", "name": "write", "path": "StringDecoder.write" }, "timer": { "id": "timer", "type": "class", "metadata": { "type": "global" }, "description": "\nThe timer functions are useful for scheduling functions to run after a defined\namount of time. All of the objects in this class are global; the method calls\ndon't need to be prepended with an object name.\n\nIt's important to note that your callback probably *won't* be called in exactly\n`delay` milliseconds. Node.js makes no guarantees about the exact timing of when\nthe callback is fired, nor of the ordering things will fire in. The callback is\ncalled as close as possible to the time specified.\n\nThe difference between ``setInterval()` and `setTimeout()` is simple:\n`setTimeout()` executes a function after a certain period of time, while\n`setInterval()` executes a function, then after a set period of time, executes\nthe function again, then waits again, and executes again. This continues until\n`clearInterval()` is called.\n\n\n#### Example: The Wrong Way to use Timers\n\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t setTimeout(function () {\n\t\t console.log(i);\n\t\t }, i);\n\t\t }\n\nThe code above prints the number `5` five times. This happens because the loop\nfills up before the first `setTimeout()` is called.\n\n#### Example: The Right Way to use Timers\n\nThe solution to the above problem is to create a\n[closure](http://stackoverflow.com/questions/1801957/what-exactly-does-closure-r\nefer-to-in-javascript) so that the current value of `i` is stored:\n\n for (var i = 0; i < 5; i++) {\n (\n function(i) {\n setTimeout(function () {\n console.log(i);\n }, i);\n }\n )(i)};", "stability": "5 - Locked", "short_description": "\nThe timer functions are useful for scheduling functions to run after a defined\namount of time. All of the objects in this class are global; the method calls\ndon't need to be prepended with an object name.\n", "ellipsis_description": "\nThe timer functions are useful for scheduling functions to run after a defined\namount of time. All of the objects i...", "line": 54, "aliases": [], "children": [ { "id": "timer.clearInterval", "type": "class method", "signatures": [ { "args": [ { "name": "intervalId", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "intervalId", "types": [ "Number" ], "description": "The id of the interval" } ], "description": "Stops a interval from triggering.", "short_description": "Stops a interval from triggering.", "ellipsis_description": "Stops a interval from triggering. ...", "line": 66, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.clearInterval", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L66", "name": "clearInterval", "path": "timer.clearInterval" }, { "id": "timer.clearTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeoutId", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "timeoutId", "types": [ "Number" ], "description": "The id of the timeout" } ], "description": "Prevents a timeout from triggering.", "short_description": "Prevents a timeout from triggering.", "ellipsis_description": "Prevents a timeout from triggering. ...", "line": 77, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.clearTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L77", "name": "clearTimeout", "path": "timer.clearTimeout" }, { "id": "timer.setInterval", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] }, { "name": "delay", "types": [ "Number" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "The callback function to execute" }, { "name": "delay", "types": [ "Number" ], "description": "The delay (in milliseconds) before executing the callback" }, { "name": "arg", "types": [ "Object" ], "description": "Any optional arguments to pass the to callback", "optional": true } ], "description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for possible use with `clearInterval()`.\nOptionally, you can also pass arguments to the callback.\n\n\n#### Example\n\t\tvar interval_count = 0;\n\n\t\t// Set an interval for one second, twice;\n\t\t// on the third second, break out\n\t\tsetInterval(function(param) {\n\t\t ++interval_count;\n\n\t\t if (interval_count == 3)\n\t\t clearInterval(this);\n\t\t}, 1000, 'test param');\n\n\n\n\n/**\n timer.setTimeout(callback(), delay [, arg...])\n- callback {Function} The callback function to execute\n- delay {Number} The delay (in milliseconds) before executing the callback\n- arg {Object} Any optional arguments to pass the to callback\n\nThis function schedules the execution of a one-time callback function after a\ndefined delay, It returns a `timeoutId`, which can be used later with\n`clearTimeout()`. Optionally, you can also pass arguments to the callback.", "short_description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for possible use with `clearInterval()`.\nOptionally, you can also pass arguments to the callback.\n", "ellipsis_description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for p...", "line": 118, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.setInterval", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L118", "name": "setInterval", "path": "timer.setInterval" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L54", "name": "timer", "path": "timer" }, "timer.clearInterval": { "id": "timer.clearInterval", "type": "class method", "signatures": [ { "args": [ { "name": "intervalId", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "intervalId", "types": [ "Number" ], "description": "The id of the interval" } ], "description": "Stops a interval from triggering.", "short_description": "Stops a interval from triggering.", "ellipsis_description": "Stops a interval from triggering. ...", "line": 66, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.clearInterval", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L66", "name": "clearInterval", "path": "timer.clearInterval" }, "timer.clearTimeout": { "id": "timer.clearTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeoutId", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "timeoutId", "types": [ "Number" ], "description": "The id of the timeout" } ], "description": "Prevents a timeout from triggering.", "short_description": "Prevents a timeout from triggering.", "ellipsis_description": "Prevents a timeout from triggering. ...", "line": 77, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.clearTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L77", "name": "clearTimeout", "path": "timer.clearTimeout" }, "timer.setInterval": { "id": "timer.setInterval", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] }, { "name": "delay", "types": [ "Number" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "The callback function to execute" }, { "name": "delay", "types": [ "Number" ], "description": "The delay (in milliseconds) before executing the callback" }, { "name": "arg", "types": [ "Object" ], "description": "Any optional arguments to pass the to callback", "optional": true } ], "description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for possible use with `clearInterval()`.\nOptionally, you can also pass arguments to the callback.\n\n\n#### Example\n\t\tvar interval_count = 0;\n\n\t\t// Set an interval for one second, twice;\n\t\t// on the third second, break out\n\t\tsetInterval(function(param) {\n\t\t ++interval_count;\n\n\t\t if (interval_count == 3)\n\t\t clearInterval(this);\n\t\t}, 1000, 'test param');\n\n\n\n\n/**\n timer.setTimeout(callback(), delay [, arg...])\n- callback {Function} The callback function to execute\n- delay {Number} The delay (in milliseconds) before executing the callback\n- arg {Object} Any optional arguments to pass the to callback\n\nThis function schedules the execution of a one-time callback function after a\ndefined delay, It returns a `timeoutId`, which can be used later with\n`clearTimeout()`. Optionally, you can also pass arguments to the callback.", "short_description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for possible use with `clearInterval()`.\nOptionally, you can also pass arguments to the callback.\n", "ellipsis_description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for p...", "line": 118, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.setInterval", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L118", "name": "setInterval", "path": "timer.setInterval" }, "tls": { "id": "tls", "type": "class", "description": "\nThe `tls` module uses OpenSSL to provide both the Transport Layer Security and\nthe Secure Socket Layer; in other words, it provides encrypted stream\ncommunications. To access this module, add `require('tls')` in your code.\n\nTLS/SSL is a public/private key infrastructure. Each client and each server must\nhave a private key. A private key is created in your terminal like this:\n\n openssl genrsa -out ryans-key.pem 1024\n\nwhere `ryans-key.pm` is the name of your file. All servers (and some clients)\nneed to have a certificate. Certificates are public keys signed by a Certificate\nAuthority— or, they are self-signed. The first step to getting a certificate is\nto create a \"Certificate Signing Request\" (CSR) file. This is done using:\n\n openssl req -new -key ryans-key.pem -out ryans-csr.pem\n\nTo create a self-signed certificate with the CSR, enter this:\n\n openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out\nryans-cert.pem\n\nAlternatively, you can send the CSR to a Certificate Authority for signing.\n\n(Documentation on creating a CA are pending; for now, interested users should\njust look at\n[`test/fixtures/keys/Makefile`](https://github.com/joyent/node/blob/master/test/\nfixtures/keys/Makefile) in the Node.js source code.)\n\nTo create .pfx or .p12, do this:\n\n openssl pkcs12 -export -in agent5-cert.pem -inkey agent5-key.pem \\\n -certfile ca-cert.pem -out agent5.pfx\n\n - `in`: The certificate\n - `inkey`: The private key\n - `certfile`: All the CA certs concatenated in one file, like this:\n `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem`\n\n#### Using NPN and SNI\n\nNPN (Next Protocol Negotiation) and SNI (Server Name Indication) are TLS\nhandshake extensions provided with this module.\n\nNPN is to use one TLS server for multiple protocols (HTTP, SPDY).\nSNI is to use one TLS server for multiple hostnames with different SSL\ncertificates.", "stability": "3 - Stable", "short_description": "\nThe `tls` module uses OpenSSL to provide both the Transport Layer Security and\nthe Secure Socket Layer; in other words, it provides encrypted stream\ncommunications. To access this module, add `require('tls')` in your code.\n", "ellipsis_description": "\nThe `tls` module uses OpenSSL to provide both the Transport Layer Security and\nthe Secure Socket Layer; in other wo...", "line": 56, "aliases": [], "children": [ { "id": "tls.connect", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "default_value": "localhost", "optional": true, "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "secureConnectListener", "optional": true, "types": [ "Function" ] } ], "returns": [ { "type": "tls.CleartextStream" } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "An optional hostname to connect to`", "optional": true }, { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server", "optional": true }, { "name": "secureConnectionListener", "types": [ "Function" ], "description": "An optional listener" } ], "description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.CleartextStream`]] object.\n\n`options` should be an object that specifies the following values:\n\n - `key`: A string or `Buffer` containing the private key of the client in aPEM\nformat. The default is `null`.\n\n - `passphrase`: A string of a passphrase for the private key. The default is\n`null`.\n\n - `cert`: A string or `Buffer` containing the certificate key of the client in\na PEM format; in other words, the public x509 certificate to use. The default is\n`null`.\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simpler: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `servername`: The server name for the SNI (Server Name Indication) TLS\nextension.\n\n`secureConnectionListener` automatically sets a listener for the\n[`secureConnection`](#tls.event.secureConnection) event.\n\n\n#### Example: Connecting to an echo server on port 8000:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n // These are necessary only if using the client certificate authentication\n key: fs.readFileSync('client-key.pem'),\n cert: fs.readFileSync('client-cert.pem'),\n\n // This is necessary only if the server uses the self-signed certificate\n ca: [ fs.readFileSync('server-cert.pem') ]\n };\n\n var cleartextStream = tls.connect(8000, options, function() {\n console.log('client connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n });\n cleartextStream.setEncoding('utf8');\n cleartextStream.on('data', function(data) {\n console.log(data);\n });\n cleartextStream.on('end', function() {\n server.close();\n });\n\nOr, with pfx:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n pfx: fs.readFileSync('client.pfx')\n };\n\n var cleartextStream = tls.connect(8000, options, function() {\n console.log('client connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n });\n cleartextStream.setEncoding('utf8');\n cleartextStream.on('data', function(data) {\n console.log(data);\n });\n cleartextStream.on('end', function() {\n server.close();\n });", "short_description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.CleartextStream`]] object.\n", "ellipsis_description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.C...", "line": 175, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L175", "name": "connect", "path": "tls.connect" }, { "id": "tls.createSecurePair", "type": "class method", "signatures": [ { "args": [ { "name": "credentials", "optional": true, "types": [ "Object" ] }, { "name": "isServer", "optional": true, "types": [ "Boolean" ] }, { "name": "requestCert", "optional": true, "types": [ "Boolean" ] }, { "name": "rejectUnauthorized", "optional": true, "types": [ "Boolean" ] } ], "returns": [ { "type": "tls.SecurePair" } ] } ], "arguments": [ { "name": "credentials", "types": [ "Object" ], "description": "An optional credentials object from [[crypto.createCredentials `crypto.createCredentials()`]]", "optional": true }, { "name": "isServer", "types": [ "Boolean" ], "description": "An optional boolean indicating whether this TLS connection should be opened as a server (`true`) or a client (`false`)", "optional": true }, { "name": "requestCert", "types": [ "Boolean" ], "description": "A boolean indicating whether a server should request a certificate from a connecting client; only applies to server connections", "optional": true }, { "name": "rejectUnauthorized", "types": [ "Boolean" ], "description": "A boolean indicating whether a server should automatically reject clients with invalid certificates; only applies to servers with `requestCert` enabled", "optional": true } ], "description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data. This function returns a\nSecurePair object with [[tls.CleartextStream `tls.CleartextStream`]] and\n`encrypted` stream properties.\n\nGenerally, the encrypted strean is piped to/from an incoming encrypted data\nstream, and the cleartext one is used as a replacement for the initial encrypted\nstream.", "short_description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data. This function returns a\nSecurePair object with [[tls.CleartextStream `tls.CleartextStream`]] and\n`encrypted` stream properties.\n", "ellipsis_description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.createSecurePair", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L202", "name": "createSecurePair", "path": "tls.createSecurePair" }, { "id": "tls.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "secureConnectionListener", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "secureConnectionListener", "types": [ "Function" ], "description": "An optional listener", "optional": true } ], "description": "Creates a new [[tls.Server `tls.Server`]].\n\nThe `options` object has the following mix of required values:\n\n - `pfx`: A string or `Buffer` containing the private key, certificate, and\n CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\n the `key`, `cert`, and `ca` options.)\n\n - `key`: A string or `Buffer` containing the private key of the server in a\nPEM format. (Required)\n\n - `cert`: A string or `Buffer` containing the certificate key of the server in\na PEM format. (Required)\n\n`options` also has the following option values:\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simplier: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `passphrase`: A string of a passphrase for the private key or pfx.\n\n - `rejectUnauthorized`: If `true` the server rejects any connection that is\nnot authorized with the list of supplied CAs. This option only has an effect if\n`requestCert` is `true`. This defaults to `false`.\n\n - `requestCert`: If `true` the server requests a certificate from clients that\nconnect and attempt to verify that certificate. This defaults to `false`.\n\n - `sessionIdContext`: A string containing an opaque identifier for session\nresumption. If `requestCert` is `true`, the default is an MD5 hash value\ngenerated from the command line. Otherwise, the default is not provided.\n\n - `SNICallback`: A function that is called if the client supports the SNI TLS\nextension. Only one argument will be passed to it: `servername`. `SNICallback`\nshould return a SecureContext instance. You can use\n`crypto.createCredentials(...).context` to get a proper SecureContext. If\n`SNICallback` wasn't provided, a default callback within the high-level API is\nused (for more information, see below).\n\n`secureConnectionListener` automatically sets a listener for the\n[`secureConnection`](#tls.event.secureConnection) event.\n\n#### Example\n\nHere's a simple \"echo\" server:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n key: fs.readFileSync('server-key.pem'),\n cert: fs.readFileSync('server-cert.pem'),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n // This is necessary only if the client uses the self-signed certificate.\n ca: [ fs.readFileSync('client-cert.pem') ]\n };\n\n var server = tls.createServer(options, function(cleartextStream) {\n console.log('server connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n cleartextStream.write(\"welcome!\\n\");\n cleartextStream.setEncoding('utf8');\n cleartextStream.pipe(cleartextStream);\n });\n server.listen(8000, function() {\n console.log('server bound');\n });\n\nOr, with pfx:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n pfx: fs.readFileSync('server.pfx'),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n };\n\n var server = tls.createServer(options, function(cleartextStream) {\n console.log('server connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n cleartextStream.write(\"welcome!\\n\");\n cleartextStream.setEncoding('utf8');\n cleartextStream.pipe(cleartextStream);\n });\n server.listen(8000, function() {\n console.log('server bound');\n });\n\nYou can test this server by connecting to it with `openssl s_client`:\n\n openssl s_client -connect 127.0.0.1:8000", "short_description": "Creates a new [[tls.Server `tls.Server`]].\n", "ellipsis_description": "Creates a new [[tls.Server `tls.Server`]].\n ...", "line": 316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L316", "name": "createServer", "path": "tls.createServer" }, { "id": "tls@secureConnection", "type": "event", "signatures": [ { "args": [ { "name": "cleartextStream", "types": [ "tls.CleartextStream" ] } ] } ], "arguments": [ { "name": "cleartextStream", "types": [ "tls.CleartextStream" ], "description": "A object containing the NPN and SNI string protocols" } ], "description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.CleartextStream CleartextStream]]. It has\nall the common stream methods and events.\n\nIf [[tls.CleartextStream.authorized `tls.CleartextStream.authorized`]] is\n`false`, then [[tls.CleartextStream.authorizationError\n`tls.Cleartext.authorizationError`]] is set to describe how the authorization\nfailed. Depending on the settings of the TLS server, your unauthorized\nconnections may still be accepted.\n\n`cleartextStream.npnProtocol` is a string containing the selected NPN protocol.\n`cleartextStream.servername` is a string containing the servername requested\nwith SNI.", "short_description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.CleartextStream CleartextStream]]. It has\nall the common stream methods and events.\n", "ellipsis_description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.C...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls@secureConnection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L80", "name": "secureConnection", "path": "tls.event.secureConnection" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls", "subclasses": [ "tls.Server", "tls.SecurePair", "tls.CleartextStream" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L56", "name": "tls", "path": "tls" }, "tls@secureConnection": { "id": "tls@secureConnection", "type": "event", "signatures": [ { "args": [ { "name": "cleartextStream", "types": [ "tls.CleartextStream" ] } ] } ], "arguments": [ { "name": "cleartextStream", "types": [ "tls.CleartextStream" ], "description": "A object containing the NPN and SNI string protocols" } ], "description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.CleartextStream CleartextStream]]. It has\nall the common stream methods and events.\n\nIf [[tls.CleartextStream.authorized `tls.CleartextStream.authorized`]] is\n`false`, then [[tls.CleartextStream.authorizationError\n`tls.Cleartext.authorizationError`]] is set to describe how the authorization\nfailed. Depending on the settings of the TLS server, your unauthorized\nconnections may still be accepted.\n\n`cleartextStream.npnProtocol` is a string containing the selected NPN protocol.\n`cleartextStream.servername` is a string containing the servername requested\nwith SNI.", "short_description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.CleartextStream CleartextStream]]. It has\nall the common stream methods and events.\n", "ellipsis_description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.C...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls@secureConnection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L80", "name": "secureConnection", "path": "tls.event.secureConnection" }, "tls.connect": { "id": "tls.connect", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "default_value": "localhost", "optional": true, "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "secureConnectListener", "optional": true, "types": [ "Function" ] } ], "returns": [ { "type": "tls.CleartextStream" } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "An optional hostname to connect to`", "optional": true }, { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server", "optional": true }, { "name": "secureConnectionListener", "types": [ "Function" ], "description": "An optional listener" } ], "description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.CleartextStream`]] object.\n\n`options` should be an object that specifies the following values:\n\n - `key`: A string or `Buffer` containing the private key of the client in aPEM\nformat. The default is `null`.\n\n - `passphrase`: A string of a passphrase for the private key. The default is\n`null`.\n\n - `cert`: A string or `Buffer` containing the certificate key of the client in\na PEM format; in other words, the public x509 certificate to use. The default is\n`null`.\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simpler: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `servername`: The server name for the SNI (Server Name Indication) TLS\nextension.\n\n`secureConnectionListener` automatically sets a listener for the\n[`secureConnection`](#tls.event.secureConnection) event.\n\n\n#### Example: Connecting to an echo server on port 8000:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n // These are necessary only if using the client certificate authentication\n key: fs.readFileSync('client-key.pem'),\n cert: fs.readFileSync('client-cert.pem'),\n\n // This is necessary only if the server uses the self-signed certificate\n ca: [ fs.readFileSync('server-cert.pem') ]\n };\n\n var cleartextStream = tls.connect(8000, options, function() {\n console.log('client connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n });\n cleartextStream.setEncoding('utf8');\n cleartextStream.on('data', function(data) {\n console.log(data);\n });\n cleartextStream.on('end', function() {\n server.close();\n });\n\nOr, with pfx:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n pfx: fs.readFileSync('client.pfx')\n };\n\n var cleartextStream = tls.connect(8000, options, function() {\n console.log('client connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n });\n cleartextStream.setEncoding('utf8');\n cleartextStream.on('data', function(data) {\n console.log(data);\n });\n cleartextStream.on('end', function() {\n server.close();\n });", "short_description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.CleartextStream`]] object.\n", "ellipsis_description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.C...", "line": 175, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L175", "name": "connect", "path": "tls.connect" }, "tls.createSecurePair": { "id": "tls.createSecurePair", "type": "class method", "signatures": [ { "args": [ { "name": "credentials", "optional": true, "types": [ "Object" ] }, { "name": "isServer", "optional": true, "types": [ "Boolean" ] }, { "name": "requestCert", "optional": true, "types": [ "Boolean" ] }, { "name": "rejectUnauthorized", "optional": true, "types": [ "Boolean" ] } ], "returns": [ { "type": "tls.SecurePair" } ] } ], "arguments": [ { "name": "credentials", "types": [ "Object" ], "description": "An optional credentials object from [[crypto.createCredentials `crypto.createCredentials()`]]", "optional": true }, { "name": "isServer", "types": [ "Boolean" ], "description": "An optional boolean indicating whether this TLS connection should be opened as a server (`true`) or a client (`false`)", "optional": true }, { "name": "requestCert", "types": [ "Boolean" ], "description": "A boolean indicating whether a server should request a certificate from a connecting client; only applies to server connections", "optional": true }, { "name": "rejectUnauthorized", "types": [ "Boolean" ], "description": "A boolean indicating whether a server should automatically reject clients with invalid certificates; only applies to servers with `requestCert` enabled", "optional": true } ], "description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data. This function returns a\nSecurePair object with [[tls.CleartextStream `tls.CleartextStream`]] and\n`encrypted` stream properties.\n\nGenerally, the encrypted strean is piped to/from an incoming encrypted data\nstream, and the cleartext one is used as a replacement for the initial encrypted\nstream.", "short_description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data. This function returns a\nSecurePair object with [[tls.CleartextStream `tls.CleartextStream`]] and\n`encrypted` stream properties.\n", "ellipsis_description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.createSecurePair", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L202", "name": "createSecurePair", "path": "tls.createSecurePair" }, "tls.createServer": { "id": "tls.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "secureConnectionListener", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "secureConnectionListener", "types": [ "Function" ], "description": "An optional listener", "optional": true } ], "description": "Creates a new [[tls.Server `tls.Server`]].\n\nThe `options` object has the following mix of required values:\n\n - `pfx`: A string or `Buffer` containing the private key, certificate, and\n CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\n the `key`, `cert`, and `ca` options.)\n\n - `key`: A string or `Buffer` containing the private key of the server in a\nPEM format. (Required)\n\n - `cert`: A string or `Buffer` containing the certificate key of the server in\na PEM format. (Required)\n\n`options` also has the following option values:\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simplier: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `passphrase`: A string of a passphrase for the private key or pfx.\n\n - `rejectUnauthorized`: If `true` the server rejects any connection that is\nnot authorized with the list of supplied CAs. This option only has an effect if\n`requestCert` is `true`. This defaults to `false`.\n\n - `requestCert`: If `true` the server requests a certificate from clients that\nconnect and attempt to verify that certificate. This defaults to `false`.\n\n - `sessionIdContext`: A string containing an opaque identifier for session\nresumption. If `requestCert` is `true`, the default is an MD5 hash value\ngenerated from the command line. Otherwise, the default is not provided.\n\n - `SNICallback`: A function that is called if the client supports the SNI TLS\nextension. Only one argument will be passed to it: `servername`. `SNICallback`\nshould return a SecureContext instance. You can use\n`crypto.createCredentials(...).context` to get a proper SecureContext. If\n`SNICallback` wasn't provided, a default callback within the high-level API is\nused (for more information, see below).\n\n`secureConnectionListener` automatically sets a listener for the\n[`secureConnection`](#tls.event.secureConnection) event.\n\n#### Example\n\nHere's a simple \"echo\" server:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n key: fs.readFileSync('server-key.pem'),\n cert: fs.readFileSync('server-cert.pem'),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n // This is necessary only if the client uses the self-signed certificate.\n ca: [ fs.readFileSync('client-cert.pem') ]\n };\n\n var server = tls.createServer(options, function(cleartextStream) {\n console.log('server connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n cleartextStream.write(\"welcome!\\n\");\n cleartextStream.setEncoding('utf8');\n cleartextStream.pipe(cleartextStream);\n });\n server.listen(8000, function() {\n console.log('server bound');\n });\n\nOr, with pfx:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n pfx: fs.readFileSync('server.pfx'),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n };\n\n var server = tls.createServer(options, function(cleartextStream) {\n console.log('server connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n cleartextStream.write(\"welcome!\\n\");\n cleartextStream.setEncoding('utf8');\n cleartextStream.pipe(cleartextStream);\n });\n server.listen(8000, function() {\n console.log('server bound');\n });\n\nYou can test this server by connecting to it with `openssl s_client`:\n\n openssl s_client -connect 127.0.0.1:8000", "short_description": "Creates a new [[tls.Server `tls.Server`]].\n", "ellipsis_description": "Creates a new [[tls.Server `tls.Server`]].\n ...", "line": 316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L316", "name": "createServer", "path": "tls.createServer" }, "tls.Server": { "id": "tls.Server", "type": "class", "superclass": "tls", "description": "This class is a subclass of [[net.Server `net.Server`]] and has the same methods\nas it. However, instead of accepting just raw TCP connections, it also accepts\nencrypted connections using TLS or SSL.", "short_description": "This class is a subclass of [[net.Server `net.Server`]] and has the same methods\nas it. However, instead of accepting just raw TCP connections, it also accepts\nencrypted connections using TLS or SSL.", "ellipsis_description": "This class is a subclass of [[net.Server `net.Server`]] and has the same methods\nas it. However, instead of acceptin...", "line": 325, "aliases": [], "children": [ { "id": "tls.Server.addContext", "type": "class method", "signatures": [ { "args": [ { "name": "hostname", "types": [ "String" ] }, { "name": "credentials", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "hostname", "types": [ "String" ], "description": "The hostname to match" }, { "name": "credentials", "types": [ "Object" ], "description": "The credentials to use" } ], "description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can be used). `credentials` can contain\n`key`, `cert`, and `ca`.\n\n#### Example\n var serverResults = [];\n\n var server = tls.createServer(serverOptions, function(c) {\n serverResults.push(c.servername);\n });\n\n server.addContext('a.example.com', SNIContexts['a.example.com']);\n server.addContext('*.test.com', SNIContexts['asterisk.test.com']);\n\n server.listen(1337);", "short_description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can be used). `credentials` can contain\n`key`, `cert`, and `ca`.\n", "ellipsis_description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can b...", "line": 348, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.addContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L348", "name": "addContext", "path": "tls.Server.addContext" }, { "id": "tls.Server.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n\nFor more information, see [[net.Server.address `net.Server.address()`]].", "short_description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n", "ellipsis_description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n ...", "line": 358, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L358", "name": "address", "path": "tls.Server.address" }, { "id": "tls.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close'` event.", "short_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close'` event.", "ellipsis_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed whe...", "line": 367, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L367", "name": "close", "path": "tls.Server.close" }, { "id": "tls.Server.connections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of concurrent connections on the server.", "short_description": "The number of concurrent connections on the server.", "ellipsis_description": "The number of concurrent connections on the server. ...", "line": 400, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L400", "name": "connections", "path": "tls.Server.connections" }, { "id": "tls.Server.listen", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The specific port to listen to" }, { "name": "host", "types": [ "String" ], "description": "An optional host to listen to", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute when the server has been bound", "optional": true } ], "description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept connections directed to any IPv4 address\n(`INADDR_ANY`).\n\nFor more information, see [[net.Server `net.Server`]].", "short_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept connections directed to any IPv4 address\n(`INADDR_ANY`).\n", "ellipsis_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept co...", "line": 382, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L382", "name": "listen", "path": "tls.Server.listen" }, { "id": "tls.Server.maxConnections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Set this property to reject connections when the server's connection count gets\nhigh.", "short_description": "Set this property to reject connections when the server's connection count gets\nhigh.", "ellipsis_description": "Set this property to reject connections when the server's connection count gets\nhigh. ...", "line": 408, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.maxConnections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L408", "name": "maxConnections", "path": "tls.Server.maxConnections" }, { "id": "tls.Server.pause", "type": "class method", "signatures": [ { "args": [ { "name": "msecs", "default_value": 1000, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "msecs", "types": [ "Number" ], "description": "The number of milliseconds to pause for" } ], "description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "short_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "ellipsis_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections...", "line": 392, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L392", "name": "pause", "path": "tls.Server.pause" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L325", "name": "Server", "path": "tls.Server" }, "tls.Server.addContext": { "id": "tls.Server.addContext", "type": "class method", "signatures": [ { "args": [ { "name": "hostname", "types": [ "String" ] }, { "name": "credentials", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "hostname", "types": [ "String" ], "description": "The hostname to match" }, { "name": "credentials", "types": [ "Object" ], "description": "The credentials to use" } ], "description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can be used). `credentials` can contain\n`key`, `cert`, and `ca`.\n\n#### Example\n var serverResults = [];\n\n var server = tls.createServer(serverOptions, function(c) {\n serverResults.push(c.servername);\n });\n\n server.addContext('a.example.com', SNIContexts['a.example.com']);\n server.addContext('*.test.com', SNIContexts['asterisk.test.com']);\n\n server.listen(1337);", "short_description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can be used). `credentials` can contain\n`key`, `cert`, and `ca`.\n", "ellipsis_description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can b...", "line": 348, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.addContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L348", "name": "addContext", "path": "tls.Server.addContext" }, "tls.Server.address": { "id": "tls.Server.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n\nFor more information, see [[net.Server.address `net.Server.address()`]].", "short_description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n", "ellipsis_description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n ...", "line": 358, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L358", "name": "address", "path": "tls.Server.address" }, "tls.Server.close": { "id": "tls.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close'` event.", "short_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close'` event.", "ellipsis_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed whe...", "line": 367, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L367", "name": "close", "path": "tls.Server.close" }, "tls.Server.listen": { "id": "tls.Server.listen", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The specific port to listen to" }, { "name": "host", "types": [ "String" ], "description": "An optional host to listen to", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute when the server has been bound", "optional": true } ], "description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept connections directed to any IPv4 address\n(`INADDR_ANY`).\n\nFor more information, see [[net.Server `net.Server`]].", "short_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept connections directed to any IPv4 address\n(`INADDR_ANY`).\n", "ellipsis_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept co...", "line": 382, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L382", "name": "listen", "path": "tls.Server.listen" }, "tls.Server.pause": { "id": "tls.Server.pause", "type": "class method", "signatures": [ { "args": [ { "name": "msecs", "default_value": 1000, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "msecs", "types": [ "Number" ], "description": "The number of milliseconds to pause for" } ], "description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "short_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "ellipsis_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections...", "line": 392, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L392", "name": "pause", "path": "tls.Server.pause" }, "tls.Server.connections": { "id": "tls.Server.connections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of concurrent connections on the server.", "short_description": "The number of concurrent connections on the server.", "ellipsis_description": "The number of concurrent connections on the server. ...", "line": 400, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L400", "name": "connections", "path": "tls.Server.connections" }, "tls.Server.maxConnections": { "id": "tls.Server.maxConnections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Set this property to reject connections when the server's connection count gets\nhigh.", "short_description": "Set this property to reject connections when the server's connection count gets\nhigh.", "ellipsis_description": "Set this property to reject connections when the server's connection count gets\nhigh. ...", "line": 408, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.maxConnections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L408", "name": "maxConnections", "path": "tls.Server.maxConnections" }, "tls.SecurePair": { "id": "tls.SecurePair", "type": "class", "superclass": "tls", "description": "Returned by [[tls.createSecurePair `tls.createSecurePair()`]].", "short_description": "Returned by [[tls.createSecurePair `tls.createSecurePair()`]].", "ellipsis_description": "Returned by [[tls.createSecurePair `tls.createSecurePair()`]]. ...", "line": 415, "aliases": [], "children": [ { "id": "tls.SecurePair@secure", "type": "event", "signatures": [ { "args": [] } ], "description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n\nSimilar to the checking for the server `'secureConnection'` event,\n[[tls.CleartextStream.authorized `tls.CleartextStream.authorized`]] should be\nchecked to confirm whether the certificate used properly authorized.", "short_description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n", "ellipsis_description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n ...", "line": 428, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.SecurePair@secure", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L428", "name": "secure", "path": "tls.SecurePair.event.secure" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.SecurePair", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L415", "name": "SecurePair", "path": "tls.SecurePair" }, "tls.SecurePair@secure": { "id": "tls.SecurePair@secure", "type": "event", "signatures": [ { "args": [] } ], "description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n\nSimilar to the checking for the server `'secureConnection'` event,\n[[tls.CleartextStream.authorized `tls.CleartextStream.authorized`]] should be\nchecked to confirm whether the certificate used properly authorized.", "short_description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n", "ellipsis_description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n ...", "line": 428, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.SecurePair@secure", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L428", "name": "secure", "path": "tls.SecurePair.event.secure" }, "tls.CleartextStream": { "id": "tls.CleartextStream", "type": "class", "superclass": "tls", "description": "This is a stream on top of the encrypted stream that makes it possible to\nread/write an encrypted data as a cleartext data.\n\nThis instance implements the duplex [[streams `Stream`]] interfaces. It has all\nthe common stream methods and events.", "short_description": "This is a stream on top of the encrypted stream that makes it possible to\nread/write an encrypted data as a cleartext data.\n", "ellipsis_description": "This is a stream on top of the encrypted stream that makes it possible to\nread/write an encrypted data as a cleartex...", "line": 439, "aliases": [], "children": [ { "id": "tls.CleartextStream.authorizationError", "type": "class property", "signatures": [ { "returns": [ { "type": "Error" } ] } ], "description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStream.authorized === false`.", "short_description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStream.authorized === false`.", "ellipsis_description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStr...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.authorizationError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L485", "name": "authorizationError", "path": "tls.CleartextStream.authorizationError" }, { "id": "tls.CleartextStream.authorized", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`.", "short_description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`.", "ellipsis_description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`. ...", "line": 473, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.authorized", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L473", "name": "authorized", "path": "tls.CleartextStream.authorized" }, { "id": "tls.CleartextStream.connections", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two properties, _e.g._\n`{\"address\":\"192.168.57.1\", \"port\":62053}`", "short_description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two properties, _e.g._\n`{\"address\":\"192.168.57.1\", \"port\":62053}`", "ellipsis_description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two ...", "line": 531, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L531", "name": "connections", "path": "tls.CleartextStream.connections" }, { "id": "tls.CleartextStream.getPeerCertificate", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n\nIf the peer does not provide a certificate, it returns `null` or an empty\nobject.\n\n#### Example\n\n { subject:\n { C: 'UK',\n ST: 'Acknack Ltd',\n L: 'Rhys Jones',\n O: 'node.js',\n OU: 'Test TLS Certificate',\n CN: 'localhost' },\n issuer:\n { C: 'UK',\n ST: 'Acknack Ltd',\n L: 'Rhys Jones',\n O: 'node.js',\n OU: 'Test TLS Certificate',\n CN: 'localhost' },\n valid_from: 'Nov 11 09:52:22 2009 GMT',\n valid_to: 'Nov 6 09:52:22 2029 GMT',\n fingerprint:\n'2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF' }", "short_description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n", "ellipsis_description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the ...", "line": 520, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.getPeerCertificate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L520", "name": "getPeerCertificate", "path": "tls.CleartextStream.getPeerCertificate" }, { "id": "tls.CleartextStream.remoteAddress", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "short_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "ellipsis_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`. ...", "line": 542, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.remoteAddress", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L542", "name": "remoteAddress", "path": "tls.CleartextStream.remoteAddress" }, { "id": "tls.CleartextStream.remotePort", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The numeric representation of the remote port. For example, `443`.", "short_description": "The numeric representation of the remote port. For example, `443`.", "ellipsis_description": "The numeric representation of the remote port. For example, `443`. ...", "line": 554, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.remotePort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L554", "name": "remotePort", "path": "tls.CleartextStream.remotePort" }, { "id": "tls.CleartextStream@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The standard Error object" } ], "description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, and the error is passed along.", "short_description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, and the error is passed along.", "ellipsis_description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, an...", "line": 465, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L465", "name": "clientError", "path": "tls.CleartextStream.event.clientError" }, { "id": "tls.CleartextStream@secureConnect", "type": "event", "signatures": [ { "args": [] } ], "description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server's certificate was authorized\nor not.\n\nIt is up to the user to test `cleartextStream.authorized` to see if the server\ncertificate was signed by one of the specified CAs. If\n`cleartextStream.authorized === false`, then the error can be found in\n`cleartextStream.authorizationError`. Also if NPN was used, you can check\n`cleartextStream.npnProtocol` for the negotiated protocol.", "short_description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server's certificate was authorized\nor not.\n", "ellipsis_description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter...", "line": 455, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream@secureConnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L455", "name": "secureConnect", "path": "tls.CleartextStream.event.secureConnect" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L439", "name": "CleartextStream", "path": "tls.CleartextStream" }, "tls.CleartextStream@secureConnect": { "id": "tls.CleartextStream@secureConnect", "type": "event", "signatures": [ { "args": [] } ], "description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server's certificate was authorized\nor not.\n\nIt is up to the user to test `cleartextStream.authorized` to see if the server\ncertificate was signed by one of the specified CAs. If\n`cleartextStream.authorized === false`, then the error can be found in\n`cleartextStream.authorizationError`. Also if NPN was used, you can check\n`cleartextStream.npnProtocol` for the negotiated protocol.", "short_description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server's certificate was authorized\nor not.\n", "ellipsis_description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter...", "line": 455, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream@secureConnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L455", "name": "secureConnect", "path": "tls.CleartextStream.event.secureConnect" }, "tls.CleartextStream@clientError": { "id": "tls.CleartextStream@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The standard Error object" } ], "description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, and the error is passed along.", "short_description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, and the error is passed along.", "ellipsis_description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, an...", "line": 465, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L465", "name": "clientError", "path": "tls.CleartextStream.event.clientError" }, "tls.CleartextStream.authorized": { "id": "tls.CleartextStream.authorized", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`.", "short_description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`.", "ellipsis_description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`. ...", "line": 473, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.authorized", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L473", "name": "authorized", "path": "tls.CleartextStream.authorized" }, "tls.CleartextStream.authorizationError": { "id": "tls.CleartextStream.authorizationError", "type": "class property", "signatures": [ { "returns": [ { "type": "Error" } ] } ], "description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStream.authorized === false`.", "short_description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStream.authorized === false`.", "ellipsis_description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStr...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.authorizationError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L485", "name": "authorizationError", "path": "tls.CleartextStream.authorizationError" }, "tls.CleartextStream.getPeerCertificate": { "id": "tls.CleartextStream.getPeerCertificate", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n\nIf the peer does not provide a certificate, it returns `null` or an empty\nobject.\n\n#### Example\n\n { subject:\n { C: 'UK',\n ST: 'Acknack Ltd',\n L: 'Rhys Jones',\n O: 'node.js',\n OU: 'Test TLS Certificate',\n CN: 'localhost' },\n issuer:\n { C: 'UK',\n ST: 'Acknack Ltd',\n L: 'Rhys Jones',\n O: 'node.js',\n OU: 'Test TLS Certificate',\n CN: 'localhost' },\n valid_from: 'Nov 11 09:52:22 2009 GMT',\n valid_to: 'Nov 6 09:52:22 2029 GMT',\n fingerprint:\n'2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF' }", "short_description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n", "ellipsis_description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the ...", "line": 520, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.getPeerCertificate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L520", "name": "getPeerCertificate", "path": "tls.CleartextStream.getPeerCertificate" }, "tls.CleartextStream.connections": { "id": "tls.CleartextStream.connections", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two properties, _e.g._\n`{\"address\":\"192.168.57.1\", \"port\":62053}`", "short_description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two properties, _e.g._\n`{\"address\":\"192.168.57.1\", \"port\":62053}`", "ellipsis_description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two ...", "line": 531, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L531", "name": "connections", "path": "tls.CleartextStream.connections" }, "tls.CleartextStream.remoteAddress": { "id": "tls.CleartextStream.remoteAddress", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "short_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "ellipsis_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`. ...", "line": 542, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.remoteAddress", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L542", "name": "remoteAddress", "path": "tls.CleartextStream.remoteAddress" }, "tls.CleartextStream.remotePort": { "id": "tls.CleartextStream.remotePort", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The numeric representation of the remote port. For example, `443`.", "short_description": "The numeric representation of the remote port. For example, `443`.", "ellipsis_description": "The numeric representation of the remote port. For example, `443`. ...", "line": 554, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.remotePort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L554", "name": "remotePort", "path": "tls.CleartextStream.remotePort" }, "tty": { "id": "tty", "type": "class", "description": "\nThis module controls printing to the terminal output. Use `require('tty')` to\naccess this module.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThis module controls printing to the terminal output. Use `require('tty')` to\naccess this module.\n", "ellipsis_description": "\nThis module controls printing to the terminal output. Use `require('tty')` to\naccess this module.\n ...", "line": 14, "aliases": [], "children": [ { "id": "tty.getWindowSize", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "Array" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to check (deprecated: 0.6.0)" } ], "description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead.", "short_description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead.", "ellipsis_description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.getWindowSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L24", "name": "getWindowSize", "path": "tty.getWindowSize" }, { "id": "tty.isatty", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to check" } ], "description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal.", "short_description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal.", "ellipsis_description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal. ...", "line": 33, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.isatty", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L33", "name": "isatty", "path": "tty.isatty" }, { "id": "tty.setRawMode", "type": "class method", "signatures": [ { "args": [ { "name": "mode", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "mode", "types": [ "Boolean" ], "description": "A boolean value indicating how to set the rawness" } ], "description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or default (`false`).", "short_description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or default (`false`).", "ellipsis_description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or de...", "line": 42, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.setRawMode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L42", "name": "setRawMode", "path": "tty.setRawMode" }, { "id": "tty.setWindowSize", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "row", "types": [ "Number" ] }, { "name": "col", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to use" }, { "name": "row", "types": [ "Number" ], "description": "The number of rows" }, { "name": "col", "types": [ "Number" ], "description": "The number of columns (deprecated: 0.6.0)" } ], "description": "This function no longer exists.", "short_description": "This function no longer exists.", "ellipsis_description": "This function no longer exists. ...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.setWindowSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L53", "name": "setWindowSize", "path": "tty.setWindowSize" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L14", "name": "tty", "path": "tty" }, "tty.getWindowSize": { "id": "tty.getWindowSize", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "Array" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to check (deprecated: 0.6.0)" } ], "description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead.", "short_description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead.", "ellipsis_description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.getWindowSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L24", "name": "getWindowSize", "path": "tty.getWindowSize" }, "tty.isatty": { "id": "tty.isatty", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to check" } ], "description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal.", "short_description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal.", "ellipsis_description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal. ...", "line": 33, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.isatty", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L33", "name": "isatty", "path": "tty.isatty" }, "tty.setRawMode": { "id": "tty.setRawMode", "type": "class method", "signatures": [ { "args": [ { "name": "mode", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "mode", "types": [ "Boolean" ], "description": "A boolean value indicating how to set the rawness" } ], "description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or default (`false`).", "short_description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or default (`false`).", "ellipsis_description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or de...", "line": 42, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.setRawMode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L42", "name": "setRawMode", "path": "tty.setRawMode" }, "tty.setWindowSize": { "id": "tty.setWindowSize", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "row", "types": [ "Number" ] }, { "name": "col", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to use" }, { "name": "row", "types": [ "Number" ], "description": "The number of rows" }, { "name": "col", "types": [ "Number" ], "description": "The number of columns (deprecated: 0.6.0)" } ], "description": "This function no longer exists.", "short_description": "This function no longer exists.", "ellipsis_description": "This function no longer exists. ...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.setWindowSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L53", "name": "setWindowSize", "path": "tty.setWindowSize" }, "url": { "id": "url", "type": "class", "description": "\nThis module has utilities for URL resolution and parsing. To use it, add\n`require('url')` to your code.\n\nParsed URL objects have some or all of the following fields, depending on\nwhether or not they exist in the URL string. Any parts that are not in the URL\nstring are not in the parsed object. All the examples shown use the following\nURL:\n\n`'http://user:pass@HOST.com:8080/p/a/t/h?query=string#hash'`\n\n* `href`: the full URL that was originally parsed. Both the protocol and host\nare in lowercase.\n\n For the URL above, this is:\n`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`\n\n* `protocol`: the request protocol, in lowercase.\n\n For the URL above, this is: `'http:'`\n\n* `host`: the full lowercased host portion of the URL, including port and\nauthentication information.\n\n For the URL above, this is: `'user:pass@host.com:8080'`\n\n* `auth`: The authentication information from the URL.\n\n For the URL above, this is: `'user:pass'`\n\n* `hostname`: the lowercased hostname portion of the URL.\n\n For the URL above, this is: `'host.com'`\n\n* `port`: The port number of the URL.\n\n For the URL above, this is: `'8080'`\n\n* `pathname`: the path section of the URL, that comes after the host and before\nthe query, including the initial slash (if present).\n\n For the URL above, this is: `'/p/a/t/h'`\n\n* `search`: the 'query string' portion of the URL, including the leading\nquestion mark.\n\n For the URL above, this is: `'?query=string'`\n\n* `path`: a concatenation of `pathname` and `search`.\n\n For the URL above, this is: `'/p/a/t/h?query=string'`\n\n* `query`: either the 'params' portion of the query string, or a\nquerystring-parsed object.\n\n For the URL above, this is: `'query=string'` or `{'query':'string'}`\n\n* `hash`: the 'fragment' portion of the URL including the pound-sign.\n\n For the URL above, this is: `'#hash'`", "stability": "3 - Stable", "short_description": "\nThis module has utilities for URL resolution and parsing. To use it, add\n`require('url')` to your code.\n", "ellipsis_description": "\nThis module has utilities for URL resolution and parsing. To use it, add\n`require('url')` to your code.\n ...", "line": 70, "aliases": [], "children": [ { "id": "url.format", "type": "class method", "signatures": [ { "args": [ { "name": "urlObj", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "urlObj", "types": [ "String" ], "description": "The object to tranform into a URL" } ], "description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n\n* `href` is ignored.\n* `protocol` is treated the same with or without the trailing `:` (colon). Note\nthat:\n * The protocols `http`, `https`, `ftp`, `gopher`, and `file` are postfixed\n with `://`\n * All other protocols (like `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc) are\n postfixed with `:`\n* `auth` is used if it's available\n* `hostname` is only used if `host` is absent\n* `port` is only used if `host` is absent\n* `host` is only used in place of `auth`, `hostname`, and `port`\n* `pathname` is treated the same with or without the leading `/` (slash)\n* `search` is used in place of `query`\n* `query`, a [querystring](querystring.html) object, is only used if `search` is\nabsent\n* `search` is treated the same with or without the leading `?`\n* `hash` is treated the same with or without the leading `#`", "short_description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n", "ellipsis_description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n ...", "line": 116, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.format", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L116", "name": "format", "path": "url.format" }, { "id": "url.parse", "type": "class method", "signatures": [ { "args": [ { "name": "urlStr", "types": [ "String" ] }, { "name": "parseQueryString", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "slashesDenoteHost", "default_value": false, "optional": true, "types": [ "Boolean" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "urlStr", "types": [ "String" ], "description": "The URL string" }, { "name": "parseQueryString", "types": [ "Boolean" ], "description": "If `true`, the method parses the URL using the [[querystring `querystring`]] module", "optional": true }, { "name": "slashesDenoteHost", "types": [ "Boolean" ], "description": "If `true`, `//foo/bar` acts like `{ host : 'foo', pathname '/bar' }`, instead of `{ pathname : '//foo/bar' }`", "optional": true } ], "description": "Takes a URL string, and return it as an object.", "short_description": "Takes a URL string, and return it as an object.", "ellipsis_description": "Takes a URL string, and return it as an object. ...", "line": 86, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.parse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L86", "name": "parse", "path": "url.parse" }, { "id": "url.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "from", "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "The base URL" }, { "name": "to", "types": [ "String" ], "description": "The href URL" } ], "description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n\n#### Example\n\n", "short_description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n", "ellipsis_description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n ...", "line": 131, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L131", "name": "resolve", "path": "url.resolve" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L70", "name": "url", "path": "url" }, "url.parse": { "id": "url.parse", "type": "class method", "signatures": [ { "args": [ { "name": "urlStr", "types": [ "String" ] }, { "name": "parseQueryString", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "slashesDenoteHost", "default_value": false, "optional": true, "types": [ "Boolean" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "urlStr", "types": [ "String" ], "description": "The URL string" }, { "name": "parseQueryString", "types": [ "Boolean" ], "description": "If `true`, the method parses the URL using the [[querystring `querystring`]] module", "optional": true }, { "name": "slashesDenoteHost", "types": [ "Boolean" ], "description": "If `true`, `//foo/bar` acts like `{ host : 'foo', pathname '/bar' }`, instead of `{ pathname : '//foo/bar' }`", "optional": true } ], "description": "Takes a URL string, and return it as an object.", "short_description": "Takes a URL string, and return it as an object.", "ellipsis_description": "Takes a URL string, and return it as an object. ...", "line": 86, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.parse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L86", "name": "parse", "path": "url.parse" }, "url.format": { "id": "url.format", "type": "class method", "signatures": [ { "args": [ { "name": "urlObj", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "urlObj", "types": [ "String" ], "description": "The object to tranform into a URL" } ], "description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n\n* `href` is ignored.\n* `protocol` is treated the same with or without the trailing `:` (colon). Note\nthat:\n * The protocols `http`, `https`, `ftp`, `gopher`, and `file` are postfixed\n with `://`\n * All other protocols (like `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc) are\n postfixed with `:`\n* `auth` is used if it's available\n* `hostname` is only used if `host` is absent\n* `port` is only used if `host` is absent\n* `host` is only used in place of `auth`, `hostname`, and `port`\n* `pathname` is treated the same with or without the leading `/` (slash)\n* `search` is used in place of `query`\n* `query`, a [querystring](querystring.html) object, is only used if `search` is\nabsent\n* `search` is treated the same with or without the leading `?`\n* `hash` is treated the same with or without the leading `#`", "short_description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n", "ellipsis_description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n ...", "line": 116, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.format", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L116", "name": "format", "path": "url.format" }, "url.resolve": { "id": "url.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "from", "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "The base URL" }, { "name": "to", "types": [ "String" ], "description": "The href URL" } ], "description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n\n#### Example\n\n", "short_description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n", "ellipsis_description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n ...", "line": 131, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L131", "name": "resolve", "path": "url.resolve" }, "util": { "id": "util", "type": "class", "description": "\n\nThe `util` module provides varies utilities that you can use in your Node.js\nprograms, fmostly around verifying the type of an object. To access these\nmethods, add `require('util')` to your code.", "stability": "5 - Locked", "short_description": "\n", "ellipsis_description": "\n ...", "line": 13, "aliases": [], "children": [ { "id": "util.debug", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`.", "short_description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`.", "ellipsis_description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.debug", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L24", "name": "debug", "path": "util.debug" }, { "id": "util.error", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`.", "short_description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`.", "ellipsis_description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`. ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L82", "name": "error", "path": "util.error" }, { "id": "util.format", "type": "class method", "signatures": [ { "args": [ { "name": "format", "types": [ "String" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "format", "types": [ "String" ], "description": "Placeholders used for formatting" }, { "name": "arg", "types": [ "String" ], "description": "The string to print, and any additional formatting arguments", "optional": true } ], "description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n\nThe first argument is a string that contains zero or more placeholders. Each\nplaceholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n* `%s` - String.\n* `%d` - Number (both integer and float).\n* `%j` - JSON.\n* `%%` - single percent sign (`'%'`). This does not consume an argument.\n\n\n#### Example\n\n", "short_description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n", "ellipsis_description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_forma...", "line": 50, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.format", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L50", "name": "format", "path": "util.format" }, { "id": "util.inherits", "type": "class method", "signatures": [ { "args": [ { "name": "constructor", "types": [ "Function" ] }, { "name": "superConstructor", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "constructor", "types": [ "Function" ], "description": "The prototype methods to inherit" }, { "name": "superConstructor", "types": [ "Object" ], "description": "The new object's type" } ], "description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new object created from `superConstructor`.\n\nAs an additional convenience, `superConstructor` is accessible through the\n`constructor.super_` property.\n\nFor more information, see the MDN\n[`constructor`](https://developer.mozilla.org/en/Javascript/Reference/Global_Obj\nects/Object/constructor) documentation.\n\n#### Example\n\n", "short_description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new object created from `superConstructor`.\n", "ellipsis_description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new obje...", "line": 207, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.inherits", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L207", "name": "inherits", "path": "util.inherits" }, { "id": "util.inspect", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] }, { "name": "showHidden", "default_value": false, "types": [ "Boolean" ] }, { "name": "depth", "default_value": 2, "types": [ "Number" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be represented" }, { "name": "showHidden", "types": [ "Boolean" ], "description": "Identifies whether the non-enumerable properties are also shown" }, { "name": "depth", "types": [ "Number" ], "description": "Indicates how many times to recurse while formatting the object" } ], "description": "Returns a string representation of `object`, which is useful for debugging.\n\nTo make the function recurse an object indefinitely, pass in `null` for `depth`.\n\nIf `colors` is `true`, the output is styled with ANSI color codes.\n\n#### Example\n\nHere's an example inspecting all the properties of the `util` object:\n\n", "short_description": "Returns a string representation of `object`, which is useful for debugging.\n", "ellipsis_description": "Returns a string representation of `object`, which is useful for debugging.\n ...", "line": 73, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.inspect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L73", "name": "inspect", "path": "util.inspect" }, { "id": "util.isArray", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is an `Array`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is an `Array`.\n", "ellipsis_description": "Returns `true` if the given object is an `Array`.\n ...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isArray", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L113", "name": "isArray", "path": "util.isArray" }, { "id": "util.isDate", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is a `Date`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is a `Date`.\n", "ellipsis_description": "Returns `true` if the given object is a `Date`.\n ...", "line": 127, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isDate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L127", "name": "isDate", "path": "util.isDate" }, { "id": "util.isError", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is an `Error`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is an `Error`.\n", "ellipsis_description": "Returns `true` if the given object is an `Error`.\n ...", "line": 141, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L141", "name": "isError", "path": "util.isError" }, { "id": "util.isRegExp", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given \"object\" is a `RegExp`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given \"object\" is a `RegExp`.\n", "ellipsis_description": "Returns `true` if the given \"object\" is a `RegExp`.\n ...", "line": 156, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isRegExp", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L156", "name": "isRegExp", "path": "util.isRegExp" }, { "id": "util.log", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "Outputs to `stdout`...but with a timestamp!", "short_description": "Outputs to `stdout`...but with a timestamp!", "ellipsis_description": "Outputs to `stdout`...but with a timestamp! ...", "line": 167, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.log", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L167", "name": "log", "path": "util.log" }, { "id": "util.print", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true } ] } ], "description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does not place newlines after each argument.", "short_description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does not place newlines after each argument.", "ellipsis_description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does ...", "line": 99, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.print", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L99", "name": "print", "path": "util.print" }, { "id": "util.pump", "type": "class method", "signatures": [ { "args": [ { "name": "readableStream", "types": [ "streams.ReadableStream" ] }, { "name": "writableStream", "types": [ "streams.WritableStream" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "readableStream", "types": [ "streams.ReadableStream" ], "description": "The stream to read from" }, { "name": "writableStream", "types": [ "streams.WritableStream" ], "description": "The stream to write to" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback function once the pump is through", "optional": true } ], "description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n\nWhen `writableStream.write(data)` returns `false`, `readableStream` is paused\nuntil the `drain` event occurs on the `writableStream`. `callback` gets an error\nas its only argument and is called when `writableStream` is closed or when an\nerror occurs.", "short_description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n", "ellipsis_description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n ...", "line": 183, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.pump", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L183", "name": "pump", "path": "util.pump" }, { "id": "util.puts", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each argument.", "short_description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each argument.", "ellipsis_description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each ...", "line": 91, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.puts", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L91", "name": "puts", "path": "util.puts" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L13", "name": "util", "path": "util" }, "util.debug": { "id": "util.debug", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`.", "short_description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`.", "ellipsis_description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.debug", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L24", "name": "debug", "path": "util.debug" }, "util.format": { "id": "util.format", "type": "class method", "signatures": [ { "args": [ { "name": "format", "types": [ "String" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "format", "types": [ "String" ], "description": "Placeholders used for formatting" }, { "name": "arg", "types": [ "String" ], "description": "The string to print, and any additional formatting arguments", "optional": true } ], "description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n\nThe first argument is a string that contains zero or more placeholders. Each\nplaceholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n* `%s` - String.\n* `%d` - Number (both integer and float).\n* `%j` - JSON.\n* `%%` - single percent sign (`'%'`). This does not consume an argument.\n\n\n#### Example\n\n", "short_description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n", "ellipsis_description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_forma...", "line": 50, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.format", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L50", "name": "format", "path": "util.format" }, "util.inspect": { "id": "util.inspect", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] }, { "name": "showHidden", "default_value": false, "types": [ "Boolean" ] }, { "name": "depth", "default_value": 2, "types": [ "Number" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be represented" }, { "name": "showHidden", "types": [ "Boolean" ], "description": "Identifies whether the non-enumerable properties are also shown" }, { "name": "depth", "types": [ "Number" ], "description": "Indicates how many times to recurse while formatting the object" } ], "description": "Returns a string representation of `object`, which is useful for debugging.\n\nTo make the function recurse an object indefinitely, pass in `null` for `depth`.\n\nIf `colors` is `true`, the output is styled with ANSI color codes.\n\n#### Example\n\nHere's an example inspecting all the properties of the `util` object:\n\n", "short_description": "Returns a string representation of `object`, which is useful for debugging.\n", "ellipsis_description": "Returns a string representation of `object`, which is useful for debugging.\n ...", "line": 73, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.inspect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L73", "name": "inspect", "path": "util.inspect" }, "util.error": { "id": "util.error", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`.", "short_description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`.", "ellipsis_description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`. ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L82", "name": "error", "path": "util.error" }, "util.puts": { "id": "util.puts", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each argument.", "short_description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each argument.", "ellipsis_description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each ...", "line": 91, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.puts", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L91", "name": "puts", "path": "util.puts" }, "util.print": { "id": "util.print", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true } ] } ], "description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does not place newlines after each argument.", "short_description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does not place newlines after each argument.", "ellipsis_description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does ...", "line": 99, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.print", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L99", "name": "print", "path": "util.print" }, "util.isArray": { "id": "util.isArray", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is an `Array`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is an `Array`.\n", "ellipsis_description": "Returns `true` if the given object is an `Array`.\n ...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isArray", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L113", "name": "isArray", "path": "util.isArray" }, "util.isDate": { "id": "util.isDate", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is a `Date`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is a `Date`.\n", "ellipsis_description": "Returns `true` if the given object is a `Date`.\n ...", "line": 127, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isDate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L127", "name": "isDate", "path": "util.isDate" }, "util.isError": { "id": "util.isError", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is an `Error`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is an `Error`.\n", "ellipsis_description": "Returns `true` if the given object is an `Error`.\n ...", "line": 141, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L141", "name": "isError", "path": "util.isError" }, "util.isRegExp": { "id": "util.isRegExp", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given \"object\" is a `RegExp`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given \"object\" is a `RegExp`.\n", "ellipsis_description": "Returns `true` if the given \"object\" is a `RegExp`.\n ...", "line": 156, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isRegExp", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L156", "name": "isRegExp", "path": "util.isRegExp" }, "util.log": { "id": "util.log", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "Outputs to `stdout`...but with a timestamp!", "short_description": "Outputs to `stdout`...but with a timestamp!", "ellipsis_description": "Outputs to `stdout`...but with a timestamp! ...", "line": 167, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.log", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L167", "name": "log", "path": "util.log" }, "util.pump": { "id": "util.pump", "type": "class method", "signatures": [ { "args": [ { "name": "readableStream", "types": [ "streams.ReadableStream" ] }, { "name": "writableStream", "types": [ "streams.WritableStream" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "readableStream", "types": [ "streams.ReadableStream" ], "description": "The stream to read from" }, { "name": "writableStream", "types": [ "streams.WritableStream" ], "description": "The stream to write to" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback function once the pump is through", "optional": true } ], "description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n\nWhen `writableStream.write(data)` returns `false`, `readableStream` is paused\nuntil the `drain` event occurs on the `writableStream`. `callback` gets an error\nas its only argument and is called when `writableStream` is closed or when an\nerror occurs.", "short_description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n", "ellipsis_description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n ...", "line": 183, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.pump", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L183", "name": "pump", "path": "util.pump" }, "util.inherits": { "id": "util.inherits", "type": "class method", "signatures": [ { "args": [ { "name": "constructor", "types": [ "Function" ] }, { "name": "superConstructor", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "constructor", "types": [ "Function" ], "description": "The prototype methods to inherit" }, { "name": "superConstructor", "types": [ "Object" ], "description": "The new object's type" } ], "description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new object created from `superConstructor`.\n\nAs an additional convenience, `superConstructor` is accessible through the\n`constructor.super_` property.\n\nFor more information, see the MDN\n[`constructor`](https://developer.mozilla.org/en/Javascript/Reference/Global_Obj\nects/Object/constructor) documentation.\n\n#### Example\n\n", "short_description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new object created from `superConstructor`.\n", "ellipsis_description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new obje...", "line": 207, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.inherits", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L207", "name": "inherits", "path": "util.inherits" }, "vm": { "id": "vm", "type": "class", "description": "\nIn Node.js, Javascript code can be compiled and run immediately or compiled,\nsaved, and run later. To do that, you can add `require('vm');` to your code.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nIn Node.js, Javascript code can be compiled and run immediately or compiled,\nsaved, and run later. To do that, you can add `require('vm');` to your code.\n", "ellipsis_description": "\nIn Node.js, Javascript code can be compiled and run immediately or compiled,\nsaved, and run later. To do that, you ...", "line": 15, "aliases": [], "children": [ { "id": "vm.createContext", "type": "class method", "signatures": [ { "args": [ { "name": "initSandbox", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "initSandbox", "types": [ "Object" ], "description": "An object that is shallow-copied to seed the initial contents of the global object used by the context", "optional": true } ], "description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to `vm.runInContext()`.\n\nA (V8) context comprises a global object together with a set of build-in objects\nand functions.", "short_description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to `vm.runInContext()`.\n", "ellipsis_description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to ...", "line": 125, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.createContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L125", "name": "createContext", "path": "vm.createContext" }, { "id": "vm.createScript", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "vm.Script" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScript` prints the syntax error to stderr and\nthrows an exception.\n\n\n`createScript()` compiles `code` as if it were loaded from `filename`, but does\nnot run it. Instead, it returns a `vm.Script` object representing this compiled\ncode. The returned script is not bound to any global object. It is bound before\neach run, just for that run. The `filename` is optional, and is only used in\nstack traces.", "short_description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScript` prints the syntax error to stderr and\nthrows an exception.\n", "ellipsis_description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScri...", "line": 145, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.createScript", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L145", "name": "createScript", "path": "vm.createScript" }, { "id": "vm.runInContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "context", "types": [ "Object" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "context", "types": [ "Object" ], "description": "The context to execute it in, coming from [[vm.createContext `vm.createContext()`]]" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n\nA (V8) context comprises a global object, together with a set of built-in\nobjects and functions. Running code does not have access to local scope and the\nglobal object held within `context` is used as the global object for `code`. The\n`filename` is optional, and is only used in stack traces.\n\nIn case of syntax error in `code`, `vm.runInContext()` emits the syntax error to\nstderr and throws an exception.\n\nNote: Running untrusted code is a tricky business requiring great care. To prevent accidental global variable leakage, `vm.runInContext()` is quite useful, but safely running untrusted code requires a separate process.\n\n#### Example\n\nCompiling and executing code in an existing context.\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n", "ellipsis_description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n ...", "line": 109, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L109", "name": "runInContext", "path": "vm.runInContext" }, { "id": "vm.runInNewContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "sandbox", "optional": true, "types": [ "Object" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "sandbox", "types": [ "Object" ], "description": "A global object with properties to pass into `code`", "optional": true }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have access to local scope. The object `sandbox`\nis used as the global object for `code`.\n`sandbox` and `filename` are optional, and `filename` is only used in stack\ntraces.\n\nWarning: Running untrusted code is a tricky business requiring great care. To\nprevent accidental global variable leakage, `vm.runInNewContext()` is quite\nuseful, but safely running untrusted code requires a separate process.\n\nIn case of syntax error in `code`, `vm.runInNewContext()` emits the syntax error\nto stderr and throws an exception.\n\n#### Example\n\nHere's an example to ompile and execute code that increments a global variable\nand sets a new one. These globals are contained in the sandbox.\n\n", "short_description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have access to local scope. The object `sandbox`\nis used as the global object for `code`.\n`sandbox` and `filename` are optional, and `filename` is only used in stack\ntraces.\n", "ellipsis_description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have ...", "line": 74, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInNewContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L74", "name": "runInNewContext", "path": "vm.runInNewContext" }, { "id": "vm.runInThisContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Running code does not have access to local\nscope. The `filename` is optional, and is only used in stack traces.\n\nIn case of syntax error in `code`, `vm.runInThisContext()` emits the syntax\nerror to stderr and throws an exception.\n\n#### Example: Using `vm.runInThisContext` and `eval` to run the same code:\n\n\n\nSince `vm.runInThisContext()` doesn't have access to the local scope, `localVar`\nis unchanged. `eval` does have access to the local scope, so `localVar` is\nchanged.\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Running code does not have access to local\nscope. The `filename` is optional, and is only used in stack traces.\n", "ellipsis_description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Runni...", "line": 44, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInThisContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L44", "name": "runInThisContext", "path": "vm.runInThisContext" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm", "subclasses": [ "vm.Script" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L15", "name": "vm", "path": "vm" }, "vm.runInThisContext": { "id": "vm.runInThisContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Running code does not have access to local\nscope. The `filename` is optional, and is only used in stack traces.\n\nIn case of syntax error in `code`, `vm.runInThisContext()` emits the syntax\nerror to stderr and throws an exception.\n\n#### Example: Using `vm.runInThisContext` and `eval` to run the same code:\n\n\n\nSince `vm.runInThisContext()` doesn't have access to the local scope, `localVar`\nis unchanged. `eval` does have access to the local scope, so `localVar` is\nchanged.\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Running code does not have access to local\nscope. The `filename` is optional, and is only used in stack traces.\n", "ellipsis_description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Runni...", "line": 44, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInThisContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L44", "name": "runInThisContext", "path": "vm.runInThisContext" }, "vm.runInNewContext": { "id": "vm.runInNewContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "sandbox", "optional": true, "types": [ "Object" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "sandbox", "types": [ "Object" ], "description": "A global object with properties to pass into `code`", "optional": true }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have access to local scope. The object `sandbox`\nis used as the global object for `code`.\n`sandbox` and `filename` are optional, and `filename` is only used in stack\ntraces.\n\nWarning: Running untrusted code is a tricky business requiring great care. To\nprevent accidental global variable leakage, `vm.runInNewContext()` is quite\nuseful, but safely running untrusted code requires a separate process.\n\nIn case of syntax error in `code`, `vm.runInNewContext()` emits the syntax error\nto stderr and throws an exception.\n\n#### Example\n\nHere's an example to ompile and execute code that increments a global variable\nand sets a new one. These globals are contained in the sandbox.\n\n", "short_description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have access to local scope. The object `sandbox`\nis used as the global object for `code`.\n`sandbox` and `filename` are optional, and `filename` is only used in stack\ntraces.\n", "ellipsis_description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have ...", "line": 74, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInNewContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L74", "name": "runInNewContext", "path": "vm.runInNewContext" }, "vm.runInContext": { "id": "vm.runInContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "context", "types": [ "Object" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "context", "types": [ "Object" ], "description": "The context to execute it in, coming from [[vm.createContext `vm.createContext()`]]" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n\nA (V8) context comprises a global object, together with a set of built-in\nobjects and functions. Running code does not have access to local scope and the\nglobal object held within `context` is used as the global object for `code`. The\n`filename` is optional, and is only used in stack traces.\n\nIn case of syntax error in `code`, `vm.runInContext()` emits the syntax error to\nstderr and throws an exception.\n\nNote: Running untrusted code is a tricky business requiring great care. To prevent accidental global variable leakage, `vm.runInContext()` is quite useful, but safely running untrusted code requires a separate process.\n\n#### Example\n\nCompiling and executing code in an existing context.\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n", "ellipsis_description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n ...", "line": 109, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L109", "name": "runInContext", "path": "vm.runInContext" }, "vm.createContext": { "id": "vm.createContext", "type": "class method", "signatures": [ { "args": [ { "name": "initSandbox", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "initSandbox", "types": [ "Object" ], "description": "An object that is shallow-copied to seed the initial contents of the global object used by the context", "optional": true } ], "description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to `vm.runInContext()`.\n\nA (V8) context comprises a global object together with a set of build-in objects\nand functions.", "short_description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to `vm.runInContext()`.\n", "ellipsis_description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to ...", "line": 125, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.createContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L125", "name": "createContext", "path": "vm.createContext" }, "vm.createScript": { "id": "vm.createScript", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "vm.Script" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScript` prints the syntax error to stderr and\nthrows an exception.\n\n\n`createScript()` compiles `code` as if it were loaded from `filename`, but does\nnot run it. Instead, it returns a `vm.Script` object representing this compiled\ncode. The returned script is not bound to any global object. It is bound before\neach run, just for that run. The `filename` is optional, and is only used in\nstack traces.", "short_description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScript` prints the syntax error to stderr and\nthrows an exception.\n", "ellipsis_description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScri...", "line": 145, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.createScript", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L145", "name": "createScript", "path": "vm.createScript" }, "vm.Script": { "id": "vm.Script", "type": "class", "superclass": "vm", "description": "This object is created as a result of the [[vm.createScript\n`vm.createScript()`]] method. It represents some compiled code than can be run\nat a later moment.", "short_description": "This object is created as a result of the [[vm.createScript\n`vm.createScript()`]] method. It represents some compiled code than can be run\nat a later moment.", "ellipsis_description": "This object is created as a result of the [[vm.createScript\n`vm.createScript()`]] method. It represents some compile...", "line": 157, "aliases": [], "children": [ { "id": "vm.Script.runInNewContext", "type": "class method", "signatures": [ { "args": [ { "name": "sandbox", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "sandbox", "types": [ "Object" ], "description": "A global object with properties to pass into the `Script` object", "optional": true } ], "description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n\n`script.runInNewContext()` runs the code of `script` with `sandbox` as the\nglobal object and returns the result. Running code does not have access to local\nscope.\n\nWarning: Running untrusted code is a tricky business requiring great care. To\nprevent accidental global variable leakage, `script.runInNewContext()` is quite\nuseful, but safely running untrusted code requires a separate process.\n\n#### Example\n\nCompiling code that increments a global variable and sets one, then execute the\ncode multiple times:\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n", "ellipsis_description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n ...", "line": 215, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script.runInNewContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L215", "name": "runInNewContext", "path": "vm.Script.runInNewContext" }, { "id": "vm.Script.runInThisContext", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n\n`script.runInThisContext()` runs the code of `script` and returns the result.\nRunning code doesn't have access to local scope, but does have access to the\n`global` object.\n\n#### Example\n\nUsing `script.runInThisContext()` to compile code once and run it multiple\ntimes:\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n", "ellipsis_description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n ...", "line": 183, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script.runInThisContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L183", "name": "runInThisContext", "path": "vm.Script.runInThisContext" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L157", "name": "Script", "path": "vm.Script" }, "vm.Script.runInThisContext": { "id": "vm.Script.runInThisContext", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n\n`script.runInThisContext()` runs the code of `script` and returns the result.\nRunning code doesn't have access to local scope, but does have access to the\n`global` object.\n\n#### Example\n\nUsing `script.runInThisContext()` to compile code once and run it multiple\ntimes:\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n", "ellipsis_description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n ...", "line": 183, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script.runInThisContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L183", "name": "runInThisContext", "path": "vm.Script.runInThisContext" }, "vm.Script.runInNewContext": { "id": "vm.Script.runInNewContext", "type": "class method", "signatures": [ { "args": [ { "name": "sandbox", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "sandbox", "types": [ "Object" ], "description": "A global object with properties to pass into the `Script` object", "optional": true } ], "description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n\n`script.runInNewContext()` runs the code of `script` with `sandbox` as the\nglobal object and returns the result. Running code does not have access to local\nscope.\n\nWarning: Running untrusted code is a tricky business requiring great care. To\nprevent accidental global variable leakage, `script.runInNewContext()` is quite\nuseful, but safely running untrusted code requires a separate process.\n\n#### Example\n\nCompiling code that increments a global variable and sets one, then execute the\ncode multiple times:\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n", "ellipsis_description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n ...", "line": 215, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script.runInNewContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L215", "name": "runInNewContext", "path": "vm.Script.runInNewContext" }, "zlib": { "id": "zlib", "type": "class", "description": "\nThis provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the same options, and is a\nreadable/writable Stream.\n\nYou can access this module by adding `var zlib = require('zlib');` to your code.\n\nAll of the constants defined in `zlib.h` are also defined in this module. They\nare described in more detail in the [zlib\ndocumentation](http://zlib.net/manual.html#Constants).", "stability": "3 - Stable", "short_description": "\nThis provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the same options, and is a\nreadable/writable Stream.\n", "ellipsis_description": "\nThis provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the sam...", "line": 17, "aliases": [], "children": [ { "id": "zlib.createDeflate", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for compressing using deflate.", "short_description": "Returns a new object for compressing using deflate.", "ellipsis_description": "Returns a new object for compressing using deflate. ...", "line": 186, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createDeflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L186", "name": "createDeflate", "path": "zlib.createDeflate" }, { "id": "zlib.createDeflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for compressing using deflate, without an appended zlib\nheader.", "short_description": "Returns a new object for compressing using deflate, without an appended zlib\nheader.", "ellipsis_description": "Returns a new object for compressing using deflate, without an appended zlib\nheader. ...", "line": 211, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createDeflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L211", "name": "createDeflateRaw", "path": "zlib.createDeflateRaw" }, { "id": "zlib.createGunzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for Gunzip compression.", "short_description": "Returns a new object for Gunzip compression.", "ellipsis_description": "Returns a new object for Gunzip compression. ...", "line": 174, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createGunzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L174", "name": "createGunzip", "path": "zlib.createGunzip" }, { "id": "zlib.createGzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new Object for Gzip compression.", "short_description": "Returns a new Object for Gzip compression.", "ellipsis_description": "Returns a new Object for Gzip compression. ...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createGzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L162", "name": "createGzip", "path": "zlib.createGzip" }, { "id": "zlib.createInflate", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object to decompress a deflate stream.", "short_description": "Returns a new object to decompress a deflate stream.", "ellipsis_description": "Returns a new object to decompress a deflate stream. ...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createInflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L198", "name": "createInflate", "path": "zlib.createInflate" }, { "id": "zlib.createInflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header).", "short_description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header).", "ellipsis_description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header). ...", "line": 223, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createInflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L223", "name": "createInflateRaw", "path": "zlib.createInflateRaw" }, { "id": "zlib.createUnzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header.", "short_description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header.", "ellipsis_description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header. ...", "line": 236, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createUnzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L236", "name": "createUnzip", "path": "zlib.createUnzip" }, { "id": "zlib.deflate", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using deflate.", "short_description": "Compresses a buffer using deflate.", "ellipsis_description": "Compresses a buffer using deflate. ...", "line": 251, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.deflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L251", "name": "deflate", "path": "zlib.deflate" }, { "id": "zlib.deflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader).", "short_description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader).", "ellipsis_description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader). ...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.deflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L267", "name": "deflateRaw", "path": "zlib.deflateRaw" }, { "id": "zlib.gunzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Gunzip.", "short_description": "Decompress a buffer with Gunzip.", "ellipsis_description": "Decompress a buffer with Gunzip. ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.gunzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L297", "name": "gunzip", "path": "zlib.gunzip" }, { "id": "zlib.gzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using Gzip.", "short_description": "Compresses a buffer using Gzip.", "ellipsis_description": "Compresses a buffer using Gzip. ...", "line": 282, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.gzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L282", "name": "gzip", "path": "zlib.gzip" }, { "id": "zlib.inflate", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Inflate.", "short_description": "Decompress a buffer with Inflate.", "ellipsis_description": "Decompress a buffer with Inflate. ...", "line": 312, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.inflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L312", "name": "inflate", "path": "zlib.inflate" }, { "id": "zlib.inflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader)..", "short_description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader)..", "ellipsis_description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader).. ...", "line": 328, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.inflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L328", "name": "inflateRaw", "path": "zlib.inflateRaw" }, { "id": "zlib.options", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n\nNote that some options are only relevant when compressing, and are ignored by\nthe decompression classes.\n\nThe options are:\n\n* chunkSize (default: 16*1024)\n* windowBits\n* level (compression only)\n* memLevel (compression only)\n* strategy (compression only)\n\nSee the description of `deflateInit2` and `inflateInit2` at\n for more information on these.\n\n#### Memory Usage Tuning\n\nFrom `zlib/zconf.h`, modified to Node's usage:\n\nThe memory requirements for deflate are (in bytes):\n\n (1 << (windowBits+2)) + (1 << (memLevel+9))\n\nthat is: 128K for `windowBits=15` and 128K for `memLevel = 8`\n(default values) plus a few kilobytes for small objects.\n\nFor example, if you want to reduce the default memory requirements from 256K to\n128K, set the options to:\n\n { windowBits: 14, memLevel: 7 }\n\nOf course, this will generally degrade compression (there's no free lunch).\n\nThe memory requirements for inflate are (in bytes)\n\n 1 << windowBits\n\nthat is: 32K for `windowBits=15` (default value) plus a few kilobytes\nfor small objects.\n\nThis is in addition to a single internal output slab buffer of size `chunkSize`,\nwhich defaults to 16K.\n\nThe speed of zlib compression is affected most dramatically by the `level`\nsetting. A higher level will result in better compression, but takes longer to\ncomplete. A lower level will result in less compression, but will be much\nfaster.\n\nIn general, greater memory usage options will mean that node has to make fewer\ncalls to zlib, since it'll be able to process more data in a single `write`\noperation. This is another factor that affects the speed, at the cost of memory\nusage.\n\n#### Examples\n\nNote: These examples are drastically simplified to show the basic concept. Zlib encoding can be expensive, and the results ought to be cached. See [Memory Usage Tuning](#memory_Usage_Tuning) for more information on the speed/memory/compression tradeoffs involved in zlib usage.\n\nCompressing or decompressing a file can be done by piping an `fs.ReadStream`\ninto a zlib stream, then into an `fs.WriteStream`.\n\n\n\nCompressing or decompressing data in one step can be done by using the\nconvenience methods.\n\n\n\nTo use this module in an HTTP client or server, use the\n[accept-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n) on requests, and the\n[content-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.\n11) header on responses. Here's an example:\n\n // client request example\n var zlib = require('zlib');\n var http = require('http');\n var fs = require('fs');\n var request = http.get({ host: 'izs.me',\n path: '/',\n port: 80,\n headers: { 'accept-encoding': 'gzip,deflate' } });\n request.on('response', function(response) {\n var output = fs.createWriteStream('izs.me_index.html');\n\n switch (response.headers['content-encoding']) {\n // or, just use zlib.createUnzip() to handle both cases\n case 'gzip':\n response.pipe(zlib.createGunzip()).pipe(output);\n break;\n case 'deflate':\n response.pipe(zlib.createInflate()).pipe(output);\n break;\n default:\n response.pipe(output);\n break;\n }\n });\n\n // server example\n // Running a gzip operation on every request is quite expensive.\n // It would be much more efficient to cache the compressed buffer.\n var zlib = require('zlib');\n var http = require('http');\n var fs = require('fs');\n http.createServer(function(request, response) {\n var raw = fs.createReadStream('index.html');\n var acceptEncoding = request.headers['accept-encoding'];\n if (!acceptEncoding) {\n acceptEncoding = '';\n }\n\n // Note: this is not a conformant accept-encoding parser.\n // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n if (acceptEncoding.match(/\\bdeflate\\b/)) {\n response.writeHead(200, { 'content-encoding': 'deflate' });\n raw.pipe(zlib.createDeflate()).pipe(response);\n } else if (acceptEncoding.match(/\\bgzip\\b/)) {\n response.writeHead(200, { 'content-encoding': 'gzip' });\n raw.pipe(zlib.createGzip()).pipe(response);\n } else {\n response.writeHead(200, {});\n raw.pipe(response);\n }\n }).listen(1337);", "short_description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n", "ellipsis_description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default se...", "line": 151, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.options", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L151", "name": "options", "path": "zlib.options" }, { "id": "zlib.unzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Unzip.", "short_description": "Decompress a buffer with Unzip.", "ellipsis_description": "Decompress a buffer with Unzip. ...", "line": 342, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.unzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L342", "name": "unzip", "path": "zlib.unzip" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L17", "name": "zlib", "path": "zlib" }, "zlib.options": { "id": "zlib.options", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n\nNote that some options are only relevant when compressing, and are ignored by\nthe decompression classes.\n\nThe options are:\n\n* chunkSize (default: 16*1024)\n* windowBits\n* level (compression only)\n* memLevel (compression only)\n* strategy (compression only)\n\nSee the description of `deflateInit2` and `inflateInit2` at\n for more information on these.\n\n#### Memory Usage Tuning\n\nFrom `zlib/zconf.h`, modified to Node's usage:\n\nThe memory requirements for deflate are (in bytes):\n\n (1 << (windowBits+2)) + (1 << (memLevel+9))\n\nthat is: 128K for `windowBits=15` and 128K for `memLevel = 8`\n(default values) plus a few kilobytes for small objects.\n\nFor example, if you want to reduce the default memory requirements from 256K to\n128K, set the options to:\n\n { windowBits: 14, memLevel: 7 }\n\nOf course, this will generally degrade compression (there's no free lunch).\n\nThe memory requirements for inflate are (in bytes)\n\n 1 << windowBits\n\nthat is: 32K for `windowBits=15` (default value) plus a few kilobytes\nfor small objects.\n\nThis is in addition to a single internal output slab buffer of size `chunkSize`,\nwhich defaults to 16K.\n\nThe speed of zlib compression is affected most dramatically by the `level`\nsetting. A higher level will result in better compression, but takes longer to\ncomplete. A lower level will result in less compression, but will be much\nfaster.\n\nIn general, greater memory usage options will mean that node has to make fewer\ncalls to zlib, since it'll be able to process more data in a single `write`\noperation. This is another factor that affects the speed, at the cost of memory\nusage.\n\n#### Examples\n\nNote: These examples are drastically simplified to show the basic concept. Zlib encoding can be expensive, and the results ought to be cached. See [Memory Usage Tuning](#memory_Usage_Tuning) for more information on the speed/memory/compression tradeoffs involved in zlib usage.\n\nCompressing or decompressing a file can be done by piping an `fs.ReadStream`\ninto a zlib stream, then into an `fs.WriteStream`.\n\n\n\nCompressing or decompressing data in one step can be done by using the\nconvenience methods.\n\n\n\nTo use this module in an HTTP client or server, use the\n[accept-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n) on requests, and the\n[content-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.\n11) header on responses. Here's an example:\n\n // client request example\n var zlib = require('zlib');\n var http = require('http');\n var fs = require('fs');\n var request = http.get({ host: 'izs.me',\n path: '/',\n port: 80,\n headers: { 'accept-encoding': 'gzip,deflate' } });\n request.on('response', function(response) {\n var output = fs.createWriteStream('izs.me_index.html');\n\n switch (response.headers['content-encoding']) {\n // or, just use zlib.createUnzip() to handle both cases\n case 'gzip':\n response.pipe(zlib.createGunzip()).pipe(output);\n break;\n case 'deflate':\n response.pipe(zlib.createInflate()).pipe(output);\n break;\n default:\n response.pipe(output);\n break;\n }\n });\n\n // server example\n // Running a gzip operation on every request is quite expensive.\n // It would be much more efficient to cache the compressed buffer.\n var zlib = require('zlib');\n var http = require('http');\n var fs = require('fs');\n http.createServer(function(request, response) {\n var raw = fs.createReadStream('index.html');\n var acceptEncoding = request.headers['accept-encoding'];\n if (!acceptEncoding) {\n acceptEncoding = '';\n }\n\n // Note: this is not a conformant accept-encoding parser.\n // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n if (acceptEncoding.match(/\\bdeflate\\b/)) {\n response.writeHead(200, { 'content-encoding': 'deflate' });\n raw.pipe(zlib.createDeflate()).pipe(response);\n } else if (acceptEncoding.match(/\\bgzip\\b/)) {\n response.writeHead(200, { 'content-encoding': 'gzip' });\n raw.pipe(zlib.createGzip()).pipe(response);\n } else {\n response.writeHead(200, {});\n raw.pipe(response);\n }\n }).listen(1337);", "short_description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n", "ellipsis_description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default se...", "line": 151, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.options", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L151", "name": "options", "path": "zlib.options" }, "zlib.createGzip": { "id": "zlib.createGzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new Object for Gzip compression.", "short_description": "Returns a new Object for Gzip compression.", "ellipsis_description": "Returns a new Object for Gzip compression. ...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createGzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L162", "name": "createGzip", "path": "zlib.createGzip" }, "zlib.createGunzip": { "id": "zlib.createGunzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for Gunzip compression.", "short_description": "Returns a new object for Gunzip compression.", "ellipsis_description": "Returns a new object for Gunzip compression. ...", "line": 174, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createGunzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L174", "name": "createGunzip", "path": "zlib.createGunzip" }, "zlib.createDeflate": { "id": "zlib.createDeflate", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for compressing using deflate.", "short_description": "Returns a new object for compressing using deflate.", "ellipsis_description": "Returns a new object for compressing using deflate. ...", "line": 186, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createDeflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L186", "name": "createDeflate", "path": "zlib.createDeflate" }, "zlib.createInflate": { "id": "zlib.createInflate", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object to decompress a deflate stream.", "short_description": "Returns a new object to decompress a deflate stream.", "ellipsis_description": "Returns a new object to decompress a deflate stream. ...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createInflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L198", "name": "createInflate", "path": "zlib.createInflate" }, "zlib.createDeflateRaw": { "id": "zlib.createDeflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for compressing using deflate, without an appended zlib\nheader.", "short_description": "Returns a new object for compressing using deflate, without an appended zlib\nheader.", "ellipsis_description": "Returns a new object for compressing using deflate, without an appended zlib\nheader. ...", "line": 211, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createDeflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L211", "name": "createDeflateRaw", "path": "zlib.createDeflateRaw" }, "zlib.createInflateRaw": { "id": "zlib.createInflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header).", "short_description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header).", "ellipsis_description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header). ...", "line": 223, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createInflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L223", "name": "createInflateRaw", "path": "zlib.createInflateRaw" }, "zlib.createUnzip": { "id": "zlib.createUnzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header.", "short_description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header.", "ellipsis_description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header. ...", "line": 236, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createUnzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L236", "name": "createUnzip", "path": "zlib.createUnzip" }, "zlib.deflate": { "id": "zlib.deflate", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using deflate.", "short_description": "Compresses a buffer using deflate.", "ellipsis_description": "Compresses a buffer using deflate. ...", "line": 251, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.deflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L251", "name": "deflate", "path": "zlib.deflate" }, "zlib.deflateRaw": { "id": "zlib.deflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader).", "short_description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader).", "ellipsis_description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader). ...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.deflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L267", "name": "deflateRaw", "path": "zlib.deflateRaw" }, "zlib.gzip": { "id": "zlib.gzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using Gzip.", "short_description": "Compresses a buffer using Gzip.", "ellipsis_description": "Compresses a buffer using Gzip. ...", "line": 282, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.gzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L282", "name": "gzip", "path": "zlib.gzip" }, "zlib.gunzip": { "id": "zlib.gunzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Gunzip.", "short_description": "Decompress a buffer with Gunzip.", "ellipsis_description": "Decompress a buffer with Gunzip. ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.gunzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L297", "name": "gunzip", "path": "zlib.gunzip" }, "zlib.inflate": { "id": "zlib.inflate", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Inflate.", "short_description": "Decompress a buffer with Inflate.", "ellipsis_description": "Decompress a buffer with Inflate. ...", "line": 312, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.inflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L312", "name": "inflate", "path": "zlib.inflate" }, "zlib.inflateRaw": { "id": "zlib.inflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader)..", "short_description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader)..", "ellipsis_description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader).. ...", "line": 328, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.inflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L328", "name": "inflateRaw", "path": "zlib.inflateRaw" }, "zlib.unzip": { "id": "zlib.unzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Unzip.", "short_description": "Decompress a buffer with Unzip.", "ellipsis_description": "Decompress a buffer with Unzip. ...", "line": 342, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.unzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L342", "name": "unzip", "path": "zlib.unzip" } }, "tree": { "children": [ { "id": "crypto", "type": "class", "description": "\nThe `crypto` module offers a way of encapsulating secure credentials to be used\nas part of a secure HTTPS net or HTTP connection. To access this module, add\n`require('crypto')` to your code.\n\n The module also offers a set of wrappers for OpenSSL's methods, which actually\ncontains these objects:\n\n* [[crypto.cipher Cipher]]\n* [[crypto.decipher Decipher]]\n* [[crypto.diffieHellman Diffie-Hellman]]\n* [[crypto.hash Hash]]\n* [[crypto.hmac HMAC]]\n* [[crypto.signer Signer]]\n* [[crypto.verifier Verifier]]\n\nThis documentation is organized to describe those objects within their own\nsections.\n\nNote: All `algorithm` parameter implementations below are dependent on the OpenSSL version installed on the platform. Some common examples of these algoritihms are `'sha1'`, `'md5'`, `'sha256'`, and `'sha512'`. On recent Node.js releases, `openssl list-message-digest-algorithms` displays the available digest algorithms.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThe `crypto` module offers a way of encapsulating secure credentials to be used\nas part of a secure HTTPS net or HTTP connection. To access this module, add\n`require('crypto')` to your code.\n", "ellipsis_description": "\nThe `crypto` module offers a way of encapsulating secure credentials to be used\nas part of a secure HTTPS net or HT...", "line": 31, "aliases": [], "children": [ { "id": "crypto.createCipher", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "password", "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "password", "types": [ "String" ], "description": "The password to use" } ], "description": "Creates and returns a cipher object with the given algorithm and password.\n\nThe `password` is used to derive both the key and IV, which must be a\nbinary-encoded string. For more information, see the section on [[Buffer\nbuffers]].", "short_description": "Creates and returns a cipher object with the given algorithm and password.\n", "ellipsis_description": "Creates and returns a cipher object with the given algorithm and password.\n ...", "line": 44, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCipher", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L44", "name": "createCipher", "path": "crypto.createCipher" }, { "id": "crypto.createCipheriv", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] }, { "name": "iv", "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "A raw key used in the algorithm" }, { "name": "iv", "types": [ "String" ], "description": "The [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector)" } ], "description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n\nBoth `key` and `iv` must be a binary-encoded string. For more information, see\nthe section on [[Buffer buffers]].", "short_description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n", "ellipsis_description": "Creates and returns a cipher object, with the given algorithm, key, and IV.\n ...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCipheriv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L59", "name": "createCipheriv", "path": "crypto.createCipheriv" }, { "id": "crypto.createCredentials", "type": "class method", "signatures": [ { "args": [ { "name": "details", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "details", "types": [ "String" ], "description": "A dictionary of fields to populate the credential with", "optional": true } ], "description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n\n- `pfx`: A string or buffer holding the PFX or PKCS12 encoded private key,\ncertificate, and CA certificates\n- `key`: A string holding the PEM encoded private key file\n- `cert`: A string holding the PEM encoded certificate file\n- `passphrase`: A string of passphrases for the private key or pfx\n- `ca`: Either a string or list of strings of PEM encoded CA certificates\nto trust\n- `ciphers`: A string describing the ciphers to use or exclude. Consult\n[OpenSSL.org](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT)\nfor details on the format\n\nIf no `ca` details are given, then Node.js uses the default publicly trusted\nlist of CAs as given by\n[Mozilla](http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/c\nertdata.txt).\n\n#### Example\n\n", "short_description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n", "ellipsis_description": "Creates a credentials object, with `details` being a dictionary with the\nfollowing keys:\n ...", "line": 88, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createCredentials", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L88", "name": "createCredentials", "path": "crypto.createCredentials" }, { "id": "crypto.createDecipher", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "password", "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "password", "types": [ "String" ], "description": "The password to use" } ], "description": "Creates and returns a decipher object, with the given algorithm and key.", "short_description": "Creates and returns a decipher object, with the given algorithm and key.", "ellipsis_description": "Creates and returns a decipher object, with the given algorithm and key. ...", "line": 97, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDecipher", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L97", "name": "createDecipher", "path": "crypto.createDecipher" }, { "id": "crypto.createDecipheriv", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] }, { "name": "iv", "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "A raw key used in the algorithm" }, { "name": "iv", "types": [ "String" ], "description": "The [initialization vector](http://en.wikipedia.org/wiki/Initialization_vector)" } ], "description": "Creates and returns a decipher object, with the given algorithm, key, and iv.", "short_description": "Creates and returns a decipher object, with the given algorithm, key, and iv.", "ellipsis_description": "Creates and returns a decipher object, with the given algorithm, key, and iv. ...", "line": 108, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDecipheriv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L108", "name": "createDecipheriv", "path": "crypto.createDecipheriv" }, { "id": "crypto.createDiffieHellman", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "prime_length", "types": [ "Number" ], "description": "The bit length to calculate with" }, { "name": "prime", "types": [ "Number" ], "description": "The prime to calculate with" }, { "name": "encoding", "types": [ "Number" ], "description": "The encoding to use; defaults to `'binary'`" } ], "description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n\n#### Example\n\n", "short_description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n", "ellipsis_description": "Creates a Diffie-Hellman key exchange object and generates a prime of the given\nbit length. The generator used is `2`.\n ...", "line": 124, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createDiffieHellman", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L124", "name": "createDiffieHellman", "path": "crypto.createDiffieHellman" }, { "id": "crypto.createHash", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hash" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The hash algorithm to use" } ], "description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash digests.\n\n#### Examples\n\nTesting an MD5 Hash:\n\n\n\nThis program takes the sha1 sum of a file:\n\n var filename = \"my_secret_file.txt\";\n var crypto = require('crypto');\n var fs = require('fs');\n\n var shasum = crypto.createHash('sha1');\n\n var s = fs.ReadStream(filename);\n s.on('data', function(d) {\n shasum.update(d);\n });\n\n s.on('end', function() {\n var d = shasum.digest('hex');\n console.log(d + ' ' + filename);\n });", "short_description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash digests.\n", "ellipsis_description": "Creates and returns a cryptographic hash object with the given algorithm. The\nobject can be used to generate hash di...", "line": 204, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createHash", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L204", "name": "createHash", "path": "crypto.createHash" }, { "id": "crypto.createHmac", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] }, { "name": "key", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hmac" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" }, { "name": "key", "types": [ "String" ], "description": "The HMAC key to be used" } ], "description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see [this\narticle](http://en.wikipedia.org/wiki/HMAC).\n\n#### Example\n\n", "short_description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see [this\narticle](http://en.wikipedia.org/wiki/HMAC).\n", "ellipsis_description": "Creates and returns a cryptographic HMAC object with the given algorithm and\nkey. For more information on HMAC, see ...", "line": 228, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createHmac", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L228", "name": "createHmac", "path": "crypto.createHmac" }, { "id": "crypto.createSign", "type": "class method", "signatures": [ { "args": [ { "name": "algorithm", "types": [ "String" ] } ], "returns": [ { "type": "crypto.signer" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" } ], "description": "Creates and returns a signing object string, with the given `algorithm`.", "short_description": "Creates and returns a signing object string, with the given `algorithm`.", "ellipsis_description": "Creates and returns a signing object string, with the given `algorithm`. ...", "line": 213, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createSign", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L213", "name": "createSign", "path": "crypto.createSign" }, { "id": "crypto.createVerify", "type": "class method", "signatures": [ { "args": [ { "name": "algorithim", "types": [ "String" ] } ], "returns": [ { "type": "crypto.verifier" } ] } ], "arguments": [ { "name": "algorithm", "types": [ "String" ], "description": "The algorithm to use" } ], "description": "Creates and returns a verification object, with the given algorithm.\n\nThis is the mirror of the [[crypto.signer `signer`]] object.", "short_description": "Creates and returns a verification object, with the given algorithm.\n", "ellipsis_description": "Creates and returns a verification object, with the given algorithm.\n ...", "line": 274, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.createVerify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L274", "name": "createVerify", "path": "crypto.createVerify" }, { "id": "crypto.getDiffieHellman", "type": "class method", "signatures": [ { "args": [ { "name": "group_name", "types": [ "String" ] } ], "returns": [ { "type": "crypto.diffieHellman" } ] } ], "arguments": [ { "name": "group_name", "types": [ "String" ], "description": "One of the following group names: `'modp1'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp2'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp5'`, as defined in [RFC 2412](http://www.rfc-editor.org/rfc/rfc2412.txt) `'modp14'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp15'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp16'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp17'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt) `'modp18'`, as defined in [RFC 3526](http://www.rfc-editor.org/rfc/rfc3526.txt)" } ], "description": "Creates a predefined Diffie-Hellman key exchange object.\n\nThe returned object mimics the interface of objects created by\n[[crypto.createDiffieHellman `createDiffieHellman()`]], but will not allow you\nto change the keys (for example, with [[crypto.diffieHellman.setPublicKey `diffieHellman.setPublicKey()`]]).\n\nThe advantage of using this routine is that the parties don't have to generate\nnor exchange group modulus beforehand, saving both processor and communication\ntime.\n\n#### Example: Obtaining a shared secret:\n\n var crypto = require('crypto');\n var alice = crypto.getDiffieHellman('modp5');\n var bob = crypto.getDiffieHellman('modp5');\n\n alice.generateKeys();\n bob.generateKeys();\n\n var alice_secret = alice.computeSecret(bob.getPublicKey(), 'binary', 'hex');\n var bob_secret = bob.computeSecret(alice.getPublicKey(), 'binary', 'hex');\n\n /* alice_secret and bob_secret should be the same */\n console.log(alice_secret == bob_secret);", "short_description": "Creates a predefined Diffie-Hellman key exchange object.\n", "ellipsis_description": "Creates a predefined Diffie-Hellman key exchange object.\n ...", "line": 171, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.getDiffieHellman", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L171", "name": "getDiffieHellman", "path": "crypto.getDiffieHellman" }, { "id": "crypto.pbkdf2", "type": "class method", "signatures": [ { "args": [ { "name": "password", "types": [ "String" ] }, { "name": "salt", "types": [ "String" ] }, { "name": "iterations", "types": [ "String" ] }, { "name": "keylen", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "derivedKey", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "derivedKey", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "password", "types": [ "String" ], "description": "The password to use" }, { "name": "salt", "types": [ "String" ], "description": "The salt to use" }, { "name": "iterations", "types": [ "String" ], "description": "The number of iterations to use" }, { "name": "keylen", "types": [ "String" ], "description": "The final key length" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute when finished" }, { "name": "err", "types": [ "Error" ], "description": "The error object" }, { "name": "derivedKey", "types": [ "String" ], "description": "The resulting key" } ], "description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length from the given password, salt, and number of\niterations.\n\n#### Example\n\n", "short_description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length from the given password, salt, and number of\niterations.\n", "ellipsis_description": "An asynchronous PBKDF2 function that applies pseudorandom function HMAC-SHA1 to\nderive a key of the given length fro...", "line": 248, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.pbkdf2", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L248", "name": "pbkdf2", "path": "crypto.pbkdf2" }, { "id": "crypto.randomBytes", "type": "class method", "signatures": [ { "args": [ { "name": "size", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "ex", "type": [ "Error" ] }, { "name": "buf", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "ex", "type": [ "Error" ] }, { "name": "buf", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "String" }, { "type": "Void" } ] } ], "arguments": [ { "name": "size", "types": [ "Number" ], "description": "The size of the cryptographic data" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute when finished", "optional": true }, { "name": "ex", "types": [ "Error" ], "description": "The error object" }, { "name": "buf", "types": [ "String" ], "description": "The resulting crypto data" } ], "description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n\n#### Example\n\n", "short_description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n", "ellipsis_description": "Generates cryptographically strong pseudo-random data, either asynchronously or\nsynchronously.\n ...", "line": 264, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.randomBytes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L264", "name": "randomBytes", "path": "crypto.randomBytes" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto", "subclasses": [ "crypto.cipher", "crypto.decipher", "crypto.diffieHellman", "crypto.hash", "crypto.hmac", "crypto.signer", "crypto.verifier" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L31", "name": "crypto", "path": "crypto" }, { "id": "assert", "type": "class", "description": "\nAll of the `assert` methods basically compare two different states—an expected\none, and an actual one—and return a Boolean condition. If the comparisson is\n`true`, the condition passes. If an assert method is `false`, the entire Node.js\napp crashes.\n\nSome methods have an additional `message` parameter, which sends text out to the\nconsole when the assert fails.\n\n#### Example: Testing for equivalency\n\n", "stability": "5 - Locked", "short_description": "\nAll of the `assert` methods basically compare two different states—an expected\none, and an actual one—and return a Boolean condition. If the comparisson is\n`true`, the condition passes. If an assert method is `false`, the entire Node.js\napp crashes.\n", "ellipsis_description": "\nAll of the `assert` methods basically compare two different states—an expected\none, and an actual one—and return a ...", "line": 19, "aliases": [], "children": [ { "id": "assert.assert", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "message", "types": [ "String" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value you receive" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails (alias of: asset.ok)" } ], "description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `assert.ok()`, except that `message` is\nrequired.", "short_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `assert.ok()`, except that `message` is\nrequired.", "ellipsis_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message)`. This is the same as `a...", "line": 49, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.assert", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L49", "name": "assert", "path": "assert.assert" }, { "id": "assert.deepEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests for deep equality.", "short_description": "Tests for deep equality.", "ellipsis_description": "Tests for deep equality. ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.deepEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L92", "name": "deepEqual", "path": "assert.deepEqual" }, { "id": "assert.doesNotThrow", "type": "class method", "signatures": [ { "args": [ { "name": "block", "types": [ "Function" ] }, { "name": "error", "optional": true, "types": [ "RegExp", "Function" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "block", "types": [ "Function" ], "description": "A block of code to check against" }, { "name": "error", "types": [ "RegExp", "Function" ], "description": "The expected error that's thrown; this can be a constructor, regexp, or validation function", "optional": true }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Expects `block` not to throw an error; for more details, see `assert.throws()`.", "short_description": "Expects `block` not to throw an error; for more details, see `assert.throws()`.", "ellipsis_description": "Expects `block` not to throw an error; for more details, see `assert.throws()`. ...", "line": 159, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.doesNotThrow", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L159", "name": "doesNotThrow", "path": "assert.doesNotThrow" }, { "id": "assert.equal", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ).", "short_description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ).", "ellipsis_description": "Tests shallow, coercive equality with the equal comparison operator ( `==` ). ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.equal", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L71", "name": "equal", "path": "assert.equal" }, { "id": "assert.fail", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "types": [ "String" ] }, { "name": "operator", "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails" }, { "name": "operator", "types": [ "String" ], "description": "The operator used to separate the `actual` and `expected` values in the `message`" } ], "description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n\n\n#### Example\n\n", "short_description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n", "ellipsis_description": "Throws an exception that displays the values for `actual` and `expected`\nseparated by the provided operator.\n ...", "line": 37, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.fail", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L37", "name": "fail", "path": "assert.fail" }, { "id": "assert.ifError", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value to check against" } ], "description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in callbacks.", "short_description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in callbacks.", "ellipsis_description": "Tests if value is `false`; throws an error if it is `true`. Useful when testing\nthe first argument, `error`, in call...", "line": 168, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.ifError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L168", "name": "ifError", "path": "assert.ifError" }, { "id": "assert.notDeepEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests for any deep inequality.", "short_description": "Tests for any deep inequality.", "ellipsis_description": "Tests for any deep inequality. ...", "line": 102, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notDeepEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L102", "name": "notDeepEqual", "path": "assert.notDeepEqual" }, { "id": "assert.notEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ).", "short_description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ).", "ellipsis_description": "Tests shallow, coercive non-equality with the not equal comparison operator (\n`!=` ). ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L82", "name": "notEqual", "path": "assert.notEqual" }, { "id": "assert.notStrictEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ).", "short_description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ).", "ellipsis_description": "Tests strict non-equality, as determined by the strict not equal operator (\n`!==` ). ...", "line": 123, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.notStrictEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L123", "name": "notStrictEqual", "path": "assert.notStrictEqual" }, { "id": "assert.ok", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value you receive" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails (alias of: assert.assert)", "optional": true } ], "description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `assert()`, except that `message` is not\nrequired.", "short_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `assert()`, except that `message` is not\nrequired.", "ellipsis_description": "Tests if value is a `true` value. This is equivalent to `assert.equal(true,\nvalue, message);`. This is the same as `...", "line": 61, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.ok", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L61", "name": "ok", "path": "assert.ok" }, { "id": "assert.strictEqual", "type": "class method", "signatures": [ { "args": [ { "name": "actual", "types": [ "Object" ] }, { "name": "expected", "types": [ "Object" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "actual", "types": [ "Object" ], "description": "The value you receive" }, { "name": "expected", "types": [ "Object" ], "description": "The expected value you're looking for" }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "Tests strict equality, as determined by the strict equality operator ( `===` ).", "short_description": "Tests strict equality, as determined by the strict equality operator ( `===` ).", "ellipsis_description": "Tests strict equality, as determined by the strict equality operator ( `===` ). ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.strictEqual", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L112", "name": "strictEqual", "path": "assert.strictEqual" }, { "id": "assert.throws", "type": "class method", "signatures": [ { "args": [ { "name": "block", "types": [ "Function" ] }, { "name": "error", "optional": true, "types": [ "Function", "RegExp", "Function" ] }, { "name": "message", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "block", "types": [ "Function" ], "description": "A block of code to check against" }, { "name": "error", "types": [ "Function", "RegExp", "Function" ], "description": "The expected error that's thrown; this can be a constructor, regexp, or validation function", "optional": true }, { "name": "message", "types": [ "String" ], "description": "The message to send to the console if the comparisson fails", "optional": true } ], "description": "If `block`throws an error, then the assertion passes.\n\n#### Example: Validate `instanceof` using a constructor:\n\n\n\n#### Example: Validate an error message using regular expressions:\n\n\n\n#### Example: Custom error validation:\n\n", "short_description": "If `block`throws an error, then the assertion passes.\n", "ellipsis_description": "If `block`throws an error, then the assertion passes.\n ...", "line": 148, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert.throws", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L148", "name": "throws", "path": "assert.throws" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/assert.markdown", "fileName": "assert", "resultingFile": "assert.html#assert", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/assert.markdown#L19", "name": "assert", "path": "assert" }, { "id": "Buffer", "type": "class", "metadata": { "type": "global" }, "description": "\nPure Javascript is Unicode friendly, but not nice to binary data. When dealing\nwith TCP streams or the file system, it's often necessary to handle octet\nstreams. Node has several strategies for manipulating, creating, and consuming\noctet streams.\n\nRaw data is stored in instances of the `Buffer` class. A `Buffer` is similar to\nan array of integers, but corresponds to a raw memory allocation outside the V8\nheap. A `Buffer` cannot be resized.\n\nThe `Buffer` class is a global, making it very rare that one would need to ever\n`require('buffer')`.\n\nConverting between Buffers and JavaScript string objects requires an explicit\nencoding method. These encoding methods are:\n\n* `'ascii'` - for 7 bit ASCII data only. This encoding method is very fast, and\nwill strip the high bit if set.\n Note that this encoding converts a null character (`'\\0'` or `'\\u0000'`) into\n`0x20` (character code of a space). If you want to convert a null character into\n`0x00`, you should use `'utf8'`.\n\n* `'base64'`: Base64 string encoding\n\n* `'binary'`: A way of encoding raw binary data into strings by using only the\nfirst 8 bits of each character. This encoding method is deprecated and should be\navoided in favor of `Buffer` objects where possible. This encoding is going to\nbe removed in future versions of Node.js.\n\n* `'hex'`: Encodes each byte as two hexidecimal characters.\n\n* `'ucs2'`: 2-bytes, little endian encoded Unicode characters. It can encode\nonly BMP (Basic Multilingual Plane—from U+0000 to U+FFFF).\n\n* `'utf8'` - Multi byte encoded Unicode characters. Many web pages and other\ndocument formats use UTF-8.\n\nIn most cases, the default of `'utf8'` is used.\n\nFor more information, see [this article on manipulating\nbuffers](../nodejs_dev_guide/manipulating_buffers.html).", "stability": "3 - Stable", "short_description": "\nPure Javascript is Unicode friendly, but not nice to binary data. When dealing\nwith TCP streams or the file system, it's often necessary to handle octet\nstreams. Node has several strategies for manipulating, creating, and consuming\noctet streams.\n", "ellipsis_description": "\nPure Javascript is Unicode friendly, but not nice to binary data. When dealing\nwith TCP streams or the file system...", "line": 49, "aliases": [], "children": [ { "id": "Buffer._charsWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.write()` is called.", "short_description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.write()` is called.", "ellipsis_description": "The number of characters written by [[Buffer.write `buffer.write()`]]. This\nvalue is overwritten each time `buffer.w...", "line": 655, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer._charsWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L655", "name": "_charsWritten", "path": "Buffer._charsWritten" }, { "id": "Buffer.copy", "type": "class method", "signatures": [ { "args": [ { "name": "targetBuffer", "types": [ "Buffer" ] }, { "name": "targetStart", "default_value": 0, "types": [ "Number" ] }, { "name": "sourceStart", "default_value": 0, "types": [ "Number" ] }, { "name": "sourceEnd", "default_value": "buffer.length", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "targetBuffer", "types": [ "Buffer" ], "description": "The buffer to copy into" }, { "name": "targetStart", "types": [ "Number" ], "description": "The offset to start at for the buffer you're copying into" }, { "name": "sourceStart", "types": [ "Number" ], "description": "The offset to start at for the buffer you're copying from" }, { "name": "sourceEnd", "types": [ "Number" ], "description": "The number of bytes to read from the originating buffer. Defaults to the length of the buffer" } ], "description": "Performs a copy between buffers. The source and target regions can overlap.\n\n#### Example: Building two buffers\n\n", "short_description": "Performs a copy between buffers. The source and target regions can overlap.\n", "ellipsis_description": "Performs a copy between buffers. The source and target regions can overlap.\n ...", "line": 100, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.copy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L100", "name": "copy", "path": "Buffer.copy" }, { "id": "Buffer.fill", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "Object" ] }, { "name": "offset", "default_value": 0, "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "value", "types": [ "Object" ], "description": "The value to use to fill the buffer" }, { "name": "offset", "types": [ "Number" ], "description": "The position in the buffer to start filling at" }, { "name": "end", "types": [ "Number" ], "description": "The position in the buffer to stop filling at" } ], "description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n\n#### Example\n\n", "short_description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n", "ellipsis_description": "Fills the buffer with the specified value. If the offset and end are not given,\nthis fills the entire buffer.\n ...", "line": 115, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.fill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L115", "name": "fill", "path": "Buffer.fill" }, { "id": "Buffer.index", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is between `0x00` and `0xFF` hex or `0` and\n`255`.\n\n#### Example: Copy an ASCII string into a buffer, one byte at a time\n\n", "short_description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is between `0x00` and `0xFF` hex or `0` and\n`255`.\n", "ellipsis_description": "Gets and sets the octet at `index` in an array format. The values refer to\nindividual bytes, so the legal range is b...", "line": 647, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.index", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L647", "name": "index", "path": "Buffer.index" }, { "id": "Buffer.INSPECT_MAX_BYTES", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user modules.", "short_description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user modules.", "ellipsis_description": "The number of bytes returned when `buffer.inspect()` is called; the default is\n50. This can be overridden by user mo...", "line": 677, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.INSPECT_MAX_BYTES", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L677", "name": "INSPECT_MAX_BYTES", "path": "Buffer.INSPECT_MAX_BYTES" }, { "id": "Buffer.isBuffer", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "The object to check" } ], "description": "Returns `true` if `obj` is a `Buffer`.", "short_description": "Returns `true` if `obj` is a `Buffer`.", "ellipsis_description": "Returns `true` if `obj` is a `Buffer`. ...", "line": 124, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.isBuffer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L124", "name": "isBuffer", "path": "Buffer.isBuffer" }, { "id": "Buffer.length", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the amount of memory allocated for the buffer\nobject. It does not change when the contents of the buffer are changed.\n\n#### Example\n\n", "short_description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the amount of memory allocated for the buffer\nobject. It does not change when the contents of the buffer are changed.\n", "ellipsis_description": "The size of the buffer in bytes. Note that this is not necessarily the size of\nthe contents. `length` refers to the...", "line": 668, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.length", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L668", "name": "length", "path": "Buffer.length" }, { "id": "new Buffer", "type": "constructor", "signatures": [ {} ], "description": "Allocates a new buffer object.\n\nYou can use either:\n\n- an `array` of octects\n- allocation of a specific `size`\n- conversion from a `string` with the specified `encoding`\n\n#### Example\n\n var bBuffer = new Buffer(\"This is a Buffer.\", \"utf8\");\n\nBuffer.byteLength(string, encoding='utf8'), Number\n- string {String} The string to check\n- encoding {String} The encoding that the string is in\n\nGives the actual byte length of a string. This is not the same as\n`String.length` since that returns the number of _characters_ in a string.\n\n#### Example\n\n\n#### Returns\n\nReturns the byte length of a buffer", "short_description": "Allocates a new buffer object.\n", "ellipsis_description": "Allocates a new buffer object.\n ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L82", "name": "new", "path": "Buffer.new" }, { "id": "Buffer.readDoubleBE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n", "ellipsis_description": "Reads a 64-bit double from the buffer at the specified offset in big endian\nnotation.\n ...", "line": 139, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readDoubleBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L139", "name": "readDoubleBE", "path": "Buffer.readDoubleBE" }, { "id": "Buffer.readDoubleLE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n", "ellipsis_description": "Reads a 64 bit double from the buffer at the specified offset in little endian\nnotation.\n ...", "line": 155, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readDoubleLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L155", "name": "readDoubleLE", "path": "Buffer.readDoubleLE" }, { "id": "Buffer.readFloatBE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position noAssert {Boolean} If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n\n#### Example\n\n", "short_description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n", "ellipsis_description": "Reads a 32 bit float from the buffer at the specified offset in big endian\nnotation.\n ...", "line": 171, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readFloatBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L171", "name": "readFloatBE", "path": "Buffer.readFloatBE" }, { "id": "Buffer.readFloatLE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n\n\n#### Example\n\n", "short_description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n", "ellipsis_description": "Reads a 32 bit float from the buffer at the specified offset in little endian\nnotation.\n ...", "line": 187, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readFloatLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L187", "name": "readFloatLE", "path": "Buffer.readFloatLE" }, { "id": "Buffer.readInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n\nThis function also works as [[Buffer.readUInt16BE `buffer.readUInt16BE()`]],\nexcept buffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n", "ellipsis_description": "Reads a signed 16 bit integer from the buffer at the specified offset in big\nendian notation.\n ...", "line": 218, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L218", "name": "readInt16BE", "path": "Buffer.readInt16BE" }, { "id": "Buffer.readInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n\nThis function also works as [[Buffer.readUInt16LE `buffer.readUInt16LE()`]],\nexcept buffer contents are treated as a two'scomplement signed values.", "short_description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n", "ellipsis_description": "Reads a signed 16 bit integer from the buffer at the specified offset in little\nendian notation.\n ...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L233", "name": "readInt16LE", "path": "Buffer.readInt16LE" }, { "id": "Buffer.readInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n\nThis function works like [[Buffer.readUInt32BE `buffer.readUInt32BE()`]], except\nbuffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n", "ellipsis_description": "Reads a signed 32-bit integer from the buffer at the specified offset in big\nendian notation.\n ...", "line": 248, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L248", "name": "readInt32BE", "path": "Buffer.readInt32BE" }, { "id": "Buffer.readInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n\nThis function works like [[Buffer.readUInt32LE `buffer.readUInt32LE()`]], except\nbuffer contents are treated as a two's complement signed values.", "short_description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n", "ellipsis_description": "Reads a signed 32 bit integer from the buffer at the specified offset in little\nendian notation.\n ...", "line": 265, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L265", "name": "readInt32LE", "path": "Buffer.readInt32LE" }, { "id": "Buffer.readInt8", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n\nThis function also works as [[Buffer.readUInt8 `buffer.readUInt8()`]], except\nbuffer contents are treated as two's complement signed values.", "short_description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n", "ellipsis_description": "Reads a signed 8 bit integer from the buffer at the specified offset.\n ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L202", "name": "readInt8", "path": "Buffer.readInt8" }, { "id": "Buffer.readUInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n", "ellipsis_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nbig endian format.\n ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L297", "name": "readUInt16BE", "path": "Buffer.readUInt16BE" }, { "id": "Buffer.readUInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n", "ellipsis_description": "Reads an unsigned 16 bit integer from the buffer at the specified offset in the\nlittle endian format.\n ...", "line": 312, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L312", "name": "readUInt16LE", "path": "Buffer.readUInt16LE" }, { "id": "Buffer.readUInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n\n#### Example\n\n", "short_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n", "ellipsis_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nbig endian format.\n ...", "line": 328, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L328", "name": "readUInt32BE", "path": "Buffer.readUInt32BE" }, { "id": "Buffer.readUInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n\n\n#### Example\n\n", "short_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n", "ellipsis_description": "Reads an unsigned 32 bit integer from the buffer at the specified offset in the\nlittle endian format.\n ...", "line": 345, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L345", "name": "readUInt32LE", "path": "Buffer.readUInt32LE" }, { "id": "Buffer.readUInt8", "type": "class method", "signatures": [ { "args": [ { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n\n#### Example\n\n", "short_description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n", "ellipsis_description": "Reads an unsigned 8 bit integer from the buffer at the specified offset.\n ...", "line": 281, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.readUInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L281", "name": "readUInt8", "path": "Buffer.readUInt8" }, { "id": "Buffer.slice", "type": "class method", "signatures": [ { "args": [ { "name": "start", "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ], "returns": [ { "type": "Buffer" } ] } ], "arguments": [ { "name": "start", "types": [ "Number" ], "description": "The offset in the buffer to start from" }, { "name": "end", "types": [ "Number" ], "description": "The position of the last byte to slice. Defaults to the length of the buffer" } ], "description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` indexes.\n\nNote: Modifying the new buffer slice modifies memory in the original buffer!\n\n#### Example\n\nBuilding a `Buffer` with the ASCII alphabet, taking a slice, then modifying one\nbyte from the original `Buffer`:\n\n", "short_description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` indexes.\n", "ellipsis_description": "Returns a new buffer that references the same memory as the old, but offset and\ncropped by the `start` and `end` ind...", "line": 364, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.slice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L364", "name": "slice", "path": "Buffer.slice" }, { "id": "Buffer.toString", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "utf8", "types": [ "String" ] }, { "name": "start", "default_value": 0, "types": [ "Number" ] }, { "name": "end", "default_value": "buffer.length", "types": [ "Number" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" }, { "name": "start", "types": [ "Number" ], "description": "The starting byte offset; defaults to `0`" }, { "name": "end", "types": [ "Number" ], "description": "The number of bytes to write; defaults to the length of the buffer (related to: buffer.write)" } ], "description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`.", "short_description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`.", "ellipsis_description": "Decodes and returns a string from buffer data encoded with `encoding` beginning\nat `start` and ending at `end`. ...", "line": 378, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.toString", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L378", "name": "toString", "path": "Buffer.toString" }, { "id": "Buffer.write", "type": "class method", "signatures": [ { "args": [ { "name": "string", "types": [ "String" ] }, { "name": "offset", "default_value": 0, "types": [ "Number" ] }, { "name": "length", "default_value": "startPos", "types": [ "Number" ] }, { "name": "encoding", "default_value": "utf8", "types": [ "String" ] } ], "returns": [ { "type": "Number" } ] } ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The string to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting byte offset" }, { "name": "length", "types": [ "Number" ], "description": "The number of bytes to write; defaults to the length of the buffer minus any offset (`buffer.length` - `buffer.offset`)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" } ], "description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `buffer` does not contain enough space to\nfit the entire string, it instead writes a partial amount of the string. The\nmethod doesn't write partial characters.\n\n\n#### Example\n\nWriting a utf8 string into a buffer, then printing it:\n\n\n\n#### Returns\n\nReturns number of octets written.", "short_description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `buffer` does not contain enough space to\nfit the entire string, it instead writes a partial amount of the string. The\nmethod doesn't write partial characters.\n", "ellipsis_description": "Writes a `string` to the buffer at `offset` using the given encoding. `length`\nis the number of bytes to write. If `...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L404", "name": "write", "path": "Buffer.write" }, { "id": "Buffer.writeDoubleBE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 bit double.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 bit double.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 64 ...", "line": 421, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeDoubleBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L421", "name": "writeDoubleBE", "path": "Buffer.writeDoubleBE" }, { "id": "Buffer.writeDoubleLE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 64 bit double.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 64 bit double.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 438, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeDoubleLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L438", "name": "writeDoubleLE", "path": "Buffer.writeDoubleLE" }, { "id": "Buffer.writeFloatBE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 bit float.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 bit float.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid 32 ...", "line": 454, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeFloatBE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L454", "name": "writeFloatBE", "path": "Buffer.writeFloatBE" }, { "id": "Buffer.writeFloatLE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 32 bit float.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid 32 bit float.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 471, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeFloatLE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L471", "name": "writeFloatLE", "path": "Buffer.writeFloatLE" }, { "id": "Buffer.writeInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 16 bit integer.\n\nThis function also works as `buffer.writeUInt16*()`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid sig...", "line": 504, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L504", "name": "writeInt16BE", "path": "Buffer.writeInt16BE" }, { "id": "Buffer.writeInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": "alse", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 16 bit integer.\n\nThis function also works as `buffer.writeUInt16*()`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 521, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L521", "name": "writeInt16LE", "path": "Buffer.writeInt16LE" }, { "id": "Buffer.writeInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 32 bit integer.\n\nThis function also works as `buffer.writeUInt32*`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid signed 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid sig...", "line": 537, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L537", "name": "writeInt32BE", "path": "Buffer.writeInt32BE" }, { "id": "Buffer.writeInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 32 bit integer.\n\nThis function also works as `buffer.writeUInt32*`, except value is written out\nas a two's complement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid signed 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 554, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L554", "name": "writeInt32LE", "path": "Buffer.writeInt32LE" }, { "id": "Buffer.writeInt8", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n\nWorks as `buffer.writeUInt8()`, except value is written out as a two's\ncomplement signed integer into `buffer`.", "short_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid signed 8 bit integer.\n ...", "line": 487, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L487", "name": "writeInt8", "path": "Buffer.writeInt8" }, { "id": "Buffer.writeUInt16BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 16 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid uns...", "line": 588, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt16BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L588", "name": "writeUInt16BE", "path": "Buffer.writeUInt16BE" }, { "id": "Buffer.writeUInt16LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset" } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 16 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 16 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 603, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt16LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L603", "name": "writeUInt16LE", "path": "Buffer.writeUInt16LE" }, { "id": "Buffer.writeUInt32BE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 32 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid unsigned 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the big endian format.\nNote that `value` must be a valid uns...", "line": 620, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt32BE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L620", "name": "writeUInt32BE", "path": "Buffer.writeUInt32BE" }, { "id": "Buffer.writeUInt32LE", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset" } ], "description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 32 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid unsigned 32 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset in the little endian\nformat. Note that `value` must be a valid ...", "line": 634, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt32LE", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L634", "name": "writeUInt32LE", "path": "Buffer.writeUInt32LE" }, { "id": "Buffer.writeUInt8", "type": "class method", "signatures": [ { "args": [ { "name": "value", "types": [ "String" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "noAssert", "default_value": false, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "value", "types": [ "String" ], "description": "The content to write" }, { "name": "offset", "types": [ "Number" ], "description": "The starting position" }, { "name": "noAssert", "types": [ "Boolean" ], "description": "If `true`, skips the validation of the offset. This means that `offset` may be beyond the end of the buffer, and is typically not recommended." } ], "description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n\n#### Example\n\n", "short_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n", "ellipsis_description": "Writes `value` to the buffer at the specified offset. Note that `value` must be\na valid unsigned 8 bit integer.\n ...", "line": 571, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer.writeUInt8", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L571", "name": "writeUInt8", "path": "Buffer.writeUInt8" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/buffer.markdown", "fileName": "buffer", "resultingFile": "buffer.html#Buffer", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/buffer.markdown#L49", "name": "Buffer", "path": "Buffer" }, { "id": "child_process", "type": "class", "description": "\nNode.js provides a tri-directional\n[`popen(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/popen.3.html)\nfacility through the `child_process` module. It's possible to stream data\nthrough the child's `stdin`, `stdout`, and `stderr` in a fully non-blocking way.\n\nTo create a child process object, use `require('child_process')` in your code.\n\nChild processes always have three streams associated with them. They are:\n\n* `child.stdin`, the standard input stream\n* `child.stdout`, the standard output stream\n* `child.stderr`, the standard error stream\n\n#### Example: Running ls in a child process\n\n", "stability": "3 - Stable", "short_description": "\nNode.js provides a tri-directional\n[`popen(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/popen.3.html)\nfacility through the `child_process` module. It's possible to stream data\nthrough the child's `stdin`, `stdout`, and `stderr` in a fully non-blocking way.\n", "ellipsis_description": "\nNode.js provides a tri-directional\n[`popen(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/popen.3.html)...", "line": 24, "aliases": [], "children": [ { "id": "child_process.exec", "type": "class method", "signatures": [ { "args": [ { "name": "command", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "command", "types": [ "String" ], "description": "The Unix command to run" }, { "name": "options", "types": [ "Object" ], "description": "The options to pass to the command", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to run after the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard `Error` object; `err.code` is the exit code of the child process and `err.signal` is set to the signal that terminated the process" }, { "name": "stdout", "types": [ "streams.ReadableStream" ], "description": "The standard output stream" }, { "name": "stderr", "types": [ "streams.ReadableStream" ], "description": "The standard error stream (related to: child_process.spawn)" } ], "description": "Runs a Unix command in a shell and buffers the output.\n\nThere is a second optional argument to specify several options. The default\noptions are:\n\n {\n encoding: 'utf8',\n timeout: 0,\n maxBuffer: 200*1024,\n killSignal: 'SIGTERM',\n cwd: null,\n env: null\n }\n\nThese refer to:\n\n* `encoding` is the current encoding the output is defined with\n* `timeout` is an integer, which, if greater than `0`, kills the child process\nif it runs longer than `timeout` milliseconds\n* `maxBuffer` specifies the largest amount of data allowed on stdout or stderr;\nif this value is exceeded then the child process is killed.\n* `killSignal` defines [a kill\nsignal](http://kernel.org/doc/man-pages/online/pages/man7/signal.7.html) to kill\nthe child process with\n* `cwd` is a string defining the current working directory\n* `env` is an object with the current environment options\n\n#### Example\n\n\n\n* `modulePath` {String} The module to run in the child\n* `args` {Array} List of string arguments\n* `options` {Object}\n * `cwd` {String} Current working directory of the child process\n * `customFds` {Array} **Deprecated** File descriptors for the child to use\n for stdio. (See below)\n * `env` {Object} Environment key-value pairs\n * `encoding` {String} (Default: 'utf8')\n * `timeout` {Number} (Default: 0)\n* `callback` {Function} called with the output when process terminates\n * `code` {Integer} Exit code\n * `stdout` {Buffer}\n * `stderr` {Buffer}\n* Return: ChildProcess object\n\nAn object containing the three standard streams, plus other parameters like the\nPID, signal code, and exit code", "short_description": "Runs a Unix command in a shell and buffers the output.\n", "ellipsis_description": "Runs a Unix command in a shell and buffers the output.\n ...", "line": 180, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.exec", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L180", "name": "exec", "path": "child_process.exec" }, { "id": "child_process.execFile", "type": "class method", "signatures": [ { "args": [ { "name": "file", "types": [ "String" ] }, { "name": "args", "types": [ "String" ] }, { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "stdout", "type": [ "streams.ReadableStream" ] }, { "name": "stderr", "type": [ "streams.ReadableStream" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "file", "types": [ "String" ], "description": "The file location with the commands to run" }, { "name": "args", "types": [ "String" ], "description": "The command line arguments to pass" }, { "name": "options", "types": [ "Object" ], "description": "The options to pass to the `exec` call" }, { "name": "callback", "types": [ "Function" ], "description": "The function to run after the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard `Error` object, except `err.code` is the exit code of the child process, and `err.signal is set to the signal that terminated the process" }, { "name": "stdout", "types": [ "streams.ReadableStream" ], "description": "is the standard output stream" }, { "name": "stderr", "types": [ "streams.ReadableStream" ], "description": "is the standard error stream" } ], "description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly. This makes it slightly leaner than\n`child.exec`. It has the same options and callback.", "short_description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly. This makes it slightly leaner than\n`child.exec`. It has the same options and callback.", "ellipsis_description": "A function similar to `child.exec()`, except instead of executing a subshell it\nexecutes the specified file directly...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.execFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L198", "name": "execFile", "path": "child_process.execFile" }, { "id": "child_process.fork", "type": "class method", "signatures": [ { "args": [ { "name": "modulePath", "types": [ "String" ] }, { "name": "arguments", "types": [ "Array" ] }, { "name": "options", "types": [ "Object" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "modulePath", "types": [ "String" ], "description": "The location of the module" }, { "name": "arguments", "types": [ "Array" ], "description": "A list of string arguments to use" }, { "name": "options", "types": [ "Object" ], "description": "Any additional options to pass `cwd` {String} Current working directory of the child process `customFds` {Array} Deprecated File descriptors for the child to use for stdio. (See below) `env` {Object} Environment key-value pairs `encoding` {String} (Default: 'utf8') `timeout` {Number} (Default: 0) (related to: child_process.spawn)" } ], "description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js processes. In addition to having all the\nmethods in a normal ChildProcess instance, the returned object has a\ncommunication channel built-in. The channel is written with `child.send(message,\n[sendHandle])`, and messages are recieved by a `'message'` event on the child.\n\nBy default the spawned Node.js process will have the `stdin`, `stdout`, `stderr`\nassociated with the parent's.\n\nThese child nodes are still whole new instances of V8. Assume at least 30ms\nstartup and 10mb memory for each new node. That is, you can't create many\nthousands of them.\n\n#### Example\n\n\n\nThe child script, `'sub.js'`, might look like this:\n\n\n\nIn the child, the `process` object has a `send()` method, and `process` emits\nobjects each time it receives a message on its channel.\n\nThe `sendHandle` option on `child.send()` is for sending a handle object to\nanother process. The child receives the handle as as second argument to the\n`message` event. Here's an example of sending a handle:\n\n var server = require('net').createServer();\n var child = require('child_process').fork(__dirname + '/child.js');\n // Open up the server object and send the handle.\n server.listen(1337, function() {\n child.send({ server: true }, server._handle);\n });\n\nHere's an example of receiving the server handle and sharing it between\nprocesses:\n\n process.on('message', function(m, serverHandle) {\n if (serverHandle) {\n var server = require('net').createServer();\n server.listen(serverHandle);\n }\n });", "short_description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js processes. In addition to having all the\nmethods in a normal ChildProcess instance, the returned object has a\ncommunication channel built-in. The channel is written with `child.send(message,\n[sendHandle])`, and messages are recieved by a `'message'` event on the child.\n", "ellipsis_description": "This is a special case of the [[child_process.spawn `child_process.spawn()`]]\nfunctionality for spawning Node.js pro...", "line": 259, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L259", "name": "fork", "path": "child_process.fork" }, { "id": "child_process.kill", "type": "class method", "signatures": [ { "args": [ { "name": "signal", "default_value": "SIGTERM", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "signal", "types": [ "String" ], "description": "The kill signal to send", "optional": true } ], "description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.htm\nl) for a list of available signals.\n\nNote that while the function is called `kill`, the signal delivered to the child\nprocess may not actually kill it. `kill` really just sends a signal to a\nprocess.\n\nFor more information, see\n[`kill(2)`](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n\n#### Example\n\n", "short_description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal.7.htm\nl) for a list of available signals.\n", "ellipsis_description": "Sends a signal to the child process. See\n[`signal(7)`](http://www.kernel.org/doc/man-pages/online/pages/man7/signal....", "line": 279, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.kill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L279", "name": "kill", "path": "child_process.kill" }, { "id": "child_process.pid", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The PID of the child process.\n\n#### Example\n\n", "short_description": "The PID of the child process.\n", "ellipsis_description": "The PID of the child process.\n ...", "line": 65, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.pid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L65", "name": "pid", "path": "child_process.pid" }, { "id": "child_process.spawn", "type": "class method", "signatures": [ { "args": [ { "name": "command", "types": [ "String" ] }, { "name": "args", "optional": true, "types": [ "String", "Array" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "command", "types": [ "String" ], "description": "The Unix command to spawn" }, { "name": "args", "types": [ "String", "Array" ], "description": "The command line arguments to pass", "optional": true }, { "name": "options", "types": [ "Object" ], "description": "Any additional options you want to transfer (related to: child_process.exec)", "optional": true } ], "description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` specifies additional options, which default\nto:\n\n {\n\t\t\tcwd: undefined,\n \tenv: process.env\n }\n\nThey refer to:\n\n* `cwd` specifies the working directory from which the process is spawned\n* `env` specifies environment variables that will be visible to the new process\n\nNote that if `spawn()` receives an empty `options` object, it spawns the process\nwith an empty environment rather than using [[process.env `process.env`]]. This\nis due to backwards compatibility issues with a deprecated API.\n\n##### Undocumented Options\n\nThere are several internal options—in particular: `stdinStream`, `stdoutStream`,\nand `stderrStream`. They are for INTERNAL USE ONLY. As with all undocumented\nAPIs in Node.js, they shouldn't be used.\n\nThere is also a deprecated option called `customFds`, which allows one to\nspecify specific file descriptors for the `stdio` of the child process. This API\nwas not portable to all platforms and therefore removed. With `customFds`, it\nwas possible to hook up the new process' [stdin, stdout, stderr] to existing\nstream; `-1` meant that a new stream should be created. **Use this functionality\nat your own risk.**\n\n#### Example: Running `ls -lh /usr`, capturing `stdout`, `stderr`, and the exit\ncode\n\n\n\n#### Example: A very elaborate way to run `'ps ax | grep ssh'`:\n\n\n\n#### Example: Checking for a failed `exec`:\n\n", "short_description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` specifies additional options, which default\nto:\n", "ellipsis_description": "Launches a new process for the given Unix `command`. You can pass command line\narguments through `args`. `options` s...", "line": 118, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.spawn", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L118", "name": "spawn", "path": "child_process.spawn" }, { "id": "child_process.stdin", "type": "class property", "signatures": [ { "returns": [ { "type": "streams.WritableStream" } ] } ], "description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via [[streams.WritableStream.end\n`streams.WritableStream.end()`]] often causes the child process to terminate.", "short_description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via [[streams.WritableStream.end\n`streams.WritableStream.end()`]] often causes the child process to terminate.", "ellipsis_description": "A [[streams.WritableStream `Writable Stream`]] that represents the child\nprocess's `stdin`. Closing this stream via ...", "line": 46, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.stdin", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L46", "name": "stdin", "path": "child_process.stdin" }, { "id": "child_process.stdout", "type": "class property", "signatures": [ { "returns": [ { "type": "streams.ReadableStream" } ] } ], "description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`.", "short_description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`.", "ellipsis_description": "A [[streams.ReadableStream `Readable Stream`]] that represents the child\nprocess's `stdout`. ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process.stdout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L54", "name": "stdout", "path": "child_process.stdout" }, { "id": "child_process@exit", "type": "event", "signatures": [ { "args": [ { "name": "code", "types": [ "Number" ] }, { "name": "signal", "types": [ "String" ] } ] } ], "arguments": [ { "name": "code", "types": [ "Number" ], "description": "The final exit code of the process (otherwise, `null`)" }, { "name": "signal", "types": [ "String" ], "description": "The string name of the signal (otherwise, `null`)" } ], "description": "This event is emitted after the child process ends.\n\nFor more information, see\n[waitpid(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/wait.2.html).", "short_description": "This event is emitted after the child process ends.\n", "ellipsis_description": "This event is emitted after the child process ends.\n ...", "line": 37, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process@exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L37", "name": "exit", "path": "child_process.event.exit" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/child_process.markdown", "fileName": "child_process", "resultingFile": "child_process.html#child_process", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/child_process.markdown#L24", "name": "child_process", "path": "child_process" }, { "id": "cluster", "type": "class", "description": "\nA single instance of Node runs in a single thread. To take advantage of\nmulti-core systems the user will sometimes want to launch a cluster of Node\nprocesses to handle the load.\n\nTo use this module, add `require('cluster')` to your code.\n\nNote: This feature was introduced recently, and may change in future versions. Please try it out and provide feedback.\n\n#### Example: Launching one cluster working for each CPU\n\nThe cluster module allows you to easily create a network of processes that all\nshare server ports.\n\nCreate a file called _server.js_ and paste the following code:\n\n\n\nBy launching _server.js_ with the Node.js REPL, you can see that the workers are\nsharing the HTTP port 8000:\n\n % node server.js\n Worker 2438 online\n Worker 2437 online\n\n\n#### Example: Message passing between clusters and the master process\n\n", "stability": "1 - Experimental", "short_description": "\nA single instance of Node runs in a single thread. To take advantage of\nmulti-core systems the user will sometimes want to launch a cluster of Node\nprocesses to handle the load.\n", "ellipsis_description": "\nA single instance of Node runs in a single thread. To take advantage of\nmulti-core systems the user will sometimes ...", "line": 36, "aliases": [], "children": [ { "id": "cluster.disconnect", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "Called when all workers are disconnected and handlers are closed", "optional": true } ], "description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal handlers will be closed, allowing the master\nprocess to die graceful if no other event is waiting.", "short_description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal handlers will be closed, allowing the master\nprocess to die graceful if no other event is waiting.", "ellipsis_description": "When calling this method, all workers will commit a graceful suicide. After they\nare disconnected, all internal hand...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L233", "name": "disconnect", "path": "cluster.disconnect" }, { "id": "cluster.fork", "type": "class method", "signatures": [ { "args": [ { "name": "env", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "worker" } ] } ], "arguments": [ { "name": "env", "types": [ "Object" ], "description": "Additional key/value pairs to add to child process environment.", "optional": true } ], "description": "Spawns a new worker process. This can only be called from the master process.\n\n `cluster.fork` is actually implemented on top of [[child_process.fork\n`child_process.fork()`]]. The difference between `cluster.fork()` and\n`child_process.fork` is simply that `cluster` allows TCP servers to be shared\nbetween workers. The message passing API that is available on\n`child_process.fork` is available with `cluster` as well.", "short_description": "Spawns a new worker process. This can only be called from the master process.\n", "ellipsis_description": "Spawns a new worker process. This can only be called from the master process.\n ...", "line": 83, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L83", "name": "fork", "path": "cluster.fork" }, { "id": "cluster.isMaster", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NODE_WORKER_ID` is undefined.", "short_description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NODE_WORKER_ID` is undefined.", "ellipsis_description": "Flag to determine if the current process is a master process in a cluster. A\nprocess is a master if `process.env.NOD...", "line": 101, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.isMaster", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L101", "name": "isMaster", "path": "cluster.isMaster" }, { "id": "cluster.isWorker", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NODE_WORKER_ID` is defined.", "short_description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NODE_WORKER_ID` is defined.", "ellipsis_description": "Flag to determine if the current process is a worker process in a cluster. A\nprocess is a worker if `process.env.NOD...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.isWorker", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L92", "name": "isWorker", "path": "cluster.isWorker" }, { "id": "cluster.settings", "type": "class method", "signatures": [ { "args": [ { "name": "settings", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "settings", "types": [ "Object" ], "description": "Various settings to configure. The properties on this parameter are: `exec`, the [[String `String`]] file path to worker file. The default is `__filename`. `args`, an [[Array `Array`]] of string arguments passed to worker. The default is `process.argv.slice(2)`. `silent`, [[Boolean `Boolean`]] specifying whether or not to send output to parent's stdio. The default is `false`." } ], "description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not supposed to be change or set manually by\nyou.", "short_description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not supposed to be change or set manually by\nyou.", "ellipsis_description": "All settings set by the [[cluster.setupMaster `setupMaster`]] are stored in this\nsettings object. This object is not...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.settings", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L53", "name": "settings", "path": "cluster.settings" }, { "id": "cluster.setupMaster", "type": "class method", "signatures": [ { "args": [ { "name": "settings", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "settings", "types": [ "Object" ], "description": "Various settings to configure. The properties on this parameter are: `exec`, the [[String `String`]] file path to worker file. The default is `__filename`. `args`, an [[Array `Array`]] of string arguments passed to worker. The default is `process.argv.slice(2)`. `silent`, [[Boolean `Boolean`]] specifying whether or not to send output to parent's stdio. The default is `false`.", "optional": true } ], "description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n\n#### Example\n\n var cluster = require(\"cluster\");\n cluster.setupMaster({\n exec : \"worker.js\",\n args : [\"--use\", \"https\"],\n silent : true\n });\n cluster.autoFork();", "short_description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n", "ellipsis_description": "`setupMaster` is used to change the default `'fork'` behavior. It takes one\noption object argument.\n ...", "line": 222, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.setupMaster", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L222", "name": "setupMaster", "path": "cluster.setupMaster" }, { "id": "cluster.workers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it easy to loop through all living workers,\nlike this:\n\n // Go through all workers\n function eachWorker(callback) {\n for (var uniqueID in cluster.workers) {\n callback(cluster.workers[uniqueID]);\n }\n }\n eachWorker(function (worker) {\n worker.send('big announcement to all workers');\n });\n\nShould you wish to reference a worker over a communication channel, using the\nworker's uniqueID is the easiest way to find the worker:\n\n socket.on('data', function (uniqueID) {\n var worker = cluster.workers[uniqueID];\n });", "short_description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it easy to loop through all living workers,\nlike this:\n", "ellipsis_description": "In the cluster, all living worker objects are stored in this object by their\n`uniqueID` as the key. This makes it ea...", "line": 259, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster.workers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L259", "name": "workers", "path": "cluster.workers" }, { "id": "cluster@death", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "cluster" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "cluster" ], "description": "The dying worker in the cluster" } ], "description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling [[cluster.fork `cluster.fork()`]] again.\n\nDifferent techniques can be used to restart the worker, depending on the\napplication.\n\n#### Example\n\n", "short_description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling [[cluster.fork `cluster.fork()`]] again.\n", "ellipsis_description": "When any of the workers die, the cluster module emits this event. This can be\nused to restart the worker by calling ...", "line": 69, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@death", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L69", "name": "death", "path": "cluster.event.death" }, { "id": "cluster@disconnect", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that disconnected" } ], "description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually after calling [[worker.destroy\n`worker.destroy()`]].\n\nWhen calling `disconnect()`, there may be a delay between the `disconnect` and\n`death` events. This event can be used to detect if the process is stuck in a\ncleanup or if there are long-living connections.\n\n#### Example\n\n cluster.on('disconnect', function(worker) {\n console.log('The worker #' + worker.uniqueID + ' has disconnected');\n });", "short_description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually after calling [[worker.destroy\n`worker.destroy()`]].\n", "ellipsis_description": "When a worker's IPC channel has disconnected, this event is emitted. This\nhappens when the worker dies, usually afte...", "line": 186, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L186", "name": "disconnect", "path": "cluster.event.disconnect" }, { "id": "cluster@fork", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that was forked" } ], "description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, and create you own timeout.\n\n#### Example\n\n var timeouts = [];\n var errorMsg = function () {\n console.error(\"Something must be wrong with the connection ...\");\n });\n\n cluster.on('fork', function (worker) {\n timeouts[worker.uniqueID] = setTimeout(errorMsg, 2000);\n });\n cluster.on('listening', function (worker) {\n clearTimeout(timeouts[worker.uniqueID]);\n });\n cluster.on('death', function (worker) {\n clearTimeout(timeouts[worker.uniqueID]);\n errorMsg();\n });", "short_description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, and create you own timeout.\n", "ellipsis_description": "When a new worker is forked the cluster module will emit a 'fork' event. This\ncan be used to log worker activity, an...", "line": 128, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@fork", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L128", "name": "fork", "path": "cluster.event.fork" }, { "id": "cluster@listening", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] }, { "name": "address", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker to listen for" }, { "name": "address", "types": [ "Object" ], "description": "" } ], "description": "#### Example\n\nThe event handler is executed with two arguments, the `worker` contains the\nworker\nobject and the `address` object contains the following connection properties:\n`address`, `port` and `addressType`. This is very useful if the worker is\nlistening on more than one address.\n\n cluster.on('listening', function (worker, address) {\n console.log(\"A worker is now connected to \" + address.address + \":\" + address.port);\n });", "short_description": "#### Example\n", "ellipsis_description": "#### Example\n ...", "line": 166, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L166", "name": "listening", "path": "cluster.event.listening" }, { "id": "cluster@online", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that becomes online" } ], "description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it emits this event.\n\nThe difference between `'fork'` and `'online'` is that fork is emitted when the\nmaster tries to fork a worker, and `'online'` is emitted when the worker is\nbeing executed.\n\n#### Example\n\n cluster.on('online', function (worker) {\n console.log(\"Yay, the worker responded after it was forked\");\n });", "short_description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it emits this event.\n", "ellipsis_description": "After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online messa...", "line": 147, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@online", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L147", "name": "online", "path": "cluster.event.online" }, { "id": "cluster@setup", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that executed" } ], "description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` was not executed before `fork()`, this function\ncalls `setupMaster()` with no arguments.", "short_description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` was not executed before `fork()`, this function\ncalls `setupMaster()` with no arguments.", "ellipsis_description": "When the [[cluster.setupMaster `setupMaster()`]] function has been executed this\nevent emits. If `.setupMaster()` wa...", "line": 196, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster@setup", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L196", "name": "setup", "path": "cluster.event.setup" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#cluster", "subclasses": [ "worker" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L36", "name": "cluster", "path": "cluster" }, { "id": "console", "type": "class", "metadata": { "type": "global" }, "description": "\nThese methods are useful for printing to stdout and stderr. They are similar to\nthe `console` object functions provided by most web browsers. The `console`\nobject is global, so you don't need to `require` anything.\n\nIt's important to note that printing to stdout and stderr is synchronous, and\ntherefore, blocking.", "stability": "3 - Stable", "short_description": "\nThese methods are useful for printing to stdout and stderr. They are similar to\nthe `console` object functions provided by most web browsers. The `console`\nobject is global, so you don't need to `require` anything.\n", "ellipsis_description": "\nThese methods are useful for printing to stdout and stderr. They are similar to\nthe `console` object functions prov...", "line": 16, "aliases": [], "children": [ { "id": "console.assert", "type": "class method", "signatures": [ { "args": [] } ], "description": "(alias of: assert.ok)\n\nAn alias to `assert.ok()`.", "short_description": "(alias of: assert.ok)\n", "ellipsis_description": "(alias of: assert.ok)\n ...", "line": 27, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.assert", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L27", "name": "assert", "path": "console.assert" }, { "id": "console.dir", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "An object to inspect (alias of: util.inspect)" } ], "description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr.", "short_description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr.", "ellipsis_description": "Uses [[util.inspect `util.inspect()`]] on `obj` and prints the resulting string\nto stderr. ...", "line": 38, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.dir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L38", "name": "dir", "path": "console.dir" }, { "id": "console.error", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "An object to inspect (related to: console.log)" } ], "description": "This performs the same role as `console.log()`, but prints to stderr instead.", "short_description": "This performs the same role as `console.log()`, but prints to stderr instead.", "ellipsis_description": "This performs the same role as `console.log()`, but prints to stderr instead. ...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L59", "name": "error", "path": "console.error" }, { "id": "console.info", "type": "class method", "signatures": [ { "args": [] } ], "description": "(alias of: console.log)\n\nThis is just an alias to `console.log()`.", "short_description": "(alias of: console.log)\n", "ellipsis_description": "(alias of: console.log)\n ...", "line": 69, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.info", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L69", "name": "info", "path": "console.info" }, { "id": "console.log", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "arg", "types": [ "String" ], "description": "The string to print, and any additional formatting arguments (alias of: util.format)", "optional": true } ], "description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n\nEach placeholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n* `%s` - String.\n* `%d` - Number (both integer and float).\n* `%j` - JSON.\n* `%%` - single percent sign (`'%'`). This does not consume an argument.\n\nIf formatting elements are not found in the first string then [[util.inspect\n`util.inspect()`]] is used on each argument.\n\n#### Example\n\n", "short_description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n", "ellipsis_description": "Prints to stdout with a newline. This function can take multiple arguments in [a\n`printf()`-like](http://en.wikipedi...", "line": 95, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.log", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L95", "name": "log", "path": "console.log" }, { "id": "console.time", "type": "class method", "signatures": [ { "args": [ { "name": "label", "types": [ "String" ] } ] } ], "arguments": [ { "name": "label", "types": [ "String" ], "description": "An identifying string (related to: console.timeEnd)" } ], "description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n\n#### Example\n\n", "short_description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n", "ellipsis_description": "Marks a time by printing it out to the console. This is used in conjunction with\n`console.timeEnd()`.\n ...", "line": 110, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.time", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L110", "name": "time", "path": "console.time" }, { "id": "console.timeEnd", "type": "class method", "signatures": [ { "args": [ { "name": "label", "types": [ "String" ] } ] } ], "arguments": [ { "name": "label", "types": [ "String" ], "description": "An identifying string (related to: console.time)" } ], "description": "Finish the previous timer and prints output.\n\n#### Example\n\n\n\nconsole.trace()\n\nPrints a stack trace to stderr of the current position.", "short_description": "Finish the previous timer and prints output.\n", "ellipsis_description": "Finish the previous timer and prints output.\n ...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.timeEnd", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L126", "name": "timeEnd", "path": "console.timeEnd" }, { "id": "console.warn", "type": "class method", "signatures": [ { "args": [ { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "warn", "types": [ "String" ], "description": "A message to send (related to: console.log)" } ], "description": "This performs the same role as `console.log()`, but prints to stderr instead.", "short_description": "This performs the same role as `console.log()`, but prints to stderr instead.", "ellipsis_description": "This performs the same role as `console.log()`, but prints to stderr instead. ...", "line": 48, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console.warn", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L48", "name": "warn", "path": "console.warn" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stdio.markdown", "fileName": "stdio", "resultingFile": "stdio.html#console", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stdio.markdown#L16", "name": "console", "path": "console" }, { "id": "crypto.cipher", "type": "class", "superclass": "crypto", "description": "A class for encrypting data. It's a representation of the [OpenSSL\nimplementation of cipher](http://www.openssl.org/docs/apps/ciphers.html). It can\nbe created as a returned value from [[crypto.createCipher\n`crypto.createCipher()`]] or [[crypto.createCipheriv\n`crypto.createCipheriv()`]].\n\n#### Example\n\n", "short_description": "A class for encrypting data. It's a representation of the [OpenSSL\nimplementation of cipher](http://www.openssl.org/docs/apps/ciphers.html). It can\nbe created as a returned value from [[crypto.createCipher\n`crypto.createCipher()`]] or [[crypto.createCipheriv\n`crypto.createCipheriv()`]].\n", "ellipsis_description": "A class for encrypting data. It's a representation of the [OpenSSL\nimplementation of cipher](http://www.openssl.org/...", "line": 289, "aliases": [], "children": [ { "id": "crypto.cipher.final", "type": "class method", "signatures": [ { "args": [ { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "output_encoding", "types": [ "String" ], "description": "The encoding to use for the output; defaults to binary", "optional": true } ], "description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n\nNote: The `cipher` object can't be used after the `final()` method has been called.", "short_description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n", "ellipsis_description": "Returns any remaining enciphered contents. `output_encoding` can be `'binary'`,\n`'base64'`, or `'hex'`.\n ...", "line": 301, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.final", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L301", "name": "final", "path": "crypto.cipher.final" }, { "id": "crypto.cipher.setAutoPadding", "type": "class method", "signatures": [ { "args": [ { "name": "auto_padding", "default_value": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "auto_padding", "types": [ "Boolean" ], "description": "Specifies wheter automatic padding is on, or not" } ], "description": "You can disable automatic padding of the input data to block size.\n\nIf `auto_padding` is false, the length of the entire input data must be a\nmultiple of the cipher's block size or `final` will fail.\n\nThis is useful for non-standard padding, _e.g._ using `0x0` instead of PKCS\npadding. You must call this before `cipher.final`.", "short_description": "You can disable automatic padding of the input data to block size.\n", "ellipsis_description": "You can disable automatic padding of the input data to block size.\n ...", "line": 330, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.setAutoPadding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L330", "name": "setAutoPadding", "path": "crypto.cipher.setAutoPadding" }, { "id": "crypto.cipher.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "crypto.cipher" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "Defines how the input is encoded; can be `'utf8'`, `'ascii'` or `'binary'`", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "Defines how the output is encoded; can be `'binary'`, `'base64'` or `'hex'` (chainable)", "optional": true } ], "description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as it is streamed.", "short_description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as it is streamed.", "ellipsis_description": "Updates the cipher with `data`. This returns the enciphered contents, and can be\ncalled many times with new data as ...", "line": 316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L316", "name": "update", "path": "crypto.cipher.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.cipher", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L289", "name": "cipher", "path": "crypto.cipher" }, { "id": "crypto.decipher", "type": "class", "superclass": "crypto", "description": "A class for decrypting data. It's used to decipher previously created\n[[crypto.cipher `cipher`]] objects. It can be created as a returned value from\n[[crypto.createDecipher `crypto.createDeipher()`]] or [[crypto.createDecipheriv\n`crypto.createDecipheriv()`]].\n\n#### Example\n\n", "short_description": "A class for decrypting data. It's used to decipher previously created\n[[crypto.cipher `cipher`]] objects. It can be created as a returned value from\n[[crypto.createDecipher `crypto.createDeipher()`]] or [[crypto.createDecipheriv\n`crypto.createDecipheriv()`]].\n", "ellipsis_description": "A class for decrypting data. It's used to decipher previously created\n[[crypto.cipher `cipher`]] objects. It can be ...", "line": 344, "aliases": [], "children": [ { "id": "crypto.decipher.final", "type": "class method", "signatures": [ { "args": [ { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "output_encoding", "types": [ "String" ], "description": "The encoding to use for the output; can be either `'binary'`, `'ascii'`, or `'utf8'`", "optional": true } ], "description": "Returns any remaining plaintext which is deciphered.\n\nNote: The `decipher` object can't be used after the `final()` method been called.", "short_description": "Returns any remaining plaintext which is deciphered.\n", "ellipsis_description": "Returns any remaining plaintext which is deciphered.\n ...", "line": 370, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.final", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L370", "name": "final", "path": "crypto.decipher.final" }, { "id": "crypto.decipher.setAutoPadding", "type": "class method", "signatures": [ { "args": [ { "name": "auto_padding", "default_value": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "auto_padding", "types": [ "Boolean" ], "description": "Specifies wheter automatic padding is on, or not" } ], "description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.final` from checking and removing it. Can only work if the input\ndata's length is a multiple of the\nciphers block size. You must call this before streaming data to\n`decipher.update`.", "short_description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.final` from checking and removing it. Can only work if the input\ndata's length is a multiple of the\nciphers block size. You must call this before streaming data to\n`decipher.update`.", "ellipsis_description": "You can disable auto padding if the data has been encrypted without standard\nblock padding to prevent\n`decipher.fina...", "line": 383, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.setAutoPadding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L383", "name": "setAutoPadding", "path": "crypto.decipher.setAutoPadding" }, { "id": "crypto.decipher.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "crypto.decipher" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "Defines how the input is encoded", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "Defines how the output is encoded (chainable)", "optional": true } ], "description": "Updates the decipher with `data`.\n\nThe `input_encoding` can be `'binary'`, `'base64'` or `'hex'`.\nThe `output_encoding` can be `'binary'`, `'ascii'` or `'utf8'`.", "short_description": "Updates the decipher with `data`.\n", "ellipsis_description": "Updates the decipher with `data`.\n ...", "line": 359, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L359", "name": "update", "path": "crypto.decipher.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.decipher", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L344", "name": "decipher", "path": "crypto.decipher" }, { "id": "crypto.diffieHellman", "type": "class", "superclass": "crypto", "description": "This is a class for creating Diffie-Hellman key exchanges. It's a representation\nof the [OpenSSL implementation of\ndiffie-Hellman](http://www.openssl.org/docs/crypto/dh.html#). It can be created\nas a returned value from [[crypto.createDiffieHellman\n`crypto.createDiffieHellman()`]].\n\n#### Example\n\n", "short_description": "This is a class for creating Diffie-Hellman key exchanges. It's a representation\nof the [OpenSSL implementation of\ndiffie-Hellman](http://www.openssl.org/docs/crypto/dh.html#). It can be created\nas a returned value from [[crypto.createDiffieHellman\n`crypto.createDiffieHellman()`]].\n", "ellipsis_description": "This is a class for creating Diffie-Hellman key exchanges. It's a representation\nof the [OpenSSL implementation of\nd...", "line": 398, "aliases": [], "children": [ { "id": "crypto.diffieHellman.computeSecret", "type": "class method", "signatures": [ { "args": [ { "name": "other_public_key", "types": [ "String" ] }, { "name": "input_encoding", "default_value": "binary", "optional": true, "types": [ "String" ] }, { "name": "output_encoding", "default_value": "input_encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "other_public_key", "types": [ "String" ], "description": "The other party's public key" }, { "name": "input_encoding", "types": [ "String" ], "description": "The encoding used to interprate the public key; can be `'binary'`, `'base64'`, or `'hex'`.", "optional": true }, { "name": "output_encoding", "types": [ "String" ], "description": "The encoding of the returned computation; defaults to the `input_encoding`", "optional": true } ], "description": "Computes the shared secret and returns the computed shared secret.", "short_description": "Computes the shared secret and returns the computed shared secret.", "ellipsis_description": "Computes the shared secret and returns the computed shared secret. ...", "line": 411, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.computeSecret", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L411", "name": "computeSecret", "path": "crypto.diffieHellman.computeSecret" }, { "id": "crypto.diffieHellman.generateKeys", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This key should be transferred to the other\nparty.", "short_description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This key should be transferred to the other\nparty.", "ellipsis_description": "Generates private and public Diffie-Hellman key values, and returns the public\nkey in the specified encoding. This k...", "line": 466, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.generateKeys", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L466", "name": "generateKeys", "path": "crypto.diffieHellman.generateKeys" }, { "id": "crypto.diffieHellman.getGenerator", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman prime in the specified encoding.\n\n#### Example\n\n", "short_description": "Returns the Diffie-Hellman prime in the specified encoding.\n", "ellipsis_description": "Returns the Diffie-Hellman prime in the specified encoding.\n ...", "line": 424, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getGenerator", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L424", "name": "getGenerator", "path": "crypto.diffieHellman.getGenerator" }, { "id": "crypto.diffieHellman.getPrime", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman prime in the specified encoding.\n\n#### Example\n\n", "short_description": "Returns the Diffie-Hellman prime in the specified encoding.\n", "ellipsis_description": "Returns the Diffie-Hellman prime in the specified encoding.\n ...", "line": 437, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPrime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L437", "name": "getPrime", "path": "crypto.diffieHellman.getPrime" }, { "id": "crypto.diffieHellman.getPrivateKey", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman private key in the specified encoding.", "short_description": "Returns the Diffie-Hellman private key in the specified encoding.", "ellipsis_description": "Returns the Diffie-Hellman private key in the specified encoding. ...", "line": 446, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPrivateKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L446", "name": "getPrivateKey", "path": "crypto.diffieHellman.getPrivateKey" }, { "id": "crypto.diffieHellman.getPublicKey", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns the Diffie-Hellman public key in the specified encoding.", "short_description": "Returns the Diffie-Hellman public key in the specified encoding.", "ellipsis_description": "Returns the Diffie-Hellman public key in the specified encoding. ...", "line": 455, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.getPublicKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L455", "name": "getPublicKey", "path": "crypto.diffieHellman.getPublicKey" }, { "id": "crypto.diffieHellman.setPrivateKey", "type": "class method", "signatures": [ { "args": [ { "name": "public_key", "types": [ "String" ] }, { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "public_key", "types": [ "String" ], "description": "The public key that's shared" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Sets the Diffie-Hellman private key.", "short_description": "Sets the Diffie-Hellman private key.", "ellipsis_description": "Sets the Diffie-Hellman private key. ...", "line": 476, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.setPrivateKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L476", "name": "setPrivateKey", "path": "crypto.diffieHellman.setPrivateKey" }, { "id": "crypto.diffieHellman.setPublicKey", "type": "class method", "signatures": [ { "args": [ { "name": "public_key", "types": [ "String" ] }, { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "public_key", "types": [ "String" ], "description": "The public key that's shared" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Sets the Diffie-Hellman public key.", "short_description": "Sets the Diffie-Hellman public key.", "ellipsis_description": "Sets the Diffie-Hellman public key. ...", "line": 486, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman.setPublicKey", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L486", "name": "setPublicKey", "path": "crypto.diffieHellman.setPublicKey" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.diffieHellman", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L398", "name": "diffieHellman", "path": "crypto.diffieHellman" }, { "id": "crypto.hash", "type": "class", "superclass": "crypto", "description": "The class for creating hash digests of data. It's class a representation of the\n[OpenSSL implementation of\nhash](http://www.openssl.org/docs/crypto/crypto.html#item_AUTHENTICATION)\nalgorithms. It can be created as a returned value from [[crypto.createHash\n`crypto.createHash()`]].\n\n#### Example\n\n", "short_description": "The class for creating hash digests of data. It's class a representation of the\n[OpenSSL implementation of\nhash](http://www.openssl.org/docs/crypto/crypto.html#item_AUTHENTICATION)\nalgorithms. It can be created as a returned value from [[crypto.createHash\n`crypto.createHash()`]].\n", "ellipsis_description": "The class for creating hash digests of data. It's class a representation of the\n[OpenSSL implementation of\nhash](htt...", "line": 501, "aliases": [], "children": [ { "id": "crypto.hash.digest", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Calculates the digest of all of the passed data to be hashed.\n\nNote: The `hash` object can't be used after the `digest()` method been called.", "short_description": "Calculates the digest of all of the passed data to be hashed.\n", "ellipsis_description": "Calculates the digest of all of the passed data to be hashed.\n ...", "line": 512, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash.digest", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L512", "name": "digest", "path": "crypto.hash.digest" }, { "id": "crypto.hash.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "input_encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update" }, { "name": "input_encoding", "types": [ "String" ], "description": "The encoding to use; can be `'binary'`, `'hex'`, or `'base64'` (chainable)", "optional": true } ], "description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed.", "short_description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed.", "ellipsis_description": "Updates the hash content with the given `data`. This can be called many times\nwith new data as it is streamed. ...", "line": 524, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L524", "name": "update", "path": "crypto.hash.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hash", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L501", "name": "hash", "path": "crypto.hash" }, { "id": "crypto.hmac", "type": "class", "superclass": "crypto", "description": "A class for creating cryptographic hmac content. It's a representation of the\n[OpenSSL implementation of hmac](http://www.openssl.org/docs/crypto/hmac.html#)\nalgorithms. It can be created as a returned value from [[crypto.createHmac\n`crypto.createHmac()`]].\n\n#### Example\n\n", "short_description": "A class for creating cryptographic hmac content. It's a representation of the\n[OpenSSL implementation of hmac](http://www.openssl.org/docs/crypto/hmac.html#)\nalgorithms. It can be created as a returned value from [[crypto.createHmac\n`crypto.createHmac()`]].\n", "ellipsis_description": "A class for creating cryptographic hmac content. It's a representation of the\n[OpenSSL implementation of hmac](http:...", "line": 538, "aliases": [], "children": [ { "id": "crypto.hmac.digest", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; can be `'hex'`, `'binary'` or `'base64'`", "optional": true } ], "description": "Calculates the digest of all of the passed data to the hmac.\n\nNote: The `hmac` object can't be used after the `digest()` method been called.", "short_description": "Calculates the digest of all of the passed data to the hmac.\n", "ellipsis_description": "Calculates the digest of all of the passed data to the hmac.\n ...", "line": 549, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac.digest", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L549", "name": "digest", "path": "crypto.hmac.digest" }, { "id": "crypto.hmac.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.hmac" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed.", "short_description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed.", "ellipsis_description": "Update the HMAC content with the given `data`. This can be called many times\nwith new data as it is streamed. ...", "line": 559, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L559", "name": "update", "path": "crypto.hmac.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.hmac", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L538", "name": "hmac", "path": "crypto.hmac" }, { "id": "crypto.signer", "type": "class", "superclass": "crypto", "description": "This class is used to generate certificates for OpenSSL. It can be created as a\nreturned value from [[crypto.createSign `crypto.createSign()`]].\n\n#### Example\n\n\n var s1 = crypto.createSign('RSA-SHA1')\n .update('Test123')\n .sign(keyPem, 'base64');\n var verified = crypto.createVerify('RSA-SHA1')\n .update('Test')\n .update('123')\n .verify(certPem, s1, 'base64');\n assert.strictEqual(verified, true, 'sign and verify (base 64)');", "short_description": "This class is used to generate certificates for OpenSSL. It can be created as a\nreturned value from [[crypto.createSign `crypto.createSign()`]].\n", "ellipsis_description": "This class is used to generate certificates for OpenSSL. It can be created as a\nreturned value from [[crypto.createS...", "line": 579, "aliases": [], "children": [ { "id": "crypto.signer.sign", "type": "class method", "signatures": [ { "args": [ { "name": "private_key", "types": [ "String" ] }, { "name": "output_format", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "private_key", "types": [ "String" ], "description": "A string containing the PEM encoded private key for signing" }, { "name": "output_format", "types": [ "String" ], "description": "The output encoding format; can be `'binary'`, `'hex'` or `'base64'`", "optional": true } ], "description": "Calculates the signature on all the updated data passed through the signer.\n\nNote: The `signer` object can not be used after the `sign()` method has been called.\n\n#### Returns\n\n The signature in a format defined by `output_format`.", "short_description": "Calculates the signature on all the updated data passed through the signer.\n", "ellipsis_description": "Calculates the signature on all the updated data passed through the signer.\n ...", "line": 596, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer.sign", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L596", "name": "sign", "path": "crypto.signer.sign" }, { "id": "crypto.signer.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.signer" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed.", "short_description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed.", "ellipsis_description": "Updates the signer object with data. This can be called many times with new data\nas it is streamed. ...", "line": 606, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L606", "name": "update", "path": "crypto.signer.update" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.signer", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L579", "name": "signer", "path": "crypto.signer" }, { "id": "crypto.verifier", "type": "class", "superclass": "crypto", "description": "This class is used to verify signed certificates for OpenSSL. It can be created\nas a returned value from [[crypto.createVerify `crypto.createVerify()`]].\n\n#### Example\n\n\n var s1 = crypto.createSign('RSA-SHA1')\n .update('Test123')\n .sign(keyPem, 'base64');\n var verified = crypto.createVerify('RSA-SHA1')\n .update('Test')\n .update('123')\n .verify(certPem, s1, 'base64');\n assert.strictEqual(verified, true, 'sign and verify (base 64)');", "short_description": "This class is used to verify signed certificates for OpenSSL. It can be created\nas a returned value from [[crypto.createVerify `crypto.createVerify()`]].\n", "ellipsis_description": "This class is used to verify signed certificates for OpenSSL. It can be created\nas a returned value from [[crypto.cr...", "line": 626, "aliases": [], "children": [ { "id": "crypto.verifier.update", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] } ], "returns": [ { "type": "crypto.verifier" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to use for an update (chainable)" } ], "description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed.", "short_description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed.", "ellipsis_description": "Updates the verifier object with data. This can be called many times with new\ndata as it is streamed. ...", "line": 651, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier.update", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L651", "name": "update", "path": "crypto.verifier.update" }, { "id": "crypto.verifier.verify", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "String" ] }, { "name": "signature", "types": [ "String" ] }, { "name": "signature_format", "default_value": "binary", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "String" ], "description": "A string containing a PEM encoded object, which can be one of the following: an RSA public key, a DSA public key or an X.509 certificate" }, { "name": "signature", "types": [ "String" ], "description": "The previously calculated signature for the data" }, { "name": "signature_format", "types": [ "String" ], "description": "The format of the signature; can be `'binary'`, `'hex'`, or `'base64'`", "optional": true } ], "description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n\nNote: The `verifier` object can't be used after the `verify()` method has been called.", "short_description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n", "ellipsis_description": "Returns `true` or `false` depending on the validity of the signature for the\ndata and public key.\n ...", "line": 641, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier.verify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L641", "name": "verify", "path": "crypto.verifier.verify" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/crypto.markdown", "fileName": "crypto", "resultingFile": "crypto.html#crypto.verifier", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/crypto.markdown#L626", "name": "verifier", "path": "crypto.verifier" }, { "id": "dgram", "type": "class", "description": "\nA datagram socket is a type of connectionless Internet socket, for the sending\nor receiving point for packet delivery services. Datagram sockets are available\nin Node.js by adding `require('dgram')` to your code.\n\n#### Some Notes About UDP Datagram Size\n\nThe maximum size of an `IPv4/v6` datagram depends on the `MTU` (_Maximum\nTransmission Unit_) and on the `Payload Length` field size.\n\nThe `Payload Length` field is `16 bits` wide, which means that a normal payload\ncan't be larger than 64K octets, including internet header and data: (65,507\nbytes = 65,535 − 8 bytes UDP header − 20 bytes IP header). This is generally\ntrue for loopback interfaces, but such long datagrams are impractical for most\nhosts and networks.\n\nThe `MTU` is the largest size a given link layer technology can support for\ndatagrams. For any link, IPv4 mandates a minimum `MTU` of `68` octets, while the\nrecommended `MTU` for IPv4 is `576` (typically recommended as the `MTU` for\ndial-up type applications), whether they arrive whole or in fragments.\n\nFor `IPv6`, the minimum `MTU` is `1280` octets; however, the mandatory minimum\nfragment reassembly buffer size is `1500` octets. The value of `68` octets is\nvery small, since most current link layer technologies have a minimum `MTU` of\n`1500` (like Ethernet).\n\nNote: It's impossible to know in advance the MTU of each link through which a packet might travel, and that generally sending a datagram greater than the (receiver) `MTU` won't work (the packet gets silently dropped, without informing the source that the data did not reach its intended recipient).\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nA datagram socket is a type of connectionless Internet socket, for the sending\nor receiving point for packet delivery services. Datagram sockets are available\nin Node.js by adding `require('dgram')` to your code.\n", "ellipsis_description": "\nA datagram socket is a type of connectionless Internet socket, for the sending\nor receiving point for packet delive...", "line": 38, "aliases": [], "children": [ { "id": "dgram.addMembership", "type": "class method", "signatures": [ { "args": [ { "name": "multicastAddress", "types": [ "String" ] }, { "name": "multicastInterface", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "multicastAddress", "types": [ "String" ], "description": "The address to add" }, { "name": "multicastInterface", "types": [ "String" ], "description": "The interface to use", "optional": true } ], "description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n\nIf `multicastInterface` is not specified, the OS will try to add membership to\nall valid interfaces.\n\n#### Example\n\n", "short_description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n", "ellipsis_description": "Tells the kernel to join a multicast group with the `IP_ADD_MEMBERSHIP` socket\noption.\n ...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.addMembership", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L178", "name": "addMembership", "path": "dgram.addMembership" }, { "id": "dgram.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the properties `address` and `port`.", "short_description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the properties `address` and `port`.", "ellipsis_description": "Returns an object containing the address information for a socket. For UDP\nsockets, this object contains the proper...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L113", "name": "address", "path": "dgram.address" }, { "id": "dgram.bind", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "address", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to bind to" }, { "name": "address", "types": [ "String" ], "description": "The address to attach to", "optional": true } ], "description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS tries to listen on all addresses.\n\n#### Example: A UDP server listening on port 41234:\n\n", "short_description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS tries to listen on all addresses.\n", "ellipsis_description": "For UDP sockets, listen for datagrams on a named `port` and optional `address`.\nIf `address` isn't specified, the OS...", "line": 98, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.bind", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L98", "name": "bind", "path": "dgram.bind" }, { "id": "dgram.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Close the underlying socket and stop listening for data on it.", "short_description": "Close the underlying socket and stop listening for data on it.", "ellipsis_description": "Close the underlying socket and stop listening for data on it. ...", "line": 105, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L105", "name": "close", "path": "dgram.close" }, { "id": "dgram.createSocket", "type": "class method", "signatures": [ { "args": [ { "name": "type", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "dgram" } ] } ], "arguments": [ { "name": "type", "types": [ "String" ], "description": "The type of socket to create; valid types are `udp4` and `udp6`" }, { "name": "callback", "types": [ "Function" ], "description": "A callback that's added as a listener for `message` events", "optional": true } ], "description": "Creates a datagram socket of the specified types.\n\nIf you want to receive datagrams, call `socket.bind()`. `socket.bind()` binds to\nthe \"all interfaces\" address on a random port (it does the right thing for both\n`udp4` and `udp6` sockets). You can then retrieve the address and port with\n`socket.address().address` and `socket.address().port`.", "short_description": "Creates a datagram socket of the specified types.\n", "ellipsis_description": "Creates a datagram socket of the specified types.\n ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.createSocket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L54", "name": "createSocket", "path": "dgram.createSocket" }, { "id": "dgram.dropMembership", "type": "class method", "signatures": [ { "args": [ { "name": "multicastAddress", "types": [ "String" ] }, { "name": "multicastInterface", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "multicastAddress", "types": [ "String" ], "description": "The address to drop" }, { "name": "multicastInterface", "types": [ "String" ], "description": "The interface to use", "optional": true } ], "description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket option. This is automatically called by the\nkernel when the socket is closed or process terminates, so most apps will never\nneed to call this.\n\nIf `multicastInterface` is not specified, the OS will try to drop membership to\nall valid interfaces.", "short_description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket option. This is automatically called by the\nkernel when the socket is closed or process terminates, so most apps will never\nneed to call this.\n", "ellipsis_description": "The opposite of `addMembership`—this tells the kernel to leave a multicast group\nwith `IP_DROP_MEMBERSHIP` socket op...", "line": 193, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.dropMembership", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L193", "name": "dropMembership", "path": "dgram.dropMembership" }, { "id": "dgram.send", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "port", "types": [ "Number" ] }, { "name": "address", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The data buffer to send" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use (its number of bytes)" }, { "name": "port", "types": [ "Number" ], "description": "The port to send to" }, { "name": "address", "types": [ "String" ], "description": "The address to send to" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method completes that may be used to detect any DNS errors and when `buf` may be reused", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The standard `Error` object" } ], "description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be specified.\n\nA string may be supplied for the `address` parameter, and it will be resolved\nwith DNS. Note that DNS lookups delay the time that a send takes place, at least\nuntil the next tick. The only way to know for sure that a send has taken place\nis to use the callback.\n\nIf the socket has not been previously bound with a call to [[dgram.bind\n`dgram.bind()`]], it's assigned a random port number and bound to the \"all\ninterfaces\" address (0.0.0.0 for `udp4` sockets, ::0 for `udp6` sockets).\n\n#### Example: Sending a UDP packet to a random port on `localhost`;\n\n", "short_description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be specified.\n", "ellipsis_description": "Sends some information to a specified `address:port`. For UDP sockets, the\ndestination port and IP address must be s...", "line": 84, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.send", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L84", "name": "send", "path": "dgram.send" }, { "id": "dgram.setBroadcast", "type": "class method", "signatures": [ { "args": [ { "name": "flag", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "flag", "types": [ "Boolean" ], "description": "The value of `SO_BROADCAST`" } ], "description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a local interface's broadcast address.", "short_description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a local interface's broadcast address.", "ellipsis_description": "Sets or clears the `SO_BROADCAST` socket option. When this option is set to\n`true`, UDP packets may be sent to a lo...", "line": 122, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setBroadcast", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L122", "name": "setBroadcast", "path": "dgram.setBroadcast" }, { "id": "dgram.setMulticastLoopback", "type": "class method", "signatures": [ { "args": [ { "name": "flag", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "flag", "types": [ "Boolean" ], "description": "The value of `IP_MULTICAST_LOOP`" } ], "description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be received on the local interface.", "short_description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be received on the local interface.", "ellipsis_description": "Sets or clears the `IP_MULTICAST_LOOP` socket option. When this option is\n`true`, multicast packets will also be re...", "line": 161, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setMulticastLoopback", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L161", "name": "setMulticastLoopback", "path": "dgram.setMulticastLoopback" }, { "id": "dgram.setMulticastTTL", "type": "class method", "signatures": [ { "args": [ { "name": "ttl", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "ttl", "types": [ "Number" ], "description": "The value of `IP_MULTICAST_TTL`" } ], "description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the number of IP hops that a packet is allowed to\ngo through, specifically for multicast traffic. Each router or gateway that\nforwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded.\n\nThe argument to `setMulticastTTL()` is a number of hops between 0 and 255. The\ndefault on most systems is 64.", "short_description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the number of IP hops that a packet is allowed to\ngo through, specifically for multicast traffic. Each router or gateway that\nforwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded.\n", "ellipsis_description": "Sets the `IP_MULTICAST_TTL` socket option. TTL stands for \"Time to Live,\" but\nin this context it specifies the numb...", "line": 152, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setMulticastTTL", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L152", "name": "setMulticastTTL", "path": "dgram.setMulticastTTL" }, { "id": "dgram.setTTL", "type": "class method", "signatures": [ { "args": [ { "name": "ttl", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "ttl", "types": [ "Number" ], "description": "The value of `IP_TTL`" } ], "description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP hops that a packet is allowed to go\nthrough. Each router or gateway that forwards a packet decrements the TTL. If\nthe TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL\nvalues is typically done for network probes or when multicasting.\n\nThe argument to `setTTL()` is a number of hops between 1 and 255. The default\non most systems is 64.", "short_description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP hops that a packet is allowed to go\nthrough. Each router or gateway that forwards a packet decrements the TTL. If\nthe TTL is decremented to 0 by a router, it will not be forwarded. Changing TTL\nvalues is typically done for network probes or when multicasting.\n", "ellipsis_description": "Sets the `IP_TTL` socket option. TTL stands for \"Time to Live,\" but in this\ncontext it specifies the number of IP ho...", "line": 137, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram.setTTL", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L137", "name": "setTTL", "path": "dgram.setTTL" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#dgram", "subclasses": [ "socket" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L38", "name": "dgram", "path": "dgram" }, { "id": "dns", "type": "class", "description": "\nDNS is the backbone of all operations on the Internet. To access this module,\ninclude `require('dns')` in your code.\n\nWhenever a Node.js developer does something like `net.connect(80, 'google.com')`\nor `http.get({ host: 'google.com' })`, the [[dns.lookup `dns.lookup()`]] method\nis used. All methods in the dns module use C-Ares—except for `dns.lookup()`\nwhich uses\n[`getaddrinfo(3)`](http://www.kernel.org/doc/man-pages/online/pages/man3/getaddr\ninfo.3.html) in a thread pool. C-Ares is much faster than `getaddrinfo`, but the\nsystem resolver is more constant with how other programs operate. Users who need\nto do a large number of look ups quickly should use the methods that go through\nC-Ares.\n\n#### Example: Resolving `'www.google.com'`, and then reverse resolving the IP\naddresses that are returned:\n\n", "stability": "3 - Stable", "short_description": "\nDNS is the backbone of all operations on the Internet. To access this module,\ninclude `require('dns')` in your code.\n", "ellipsis_description": "\nDNS is the backbone of all operations on the Internet. To access this module,\ninclude `require('dns')` in your code.\n ...", "line": 25, "aliases": [], "children": [ { "id": "dns.lookup", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "family", "default_value": "null", "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "address", "type": [ "String" ] }, { "name": "family", "type": [ "Number" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "address", "type": [ "String" ] }, { "name": "family", "type": [ "Number" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "family", "types": [ "Number" ], "description": "Indicates whether to use IPv4 (`4`) or IPv6 (`6`)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The error object" }, { "name": "address", "types": [ "String" ], "description": "A string representation of an IPv4 or IPv6 address" }, { "name": "family", "types": [ "Number" ], "description": "Either the integer `4` or `6`, and donates the address family--not necessarily the value initially passed to `lookup`", "optional": true } ], "description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n\n#### Example\n\n", "short_description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n", "ellipsis_description": "Resolves a domain (e.g. `'google.com'`) into the first found A (IPv4) or AAAA\n(IPv6) record.\n ...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.lookup", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L43", "name": "lookup", "path": "dns.lookup" }, { "id": "dns.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "rrtype", "default_value": "A", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "rrtype", "types": [ "String" ], "description": "The record type to use", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "String" ], "description": "Determined by the record type and described in each corresponding lookup method" } ], "description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n\n* `A` (IPV4 addresses)\n* `AAAA` (IPV6 addresses)\n* `MX` (mail exchange records)\n* `TXT` (text records)\n* `SRV` (SRV records)\n* `PTR` (used for reverse IP lookups)\n* `NS` (name server records)\n* `CNAME` (canonical name records)\n\n#### Example\n\n", "short_description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n", "ellipsis_description": "Resolves a domain (e.g. `'google.com'`) into an array of the record types\nspecified by `rrtype`. Valid rrtypes are:\n ...", "line": 70, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L70", "name": "resolve", "path": "dns.resolve" }, { "id": "dns.resolve4", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of IPv4 addresses (_e.g._ `['74.125.79.104', '74.125.79.105', '74.125.79.106']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for IPv4 queries (`A`\nrecords). ...", "line": 84, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve4", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L84", "name": "resolve4", "path": "dns.resolve4" }, { "id": "dns.resolve6", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of IPv6 addresses" } ], "description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery).", "short_description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery).", "ellipsis_description": "The same as [[dns.resolve4 `dns.resolve4()`]] except for IPv6 queries (an `AAAA`\nquery). ...", "line": 97, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolve6", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L97", "name": "resolve6", "path": "dns.resolve6" }, { "id": "dns.resolveCname", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the canonical name records available for `domain` (e.g. `['bar.example.com']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n\nEach DNS query can return one of the following error codes:\n\n- `dns.TEMPFAIL`: timeout, SERVFAIL or similar.\n- `dns.PROTOCOL`: got garbled reply.\n- `dns.NXDOMAIN`: domain does not exists.\n- `dns.NODATA`: domain exists but no data of reqd type.\n- `dns.NOMEM`: out of memory while processing.\n- `dns.BADQUERY`: the query is malformed.", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for canonical name records\n(`CNAME` records).\n ...", "line": 188, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveCname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L188", "name": "resolveCname", "path": "dns.resolveCname" }, { "id": "dns.resolveMx", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of MX records, each with a priority and an exchange attribute (_e.g._ `[{'priority' : 10, 'exchange' : 'mx.example.com'},{...}]`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for mail exchange queries\n(`MX` records). ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveMx", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L112", "name": "resolveMx", "path": "dns.resolveMx" }, { "id": "dns.resolveNs", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the name server records available for `domain`, _e.g_ `['ns1.example.com', 'ns2.example.com']`" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for name server records\n(`NS` records). ...", "line": 166, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveNs", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L166", "name": "resolveNs", "path": "dns.resolveNs" }, { "id": "dns.resolveSrv", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of the SRV records available for `domain`. Properties of SRV records are priority, weight, port, and name (_e.g._ `[{'priority' : 10, 'weight' : 5, 'port' : 21223, 'name' : 'service.example.com'}, {...}]`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for service records (`SRV`\nrecords). ...", "line": 141, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveSrv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L141", "name": "resolveSrv", "path": "dns.resolveSrv" }, { "id": "dns.resolveTxt", "type": "class method", "signatures": [ { "args": [ { "name": "domain", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "addresses", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "domain", "types": [ "String" ], "description": "The domain to resolve" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "addresses", "types": [ "Array" ], "description": "An array of text records available for `domain` (_e.g._ `['v=spf1 ip4 0.0.0.0 ~all']`)" } ], "description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords).", "short_description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords).", "ellipsis_description": "The same as [[dns.resolve `dns.resolve()`]], but only for text queries (`TXT`\nrecords). ...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.resolveTxt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L126", "name": "resolveTxt", "path": "dns.resolveTxt" }, { "id": "dns.reverse", "type": "class method", "signatures": [ { "args": [ { "name": "ip", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "domains", "type": [ "Array" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "ip", "types": [ "String" ], "description": "The IP address to reverse" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "err", "types": [ "Error" ], "description": "The `Error` object" }, { "name": "domains", "types": [ "Array" ], "description": "An array of possible domain names" } ], "description": "Reverse resolves an IP address to an array of domain names.", "short_description": "Reverse resolves an IP address to an array of domain names.", "ellipsis_description": "Reverse resolves an IP address to an array of domain names. ...", "line": 152, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns.reverse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L152", "name": "reverse", "path": "dns.reverse" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dns.markdown", "fileName": "dns", "resultingFile": "dns.html#dns", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dns.markdown#L25", "name": "dns", "path": "dns" }, { "id": "eventemitter", "type": "class", "description": "\nMany objects in Node.js emit events. Some examples include:\n\n* [[net.Server `net.Server`]], which emits an event each time a peer connects to\nit\n* [[fs.ReadStream `fs.ReadStream`]], which emits an event when the file is\nopened.\n\nAll objects that emit events are instances of `events.EventEmitter`.\n\nTypically, event names are represented by a camel-cased string. However, there\naren't any strict restrictions on that, as any string is accepted.\n\nThese functions can then be attached to objects, to be executed when an event is\nemitted. Such functions are called _listeners_.\n\nTo inherit from `EventEmitter`, add `require('events').EventEmitter` to your\ncode.\n\nWhen an `EventEmitter` instance experiences an error, the typical action is to\nemit an `'error'` event. Error events are treated as a special case in Node.js.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters automatically emit the event `'newListener'` when new\nlisteners are added.\n\n#### Example\n\n", "stability": "4 - API Frozen", "short_description": "\nMany objects in Node.js emit events. Some examples include:\n", "ellipsis_description": "\nMany objects in Node.js emit events. Some examples include:\n ...", "line": 37, "aliases": [], "children": [ { "id": "eventemitter.addListener", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute (alias of: eventemitter.on)" } ], "description": "Adds a listener to the end of the listeners array for the specified event.\n\n#### Example\n\n", "short_description": "Adds a listener to the end of the listeners array for the specified event.\n", "ellipsis_description": "Adds a listener to the end of the listeners array for the specified event.\n ...", "line": 61, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.addListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L61", "name": "addListener", "path": "eventemitter.addListener" }, { "id": "eventemitter.emit", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "arg", "types": [ "Object" ], "description": "Any optional arguments for the listeners", "optional": true } ], "description": "Execute each of the subscribed listeners in order with the supplied arguments.", "short_description": "Execute each of the subscribed listeners in order with the supplied arguments.", "ellipsis_description": "Execute each of the subscribed listeners in order with the supplied arguments. ...", "line": 70, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.emit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L70", "name": "emit", "path": "eventemitter.emit" }, { "id": "eventemitter.listeners", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event type to listen for" } ], "description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n\n#### Example\n\n", "short_description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n", "ellipsis_description": "Returns an array of listeners for the specified event. This array can be\nmanipulated, e.g. to remove listeners.\n ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.listeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L82", "name": "listeners", "path": "eventemitter.listeners" }, { "id": "eventemitter.once", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute" } ], "description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after which it is removed.\n\n#### Example\n\n server.once('connection', function (stream) {\n console.log('Ah, we have our first user!');\n });", "short_description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after which it is removed.\n", "ellipsis_description": "Adds a **one time** listener for the event. This listener is invoked only the\nnext time the event is fired, after wh...", "line": 98, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.once", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L98", "name": "once", "path": "eventemitter.once" }, { "id": "eventemitter.removeAllListeners", "type": "class method", "signatures": [ { "args": [ { "name": "event", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "An optional event type to remove", "optional": true } ], "description": "Removes all listeners, or those of the specified event.", "short_description": "Removes all listeners, or those of the specified event.", "ellipsis_description": "Removes all listeners, or those of the specified event. ...", "line": 106, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.removeAllListeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L106", "name": "removeAllListeners", "path": "eventemitter.removeAllListeners" }, { "id": "eventemitter.removeListener", "type": "class method", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to listen for" }, { "name": "callback", "types": [ "Function" ], "description": "The listener callback to execute" } ], "description": "Remove a listener from the listener array for the specified event.\n\nWarning: This can change array indices in the listener array behind the\nlistener.\n\n#### Example\n\n var callback = function(stream) {\n console.log('someone connected!');\n };\n server.on('connection', callback);\n // ...\n server.removeListener('connection', callback);", "short_description": "Remove a listener from the listener array for the specified event.\n", "ellipsis_description": "Remove a listener from the listener array for the specified event.\n ...", "line": 127, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.removeListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L127", "name": "removeListener", "path": "eventemitter.removeListener" }, { "id": "eventemitter.setMaxListeners", "type": "class method", "signatures": [ { "args": [ { "name": "n", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "n", "types": [ "Number" ], "description": "The maximum number of listeners" } ], "description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a useful default which helps finding memory\nleaks.\n\nObviously, not all Emitters should be limited to 10. This function allows that\nto be increased. Set it to `0` for unlimited listeners.\n\n#### Example\n\n", "short_description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a useful default which helps finding memory\nleaks.\n", "ellipsis_description": "By default, EventEmitters print a warning if more than 10 listeners are added\nfor a particular event. This is a usef...", "line": 143, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter.setMaxListeners", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L143", "name": "setMaxListeners", "path": "eventemitter.setMaxListeners" }, { "id": "eventemitter@newListener", "type": "event", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "listener", "types": [ "Function" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event to emit" }, { "name": "listener", "types": [ "Function" ], "description": "The attaching listener" } ], "description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached.", "short_description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached.", "ellipsis_description": "This event is emitted any time someone adds a new listener, but *before* the\nlistener is attached. ...", "line": 47, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter@newListener", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L47", "name": "newListener", "path": "eventemitter.event.newListener" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/events.markdown", "fileName": "events", "resultingFile": "events.html#eventemitter", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/events.markdown#L37", "name": "eventemitter", "path": "eventemitter" }, { "id": "fs", "type": "class", "description": "\nIn Node.js, file input and output is provided by simple wrappers around standard\n[POSIX functions](http://en.wikipedia.org/wiki/POSIX). All the read and write\nmethods methods have asynchronous and synchronous forms. To use this module,\ninclude `require('fs')` in your code.\n\nThe asynchronous form always take a completion callback as its last argument.\nThe arguments passed to the completion callback depend on the method, but the\nfirst argument is always reserved for an exception. If the operation was\ncompleted successfully, then the first argument will be `null` or `undefined`.\n\nWhen using the synchronous form, any exceptions are immediately thrown. You can\nuse `try/catch` to handle exceptions, or allow them to bubble up.\n\nIn busy processes, the programmer is **strongly encouraged** to use the\nasynchronous versions of these calls. The synchronous versions block the entire\nprocess until they complete—halting all connections. However, with the\nasynchronous methods, there is no guaranteed ordering.\n\nNote: When processing files, relative paths to filename can be used; however, this path is relative to [[process.cwd `process.cwd()`]].\n\n#### Example: An asynchronous file delete:\n\n\n\n#### Example: A synchronous file delete:\n\n\n\n#### Example: Handling timing issues with callback\n\nHere's an example of the **wrong** way to perform more than one asynchronous\noperation:\n\n fs.rename('/tmp/hello', '/tmp/world', function (err) {\n if (err) throw err;\n console.log('renamed complete');\n });\n\t\t// ERROR: THIS IS NOT CORRECT!\n fs.stat('/tmp/world', function (err, stats) {\n if (err) throw err;\n console.log('stats: ' + JSON.stringify(stats));\n });\n\nIn the example above, it could be that `fs.stat` is executed before `fs.rename`.\nThe correct way to do this is to chain the callbacks, like this:\n\n fs.rename('/tmp/hello', '/tmp/world', function (err) {\n if (err) throw err;\n fs.stat('/tmp/world', function (err, stats) {\n if (err) throw err;\n console.log('stats: ' + JSON.stringify(stats));\n });\n });", "stability": "3 - Stable", "short_description": "\nIn Node.js, file input and output is provided by simple wrappers around standard\n[POSIX functions](http://en.wikipedia.org/wiki/POSIX). All the read and write\nmethods methods have asynchronous and synchronous forms. To use this module,\ninclude `require('fs')` in your code.\n", "ellipsis_description": "\nIn Node.js, file input and output is provided by simple wrappers around standard\n[POSIX functions](http://en.wikipe...", "line": 62, "aliases": [], "children": [ { "id": "fs.chmod", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "short_description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "ellipsis_description": "An asynchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the per...", "line": 253, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L253", "name": "chmod", "path": "fs.chmod" }, { "id": "fs.chmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "short_description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permissions of the file specified whose, which is dereferenced\nif it is a symbolic link.", "ellipsis_description": "A synchronous\n[chmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chmod.2.html).\nThis changes the permi...", "line": 269, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L269", "name": "chmodSync", "path": "fs.chmodSync" }, { "id": "fs.chown", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\nde-referenced if it is a symbolic link.", "short_description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\nde-referenced if it is a symbolic link.", "ellipsis_description": "An asynchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the own...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L146", "name": "chown", "path": "fs.chown" }, { "id": "fs.chownSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\ndereferenced if it is a symbolic link", "short_description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the ownership of the file specified by `path`, which is\ndereferenced if it is a symbolic link", "ellipsis_description": "A synchronous\n[chown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html).\nThis changes the owner...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.chownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L162", "name": "chownSync", "path": "fs.chownSync" }, { "id": "fs.close", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "short_description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "ellipsis_description": "An asynchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/ma...", "line": 711, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L711", "name": "close", "path": "fs.close" }, { "id": "fs.closeSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "short_description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/close.2.html).", "ellipsis_description": "A synchronous file close; for more information, see\n[close(2)](http://www.kernel.org/doc/man-pages/online/pages/man2...", "line": 724, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.closeSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L724", "name": "closeSync", "path": "fs.closeSync" }, { "id": "fs.createReadStream", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "fs.ReadStream" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to read from" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how to read the stream", "optional": true } ], "description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n\n`options` is an object with the following defaults:\n\n {\n flags: 'r',\n encoding: null,\n fd: null,\n mode: 0666,\n bufferSize: 64 * 1024\n }\n\n`options` can include `start` and `end` values to read a range of bytes from the\nfile instead of the entire file. Both `start` and `end` are inclusive and start\nat 0.\n\n#### Example\n\nHere's an example to read the last 10 bytes of a file which is 100 bytes long:\n\n fs.createReadStream('sample.txt', {start: 90, end: 99});", "short_description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n", "ellipsis_description": "Returns a new [[fs.ReadStream `fs.ReadStream`]] object.\n ...", "line": 1202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.createReadStream", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1202", "name": "createReadStream", "path": "fs.createReadStream" }, { "id": "fs.createWriteStream", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "fs.WriteStream" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to read from" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how to write the stream", "optional": true } ], "description": "Returns a new [[streams.WritableStream WriteStream]] object.\n\n`options` is an object with the following defaults:\n\n { flags: 'w',\n encoding: null,\n mode: 0666 }\n\n`options` may also include a `start` option to allow writing data at some\nposition past the beginning of the file.\n\nModifying a file rather than replacing it may require a `flags` mode of `r+`\nrather than the default mode `w`.", "short_description": "Returns a new [[streams.WritableStream WriteStream]] object.\n", "ellipsis_description": "Returns a new [[streams.WritableStream WriteStream]] object.\n ...", "line": 1225, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.createWriteStream", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1225", "name": "createWriteStream", "path": "fs.createWriteStream" }, { "id": "fs.fchmod", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "short_description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "ellipsis_description": "An asynchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the ...", "line": 288, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L288", "name": "fchmod", "path": "fs.fchmod" }, { "id": "fs.fchmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "short_description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the permissions of the file referred to by the open file\ndescriptor.", "ellipsis_description": "A synchronous\n[fchmod(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchmod.2.html)\n. This changes the pe...", "line": 304, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L304", "name": "fchmodSync", "path": "fs.fchmodSync" }, { "id": "fs.fchown", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "short_description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "ellipsis_description": "An asynchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ...", "line": 181, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L181", "name": "fchown", "path": "fs.fchown" }, { "id": "fs.fchownSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "short_description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ownership of the file referred to by the open file descriptor\nfd.", "ellipsis_description": "A synchronous\n[fchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fchown.2.html)\n. This changes the ow...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fchownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L198", "name": "fchownSync", "path": "fs.fchownSync" }, { "id": "fs.fstat", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`]] object." } ], "description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 391, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fstat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L391", "name": "fstat", "path": "fs.fstat" }, { "id": "fs.fstatSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[fstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 430, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fstatSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L430", "name": "fstatSync", "path": "fs.fstatSync" }, { "id": "fs.fsync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err" } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err" } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "short_description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "ellipsis_description": "An asynchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html). ...", "line": 887, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fsync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L887", "name": "fsync", "path": "fs.fsync" }, { "id": "fs.fsyncSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" } ], "description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "short_description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html).", "ellipsis_description": "A synchronous\n[fsync(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/fsync.2.html). ...", "line": 901, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.fsyncSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L901", "name": "fsyncSync", "path": "fs.fsyncSync" }, { "id": "fs.futimes", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "short_description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "ellipsis_description": "An asynchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file...", "line": 853, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.futimes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L853", "name": "futimes", "path": "fs.futimes" }, { "id": "fs.futimesSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" } ], "description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "short_description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file timestamps of a file referenced by the supplied file\ndescriptor.", "ellipsis_description": "A synchronous\n[futimes(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/lutimes.3.htm\nl). Change the file t...", "line": 871, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.futimesSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L871", "name": "futimesSync", "path": "fs.futimesSync" }, { "id": "fs.lchmod", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] except in the case where the named file is a\nsymbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "short_description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] except in the case where the named file is a\nsymbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "ellipsis_description": "An asynchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html).\nThis is like [[fs.chmod `chmod()`]] ex...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchmod", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L323", "name": "lchmod", "path": "fs.lchmod" }, { "id": "fs.lchmodSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "mode", "types": [ "Number" ], "description": "The new permissions" } ], "description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()`]]except in the case where the named file is\na symbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "short_description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()`]]except in the case where the named file is\na symbolic link, in which case `lchmod()` sets the permission bits of the link,\nwhile `chmod()` sets the bits of the file the link references.", "ellipsis_description": "A synchronous [lchmod(2)](http://www.daemon-systems.org/man/lchmod.2.html). This\nis like [[fs.chmodSync `chmodSync()...", "line": 339, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchmodSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L339", "name": "lchmodSync", "path": "fs.lchmodSync" }, { "id": "fs.lchown", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chown `chown()`]], but doesn't dereference symbolic links.", "short_description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chown `chown()`]], but doesn't dereference symbolic links.", "ellipsis_description": "An asynchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs...", "line": 217, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchown", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L217", "name": "lchown", "path": "fs.lchown" }, { "id": "fs.lchownSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "uid", "types": [ "Number" ] }, { "name": "gid", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "uid", "types": [ "Number" ], "description": "The new owner id" }, { "name": "gid", "types": [ "Number" ], "description": "The new group id" } ], "description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chownSync `chownSync()`]], but doesn't dereference symbolic\nlinks", "short_description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.chownSync `chownSync()`]], but doesn't dereference symbolic\nlinks", "ellipsis_description": "Synchronous\n[lchown(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/lchown.2.html)\n. This is like [[fs.cho...", "line": 234, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lchownSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L234", "name": "lchownSync", "path": "fs.lchownSync" }, { "id": "fs.link", "type": "class method", "signatures": [ { "args": [ { "name": "srcpath", "types": [ "String" ] }, { "name": "dstpath", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The original path of a file" }, { "name": "dstpath", "types": [ "String" ], "description": "The new file link path" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "short_description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "ellipsis_description": "An asynchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html). ...", "line": 447, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.link", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L447", "name": "link", "path": "fs.link" }, { "id": "fs.linkSync", "type": "class method", "signatures": [ { "args": [ { "name": "srcpath", "types": [ "String" ] }, { "name": "dstpath", "types": [ "String" ] } ] } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The original path of a file" }, { "name": "dstpath", "types": [ "String" ], "description": "The new file link path" } ], "description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "short_description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html).", "ellipsis_description": "A synchronous\n[link(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/link.2.html). ...", "line": 461, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.linkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L461", "name": "linkSync", "path": "fs.linkSync" }, { "id": "fs.lstat", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`] object." } ], "description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 374, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lstat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L374", "name": "lstat", "path": "fs.lstat" }, { "id": "fs.lstatSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" } ], "description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[lstat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.lstatSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L417", "name": "lstatSync", "path": "fs.lstatSync" }, { "id": "fs.mkdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "default_value": 777, "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the new directory" }, { "name": "mode", "types": [ "Number" ], "description": "An optional permission to set", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "short_description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "ellipsis_description": "An asynchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html). ...", "line": 646, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.mkdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L646", "name": "mkdir", "path": "fs.mkdir" }, { "id": "fs.mkdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "mode", "default_value": 777, "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the new directory" }, { "name": "mode", "types": [ "Number" ], "description": "An optional permission to set", "optional": true } ], "description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "short_description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html).", "ellipsis_description": "A synchronous\n[mkdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/mkdir.2.html). ...", "line": 660, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.mkdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L660", "name": "mkdirSync", "path": "fs.mkdirSync" }, { "id": "fs.open", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "flags", "types": [ "String" ] }, { "name": "mode", "default_value": 666, "optional": true, "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "fd", "type": [ "Number" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "fd", "type": [ "Number" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "flags", "types": [ "String" ], "description": "A string indicating how to open the file" }, { "name": "mode", "types": [ "Number" ], "description": "The optional permissions to give the file if it's created", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "fd", "types": [ "Number" ], "description": "An open file descriptor" } ], "description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n\n`flags` can be one of the following:\n\n* `'r'`: Opens the file for reading. An exception occurs if the file does not\nexist.\n\n* `'r+'`: Opens the file for reading and writing. An exception occurs if the\nfile does not exist.\n\n* `'w'`: Opens the file for writing. The file is created (if it does not exist)\nor truncated (if it exists).\n\n* `'w+'`: Opens the file for reading and writing. The file is created (if it\ndoesn't exist) or truncated (if it exists).\n\n* `'a'`: Opens the file for appending. The file is created if it doesn't exist.\n\n* `'a+'`: Opens the file for reading and appending. The file is created if it\ndoesn't exist.", "short_description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n", "ellipsis_description": "An asynchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2...", "line": 762, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L762", "name": "open", "path": "fs.open" }, { "id": "fs.openSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "flags", "types": [ "String" ] }, { "name": "mode", "default_value": 666, "optional": true, "types": [ "Number" ] } ], "returns": [ { "type": "Number" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "flags", "types": [ "String" ], "description": "A string indicating how to open the file" }, { "name": "mode", "types": [ "Number" ], "description": "The optional permissions to give the file if it's created", "optional": true } ], "description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n\n`flags` can be one of the following:\n\n* `'r'`: Opens the file for reading. An exception occurs if the file does not\nexist.\n\n* `'r+'`: Opens the file for reading and writing. An exception occurs if the\nfile does not exist.\n\n* `'w'`: Opens the file for writing. The file is created (if it does not exist)\nor truncated (if it exists).\n\n* `'w+'`: Opens the file for reading and writing. The file is created (if it\ndoesn't exist) or truncated (if it exists).\n\n* `'a'`: Opens the file for appending. The file is created if it doesn't exist.\n\n* `'a+'`: Opens the file for reading and appending. The file is created if it\ndoesn't exist.\n\n#### Returns\n\nAn open file descriptor.", "short_description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html).\n", "ellipsis_description": "A synchronous file open; for more information, see\n[open(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/o...", "line": 800, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.openSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L800", "name": "openSync", "path": "fs.openSync" }, { "id": "fs.read", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "buffer", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "position", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "bytesRead", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "bytesRead", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to read from" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start writing at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates the number of bytes to read" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where the reading should begin" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "bytesRead", "types": [ "Number" ], "description": "Specifies how many bytes were read from `buffer`" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The rest of the buffer" } ], "description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from the current file position.", "short_description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from the current file position.", "ellipsis_description": "Read data from the file specified by `fd` and writes it to `buffer`. If\n`position` is `null`, data will be read from...", "line": 977, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.read", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L977", "name": "read", "path": "fs.read" }, { "id": "fs.readdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "files", "type": [ "Array" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "files", "type": [ "Array" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the directory" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "files", "types": [ "Array" ], "description": "An array of the names of the files in the directory (excluding `'.'` and `'..'`)" } ], "description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the contents of a directory.", "short_description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the contents of a directory.", "ellipsis_description": "An asynchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). It reads the c...", "line": 679, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L679", "name": "readdir", "path": "fs.readdir" }, { "id": "fs.readdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the directory" } ], "description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array of filenames, excluding `'.'` and `'..'`.", "short_description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array of filenames, excluding `'.'` and `'..'`.", "ellipsis_description": "A synchronous\n[readdir(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.htm\nl). Returns an array ...", "line": 694, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L694", "name": "readdirSync", "path": "fs.readdirSync" }, { "id": "fs.readFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "data", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "data", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to read" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "data", "types": [ "Buffer" ], "description": "The contents of the file" } ], "description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n\n#### Example\n\n fs.readFile('/etc/passwd', function (err, data) {\n if (err) throw err;\n console.log(data);\n });", "short_description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n", "ellipsis_description": "Asynchronously reads the entire contents of a file. If no encoding is specified,\nthen the raw buffer is returned.\n ...", "line": 1029, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1029", "name": "readFile", "path": "fs.readFile" }, { "id": "fs.readFileSync", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" }, { "type": "Buffer" } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to read" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true } ], "description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n\n#### Returns\n\nThe contents of the `filename`. If `encoding` is specified, then this function\nreturns a string. Otherwise it returns a [[Buffer buffer]].", "short_description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n", "ellipsis_description": "Synchronous version of [[fs.readFile `fs.readFile()`]]. Returns the contents of\nthe `filename`.\n ...", "line": 1048, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readFileSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1048", "name": "readFileSync", "path": "fs.readFileSync" }, { "id": "fs.readlink", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "linkString", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "linkString", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The original path of a link" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "linkString", "types": [ "String" ], "description": "T he symlink's string value" } ], "description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).", "short_description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).", "ellipsis_description": "An asynchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml). ...", "line": 516, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L516", "name": "readlink", "path": "fs.readlink" }, { "id": "fs.readlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The original path of a link" } ], "description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n\n#### Returns\n\nThe symbolic link's string value.", "short_description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n", "ellipsis_description": "A synchronous\n[readlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/readlink.2.h\ntml).\n ...", "line": 534, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L534", "name": "readlinkSync", "path": "fs.readlinkSync" }, { "id": "fs.readSync", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to read from" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start writing at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates the number of bytes to read" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where the reading should begin" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use" } ], "description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writes it to `buffer`. If `position` is `null`,\ndata will be read from the current file position.\n\n\n#### Returns\n\nThe number of bytes read.", "short_description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writes it to `buffer`. If `position` is `null`,\ndata will be read from the current file position.\n", "ellipsis_description": "The synchronous version of buffer-based [[fs.read `fs.read()`]]. Reads data from\nthe file specified by `fd` and writ...", "line": 1003, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.readSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1003", "name": "readSync", "path": "fs.readSync" }, { "id": "fs.realpath", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "resolvedPath", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "resolvedPath", "type": [ "String" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "A path to a file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "resolvedPath", "types": [ "String" ], "description": "The resolved path string" } ], "description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [[process.cwd `process.cwd()`]] to resolve relative paths.", "short_description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [[process.cwd `process.cwd()`]] to resolve relative paths.", "ellipsis_description": "An asynchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml). You can use [...", "line": 553, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.realpath", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L553", "name": "realpath", "path": "fs.realpath" }, { "id": "fs.realpathSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "A path to a file" } ], "description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n\n#### Returns\n\nThe resolved path.", "short_description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n", "ellipsis_description": "A synchronous\n[realpath(3)](http://www.kernel.org/doc/man-pages/online/pages/man3/realpath.3.h\ntml).\n ...", "line": 571, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.realpathSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L571", "name": "realpathSync", "path": "fs.realpathSync" }, { "id": "fs.rename", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The original filename and path" }, { "name": "path2", "types": [ "String" ], "description": "The new filename and path" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "short_description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "ellipsis_description": "An asynchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `p...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L80", "name": "rename", "path": "fs.rename" }, { "id": "fs.renameSync", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The original filename and path" }, { "name": "path2", "types": [ "String" ], "description": "The new filename and path" } ], "description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "short_description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `path1` into `path2`.", "ellipsis_description": "A synchronous\n[rename(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rename.2.html)\noperation. Turns `pat...", "line": 93, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.renameSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L93", "name": "renameSync", "path": "fs.renameSync" }, { "id": "fs.rmdir", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to a directory" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "short_description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "ellipsis_description": "An asynchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html). ...", "line": 618, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rmdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L618", "name": "rmdir", "path": "fs.rmdir" }, { "id": "fs.rmdirSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to a directory" } ], "description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "short_description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html).", "ellipsis_description": "A synchronous\n[rmdir(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/rmdir.2.html). ...", "line": 629, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.rmdirSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L629", "name": "rmdirSync", "path": "fs.rmdirSync" }, { "id": "fs.stat", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "stats", "type": [ "fs.Stats" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "stats", "types": [ "fs.Stats" ], "description": "An [[fs.Stats `fs.Stats`] object." } ], "description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "An asynchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 356, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.stat", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L356", "name": "stat", "path": "fs.stat" }, { "id": "fs.statSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ], "returns": [ { "type": "fs.Stats" } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" } ], "description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "short_description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html).", "ellipsis_description": "A synchronous\n[stat(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html). ...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.statSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L404", "name": "statSync", "path": "fs.statSync" }, { "id": "fs.symlink", "type": "class method", "signatures": [ { "args": [ { "name": "linkdata", "types": [ "String" ] }, { "name": "path", "types": [ "String" ] }, { "name": "type", "default_value": "file", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "linkdata", "types": [ "String" ], "description": "The original path of a file" }, { "name": "path", "types": [ "String" ], "description": "The new file link path" }, { "name": "type", "types": [ "String" ], "description": "This can be either `'dir'` or `'file'`. It is only used on Windows ( andignored on other platforms)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "short_description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "ellipsis_description": "An asynchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl). ...", "line": 481, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.symlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L481", "name": "symlink", "path": "fs.symlink" }, { "id": "fs.symlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "linkdata", "types": [ "String" ] }, { "name": "path", "types": [ "String" ] }, { "name": "type", "default_value": "file", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "linkdata", "types": [ "String" ], "description": "The original path of a file" }, { "name": "path", "types": [ "String" ], "description": "The new file link path" }, { "name": "type", "types": [ "String" ], "description": "This can be either `'dir'` or `'file'`. It is only used on Windows ( andignored on other platforms)", "optional": true } ], "description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "short_description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl).", "ellipsis_description": "A synchronous\n[symlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/symlink.2.htm\nl). ...", "line": 498, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.symlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L498", "name": "symlinkSync", "path": "fs.symlinkSync" }, { "id": "fs.truncate", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "len", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "len", "types": [ "Number" ], "description": "The final file length" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "short_description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "ellipsis_description": "An asynchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates...", "line": 111, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.truncate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L111", "name": "truncate", "path": "fs.truncate" }, { "id": "fs.truncateSync", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "len", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "len", "types": [ "Number" ], "description": "The final file length" } ], "description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "short_description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a file to the specified length.", "ellipsis_description": "A synchronous\n[ftruncate(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/truncate.2.\nhtml). It truncates a...", "line": 126, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.truncateSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L126", "name": "truncateSync", "path": "fs.truncateSync" }, { "id": "fs.unlink", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The path to a file" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" } ], "description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "short_description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "ellipsis_description": "An asynchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n. ...", "line": 588, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unlink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L588", "name": "unlink", "path": "fs.unlink" }, { "id": "fs.unlinkSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] } ] } ], "arguments": [ { "name": "srcpath", "types": [ "String" ], "description": "The path to a file" } ], "description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "short_description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n.", "ellipsis_description": "A synchronous\n[unlink(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/unlink.2.html)\n. ...", "line": 602, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unlinkSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L602", "name": "unlinkSync", "path": "fs.unlinkSync" }, { "id": "fs.unwatchFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The filename to watch" } ], "description": "Stops watching for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.", "short_description": "Stops watching for changes on `filename`.\n", "ellipsis_description": "Stops watching for changes on `filename`.\n ...", "line": 1129, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.unwatchFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1129", "name": "unwatchFile", "path": "fs.unwatchFile" }, { "id": "fs.utimes", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps of the file referenced by the supplied path.", "short_description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps of the file referenced by the supplied path.", "ellipsis_description": "An asynchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChanges the timestamps o...", "line": 818, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.utimes", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L818", "name": "utimes", "path": "fs.utimes" }, { "id": "fs.utimesSync", "type": "class method", "signatures": [ { "args": [ { "name": "path", "types": [ "String" ] }, { "name": "atime", "types": [ "Number" ] }, { "name": "mtime", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "path", "types": [ "String" ], "description": "The path to the file" }, { "name": "atime", "types": [ "Number" ], "description": "The new access time" }, { "name": "mtime", "types": [ "Number" ], "description": "The new modification time" } ], "description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of the file referenced by the supplied path.", "short_description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of the file referenced by the supplied path.", "ellipsis_description": "A synchronous\n[utime(2)](http://kernel.org/doc/man-pages/online/pages/man2/utime.2.html).\nChange the timestamps of t...", "line": 834, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.utimesSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L834", "name": "utimesSync", "path": "fs.utimesSync" }, { "id": "fs.watch", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "event", "type": [ "String" ] }, { "name": "filename", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "event", "type": [ "String" ] }, { "name": "filename", "type": [ "String" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "fs.FSWatcher" } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The filename (or directory) to watch" }, { "name": "options", "types": [ "Object" ], "description": "An optional arguments indicating how to watch the files; defaults to `true`", "optional": true }, { "name": "listener", "types": [ "Function" ], "description": "The callback to execute each time the file is accessed" }, { "name": "event", "types": [ "String" ], "description": "Either `'rename'` or '`change'`" }, { "name": "filename", "types": [ "String" ], "description": "The name of the file which triggered the event" } ], "description": "Watch for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.\n\n`options`, if provided, should be an object containing a boolean member\n`persistent`, which indicates whether the process should continue to run as long\nas files are being watched.\n\nWarning: Providing the `filename` argument in the callback is not supported on\nevery platform (currently it's only supported on Linux and Windows). Even on\nsupported platforms, `filename` is **not** always guaranteed to be provided.\nTherefore, don't assume that `filename` argument is always provided in the\ncallback, and have some fallback logic if it is `null`, like in the provided\nexample.\n\n#### Example\n\n fs.watch('somedir', function (event, filename) {\n console.log('event is: ' + event);\n if (filename) {\n console.log('filename provided: ' + filename);\n } else {\n console.log('filename not provided');\n }\n });", "short_description": "Watch for changes on `filename`.\n", "ellipsis_description": "Watch for changes on `filename`.\n ...", "line": 1168, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.watch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1168", "name": "watch", "path": "fs.watch" }, { "id": "fs.watchFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "curr", "type": [ "fs.Stats" ] }, { "name": "prev", "type": [ "fs.Stats" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "curr", "type": [ "fs.Stats" ] }, { "name": "prev", "type": [ "fs.Stats" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to watch" }, { "name": "options", "types": [ "Object" ], "description": "Any optional arguments indicating how often to watch", "optional": true }, { "name": "listener", "types": [ "Function" ], "description": "The callback to execute each time the file is accessed" }, { "name": "curr", "types": [ "fs.Stats" ], "description": "The current `stats` object" }, { "name": "prev", "types": [ "fs.Stats" ], "description": "The previous `stats` object" } ], "description": "Watches for changes on `filename`.\n\n> Stability: 2 - Unstable. Use fs.watch instead, if available.\n\n`options`, if provided, should be an object containing two boolean members:\n`persistent` and `interval`:\n* `persistent` indicates whether the process should continue to run as long as\nfiles are being watched; defaults to `true`\n* `interval` indicates how often the target should be polled, in milliseconds; defaults to `0`\n\nOn Linux systems with [inotify](http://en.wikipedia.org/wiki/Inotify),\n`interval` is ignored.\n\n#### Example\n\n fs.watchFile('message.text', function (curr, prev) {\n console.log('the current modification time is: ' + curr.mtime);\n console.log('the previous modification time was: ' + prev.mtime);\n });", "short_description": "Watches for changes on `filename`.\n", "ellipsis_description": "Watches for changes on `filename`.\n ...", "line": 1117, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.watchFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1117", "name": "watchFile", "path": "fs.watchFile" }, { "id": "fs.write", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "buffer", "types": [ "Buffer" ] }, { "name": "offset", "types": [ "Number" ] }, { "name": "length", "types": [ "Number" ] }, { "name": "position", "types": [ "Number" ] }, { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "written", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "err", "type": [ "Error" ] }, { "name": "written", "type": [ "Number" ] }, { "name": "buffer", "type": [ "Buffer" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where this data should be written" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true }, { "name": "err", "types": [ "Error" ], "description": "The possible exception" }, { "name": "written", "types": [ "Number" ], "description": "Specifies how many bytes were written from `buffer`" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The remaining contents of the buffer" } ], "description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same file without waiting for the callback. For\nthis scenario, [[fs.createWriteStream `fs.createWriteStream()`]] is strongly\nrecommended.\n\nFor more information, see\n[pwrite(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/pwrite.2.html)\n.", "short_description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same file without waiting for the callback. For\nthis scenario, [[fs.createWriteStream `fs.createWriteStream()`]] is strongly\nrecommended.\n", "ellipsis_description": "Writes `buffer` to the file specified by `fd`. Note that it's unsafe to use\n`fs.write` multiple times on the same fi...", "line": 929, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L929", "name": "write", "path": "fs.write" }, { "id": "fs.writeFile", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "data", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to write to" }, { "name": "data", "types": [ "String", "Buffer" ], "description": "The data to write (this can be a string or a buffer)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (this is ignored if `data` is a buffer)", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute once the function completes", "optional": true } ], "description": "Asynchronously writes data to a file, replacing the file if it already exists.\n\n#### Example\n\n", "short_description": "Asynchronously writes data to a file, replacing the file if it already exists.\n", "ellipsis_description": "Asynchronously writes data to a file, replacing the file if it already exists.\n ...", "line": 1067, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1067", "name": "writeFile", "path": "fs.writeFile" }, { "id": "fs.writeFileSync", "type": "class method", "signatures": [ { "args": [ { "name": "filename", "types": [ "String" ] }, { "name": "data", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "filename", "types": [ "String" ], "description": "The name of the file to write to" }, { "name": "data", "types": [ "String", "Buffer" ], "description": "The data to write (this can be a string or a buffer)" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (this is ignored if `data` is a buffer)", "optional": true } ], "description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]].", "short_description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]].", "ellipsis_description": "The synchronous version of [[fs.writeFile `fs.writeFile()`]]. ...", "line": 1082, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeFileSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1082", "name": "writeFileSync", "path": "fs.writeFileSync" }, { "id": "fs.writeSync", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write" }, { "name": "offset", "types": [ "Number" ], "description": "Indicates where in the buffer to start at" }, { "name": "length", "types": [ "Number" ], "description": "Indicates how much of the buffer to use" }, { "name": "position", "types": [ "Number" ], "description": "The offset from the beginning of the file where this data should be written" }, { "name": "str", "types": [ "String" ], "description": "The string to write" }, { "name": "encoding", "types": [ "Number" ], "description": "The encoding to use during the write" } ], "description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n\n#### Returns\n\nReturns the number of bytes written.", "short_description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n", "ellipsis_description": "A synchronous version of the buffer-based [[fs.write `fs.write()`]].\n ...", "line": 954, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.writeSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L954", "name": "writeSync", "path": "fs.writeSync" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs", "subclasses": [ "fs.Stats", "fs.WriteStream", "fs.ReadStream", "fs.FSWatcher" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L62", "name": "fs", "path": "fs" }, { "id": "fs.FSWatcher", "type": "class", "superclass": "fs", "description": "Objects returned from [[fs.watch `fs.watch()`]] are of this type. You can\nmonitor any changes that occur on a watched file by listening for the events in\nthis object.", "short_description": "Objects returned from [[fs.watch `fs.watch()`]] are of this type. You can\nmonitor any changes that occur on a watched file by listening for the events in\nthis object.", "ellipsis_description": "Objects returned from [[fs.watch `fs.watch()`]] are of this type. You can\nmonitor any changes that occur on a watche...", "line": 1393, "aliases": [], "children": [ { "id": "fs.FSWatcher.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stop watching for changes on the given `FSWatcher`.", "short_description": "Stop watching for changes on the given `FSWatcher`.", "ellipsis_description": "Stop watching for changes on the given `FSWatcher`. ...", "line": 1403, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1403", "name": "close", "path": "fs.FSWatcher.close" }, { "id": "fs.FSWatcher@change", "type": "event", "signatures": [ { "args": [ { "name": "event", "types": [ "String" ] }, { "name": "filename", "types": [ "String" ] } ] } ], "arguments": [ { "name": "event", "types": [ "String" ], "description": "The event that occured, either `'rename'` or '`change'`" }, { "name": "filename", "types": [ "String" ], "description": "The name of the file which triggered the event" } ], "description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]].", "short_description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]].", "ellipsis_description": "Emitted when something changes in a watched directory or file. See more details\nin [[fs.watch `fs.watch()`]]. ...", "line": 1417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher@change", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1417", "name": "change", "path": "fs.FSWatcher.event.change" }, { "id": "fs.FSWatcher@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception that was caught" } ], "description": "Emitted when an error occurs.", "short_description": "Emitted when an error occurs.", "ellipsis_description": "Emitted when an error occurs. ...", "line": 1427, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1427", "name": "error", "path": "fs.FSWatcher.event.error" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.FSWatcher", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1393", "name": "FSWatcher", "path": "fs.FSWatcher" }, { "id": "fs.ReadStream", "type": "class", "superclass": "fs", "description": "This is a [[streams.ReadableStream streams.ReadableStream]], created from the\nfunction [[fs.createReadStream `fs.createReadStream()`]].", "short_description": "This is a [[streams.ReadableStream streams.ReadableStream]], created from the\nfunction [[fs.createReadStream `fs.createReadStream()`]].", "ellipsis_description": "This is a [[streams.ReadableStream streams.ReadableStream]], created from the\nfunction [[fs.createReadStream `fs.cre...", "line": 1368, "aliases": [], "children": [ { "id": "fs.ReadStream@open", "type": "event", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor used by the `ReadStream`" } ], "description": "Emitted when a file is opened.", "short_description": "Emitted when a file is opened.", "ellipsis_description": "Emitted when a file is opened. ...", "line": 1380, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.ReadStream@open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1380", "name": "open", "path": "fs.ReadStream.event.open" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.ReadStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1368", "name": "ReadStream", "path": "fs.ReadStream" }, { "id": "fs.Stats", "type": "class", "superclass": "fs", "description": "Objects returned from [[fs.stat `fs.stat()`]], [[fs.lstat `fs.lstat()`]], and\n[[fs.fstat `fs.fstat()`]] (and their synchronous counterparts) are of this type.\nThe object contains the following methods:\n\nFor a regular file, `util.inspect(fs.Stats)` returns an object similar to [the\nstructure returned by the Unix stat\ncommand](http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html):\n\n { dev: 2114,\n ino: 48064969,\n mode: 33188,\n nlink: 1,\n uid: 85,\n gid: 100,\n rdev: 0,\n size: 527,\n blksize: 4096,\n blocks: 8,\n atime: Mon, 10 Oct 2011 23:24:11 GMT,\n mtime: Mon, 10 Oct 2011 23:24:11 GMT,\n ctime: Mon, 10 Oct 2011 23:24:11 GMT }\n\n\nPlease note that `atime`, `mtime`, and `ctime` are instances of the [[Date]]\nobject, and to compare the values of these objects you should use appropriate\nmethods. For most general uses, `Date.getTime()` returns the number of\nmilliseconds elapsed since _1 January 1970 00:00:00 UTC_, and this integer\nshould be sufficient for any comparison. However, there are additional methods\nwhich can be used for displaying fuzzy information.", "short_description": "Objects returned from [[fs.stat `fs.stat()`]], [[fs.lstat `fs.lstat()`]], and\n[[fs.fstat `fs.fstat()`]] (and their synchronous counterparts) are of this type.\nThe object contains the following methods:\n", "ellipsis_description": "Objects returned from [[fs.stat `fs.stat()`]], [[fs.lstat `fs.lstat()`]], and\n[[fs.fstat `fs.fstat()`]] (and their s...", "line": 1262, "aliases": [], "children": [ { "id": "fs.Stats.isBlockDevice", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices).", "short_description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices).", "ellipsis_description": "Indicates if the object is a [block\ndevice](http://en.wikipedia.org/wiki/Device_file#Block_devices). ...", "line": 1289, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isBlockDevice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1289", "name": "isBlockDevice", "path": "fs.Stats.isBlockDevice" }, { "id": "fs.Stats.isCharacterDevice", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices).", "short_description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices).", "ellipsis_description": "Indicates if the object is a [character\ndevice](http://en.wikipedia.org/wiki/Device_file#Character_devices). ...", "line": 1298, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isCharacterDevice", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1298", "name": "isCharacterDevice", "path": "fs.Stats.isCharacterDevice" }, { "id": "fs.Stats.isDirectory", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a directory.", "short_description": "Indicates if the object is a directory.", "ellipsis_description": "Indicates if the object is a directory. ...", "line": 1280, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isDirectory", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1280", "name": "isDirectory", "path": "fs.Stats.isDirectory" }, { "id": "fs.Stats.isFIFO", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe).", "short_description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe).", "ellipsis_description": "Indicates if the object is a [named\npipe](http://en.wikipedia.org/wiki/Named_pipe). ...", "line": 1316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isFIFO", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1316", "name": "isFIFO", "path": "fs.Stats.isFIFO" }, { "id": "fs.Stats.isFile", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a file.", "short_description": "Indicates if the object is a file.", "ellipsis_description": "Indicates if the object is a file. ...", "line": 1272, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isFile", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1272", "name": "isFile", "path": "fs.Stats.isFile" }, { "id": "fs.Stats.isSocket", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket).", "short_description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket).", "ellipsis_description": "Indicates if the object is a [socket\nfile](http://en.wikipedia.org/wiki/Unix_file_types#Socket). ...", "line": 1326, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isSocket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1326", "name": "isSocket", "path": "fs.Stats.isSocket" }, { "id": "fs.Stats.isSymbolicLink", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Boolean" } ] } ], "description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`.", "short_description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`.", "ellipsis_description": "Indicates if the object is a symbolic link; this is only valid with `fs.lstat()`\nand `fs.lstatSynch()`. ...", "line": 1307, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats.isSymbolicLink", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1307", "name": "isSymbolicLink", "path": "fs.Stats.isSymbolicLink" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.Stats", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1262", "name": "Stats", "path": "fs.Stats" }, { "id": "fs.WriteStream", "type": "class", "superclass": "fs", "description": "This is a [[streams.WritableStream WriteStream]], created from the function\n[[fs.createWriteStream `fs.createWriteStream()`]].", "short_description": "This is a [[streams.WritableStream WriteStream]], created from the function\n[[fs.createWriteStream `fs.createWriteStream()`]].", "ellipsis_description": "This is a [[streams.WritableStream WriteStream]], created from the function\n[[fs.createWriteStream `fs.createWriteSt...", "line": 1337, "aliases": [], "children": [ { "id": "fs.WriteStream.bytesWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing.", "short_description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing.", "ellipsis_description": "The number of bytes written so far. This doesn't include data that is still\nqueued for writing. ...", "line": 1357, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream.bytesWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1357", "name": "bytesWritten", "path": "fs.WriteStream.bytesWritten" }, { "id": "fs.WriteStream@open", "type": "event", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor used by the `WriteStream`" } ], "description": "Emitted when a file is opened for writing.", "short_description": "Emitted when a file is opened for writing.", "ellipsis_description": "Emitted when a file is opened for writing. ...", "line": 1349, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream@open", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1349", "name": "open", "path": "fs.WriteStream.event.open" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/fs.markdown", "fileName": "fs", "resultingFile": "fs.html#fs.WriteStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/fs.markdown#L1337", "name": "WriteStream", "path": "fs.WriteStream" }, { "id": "http", "type": "class", "description": "\nThe HTTP interfaces in Node.js are designed to support many features of the\nprotocol which have been traditionally difficult to use. In particular, large,\npossibly chunk-encoded, messages. The interface is careful to never buffer\nentire requests or responses—the user is always able to stream data. To use the\nHTTP server and client, add `require('http')` to your code.\n\nHTTP message headers are represented by an object like this:\n\n { 'content-length': '123',\n 'content-type': 'text/plain',\n 'connection': 'keep-alive',\n 'accept': 'text/plain' }\n\nKeys are lowercased, and values are not modifiable.\n\nIn order to support the full spectrum of possible HTTP applications, Node's HTTP\nAPI is very low-level. It deals with stream handling and message parsing only.\nIt parses a message into headers and body but it does not parse the actual\nheaders or the body.\n\n\nFor more information, read [this article on how to create HTTP\nservers](../nodejs_dev_guide/creating_an_http_server.html).\n\n#### Example: The famous hello world\n\n", "stability": "3 - Stable", "short_description": "\nThe HTTP interfaces in Node.js are designed to support many features of the\nprotocol which have been traditionally difficult to use. In particular, large,\npossibly chunk-encoded, messages. The interface is careful to never buffer\nentire requests or responses—the user is always able to stream data. To use the\nHTTP server and client, add `require('http')` to your code.\n", "ellipsis_description": "\nThe HTTP interfaces in Node.js are designed to support many features of the\nprotocol which have been traditionally ...", "line": 39, "aliases": [], "children": [ { "id": "http.createClient", "type": "class method", "signatures": [ { "args": [ { "name": "port", "optional": true, "types": [ "Number" ] }, { "name": "host", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to", "optional": true }, { "name": "host", "types": [ "String" ], "description": "The hostname to listen to (deprecated)", "optional": true } ], "description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n\nConstructs a new HTTP client. `port` and `host` refer to the server to be\nconnected to.", "short_description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n", "ellipsis_description": "This function is **deprecated**; please use\n[[http.request http.request()]] instead.\n ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.createClient", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L92", "name": "createClient", "path": "http.createClient" }, { "id": "http.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientRequest" ] }, { "name": "response", "type": [ "http.ClientResponse" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientRequest" ] }, { "name": "response", "type": [ "http.ClientResponse" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "http.Server" } ] } ], "arguments": [ { "name": "function", "types": [ "Function" ], "description": "A callback that is automatically added to the `'request'` event" }, { "name": "request", "types": [ "http.ClientRequest" ], "description": "Any options you want to pass to the server" }, { "name": "response", "types": [ "http.ClientResponse" ], "description": "An optional listener" } ], "description": "Returns a new web server object.", "short_description": "Returns a new web server object.", "ellipsis_description": "Returns a new web server object. ...", "line": 78, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L78", "name": "createServer", "path": "http.createServer" }, { "id": "http.get", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" } ], "description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n\n#### Example\n\n var options = {\n host: 'www.google.com',\n port: 80,\n path: '/index.html'\n };\n\n http.get(options, function(res) {\n console.log(\"Got response: \" + res.statusCode);\n }).on('error', function(e) {\n console.log(\"Got error: \" + e.message);\n });", "short_description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n", "ellipsis_description": "Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference b...", "line": 68, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.get", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L68", "name": "get", "path": "http.get" }, { "id": "http.globalAgent", "type": "class property", "signatures": [ { "returns": [ { "type": "http.Agent" } ] } ], "description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests.", "short_description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests.", "ellipsis_description": "This is the global instance of [[http.Agent `http.Agent`]] which is used as the\ndefault for all HTTP client requests. ...", "line": 103, "aliases": [], "children": [ { "id": "http.globalAgent.requests", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "short_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!**", "ellipsis_description": "An object which contains queues of requests that have not yet been assigned to\nsockets. **Don't modify this!** ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent.requests", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L114", "name": "requests", "path": "http.globalAgent.requests" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.globalAgent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L103", "name": "globalAgent", "path": "http.globalAgent" }, { "id": "http.request", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "response", "type": [ "http.ClientRequest" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "response", "type": [ "http.ClientRequest" ] } ], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "http.ClientRequest" } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" }, { "name": "response", "types": [ "http.ClientRequest" ], "description": "The server's response, including headers and status code" } ], "description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently issue requests.\n\nThe `options` align with the return value of [[url.parse `url.parse()`]]:\n\n- `host`: a domain name or IP address of the server to issue the request to.\nDefaults to `'localhost'`.\n- `hostname`: To support `url.parse()`, `hostname` is preferred over `host`\n- `port`: the port of the remote server. Defaults to `80`.\n- `socketPath`: the Unix Domain Socket (in other words, use either `host:port`\nor `socketPath`)\n- `method`: a string specifying the HTTP request method. Defaults to `'GET'`.\n- `path`: the request path. Defaults to `'/'`. This should include a query\nstring (if any) For example, `'/index.html?page=12'`\n- `headers`: an object containing request headers\n- `auth`: used for basic authentication. For example, `'user:password'` computes\nan Authorization header.\n- `agent`: this controls [[http.Agent `http.Agent`]] behavior. When an Agent is\nused, the request defaults to `Connection: keep-alive`. The possible values are:\n -- `undefined`: uses [[http.globalAgent the global agent]] for this host\n and port (default).\n -- `Agent` object: explicitly use the passed in `Agent`\n -- `false`: opt out of connection pooling with an `Agent`, and default the\nrequest to `Connection: close`.\n\nThere are a few special headers that should be noted.\n\n* Sending a `'Connection: keep-alive'` notifies Node.js that the connection to\nthe server should be persisted until the next request.\n\n* Sending a `'Content-length'` header disables the default chunked encoding.\n\n* Sending an 'Expect' header immediately sends the request headers.\n Usually, when sending `'Expect: 100-continue'`, you should both set a timeout\n and listen for the `continue` event. For more information, see [RFC2616\nSection 8.2.3](http://tools.ietf.org/html/rfc2616#section-8.2.3).\n\n* Sending an Authorization header overrides using the `auth` option to compute\nbasic authentication.\n\n#### Example\n\n var options = {\n host: 'www.google.com',\n port: 80,\n path: '/upload',\n method: 'POST'\n };\n\n var req = http.request(options, function(res) {\n console.log('STATUS: ' + res.statusCode);\n console.log('HEADERS: ' + JSON.stringify(res.headers));\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n });\n\n req.on('error', function(e) {\n console.log('problem with request: ' + e.message);\n });\n\n // write data to request body\n req.write('data\\n');\n req.write('data\\n');\n req.end();\n\nNote that in the example, `req.end()` was called. With `http.request()` one must\nalways call `req.end()` to signify that you're done with the request—even if\nthere is no data being written to the request body.\n\n#### Returns\n\nAn instance of the `http.ClientRequest` class. The `ClientRequest` instance is a\nwritable stream. If one needs to upload a file with a POST request, then write\nit to the `ClientRequest` object.\n\nIf any error is encountered during the request (be that with DNS resolution, TCP\nlevel errors, or actual HTTP parse errors) an `'error'` event is emitted on the\nreturned request object.", "short_description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently issue requests.\n", "ellipsis_description": "Node.js maintains several connections per server to make HTTP requests. This\nfunction allows one to transparently is...", "line": 208, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L208", "name": "request", "path": "http.request" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http", "subclasses": [ "http.Agent", "http.Server", "http.ServerRequest", "http.ServerResponse", "http.ClientRequest", "http.ClientResponse" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L39", "name": "http", "path": "http" }, { "id": "http.Agent", "type": "class", "superclass": "http", "description": "Starting with Node.js version 0.5.3, there's a new implementation of the HTTP\nAgent which is used for pooling sockets used in HTTP client requests.\n\nPreviously, a single agent instance help the pool for single host+port. The\ncurrent implementation now holds sockets for any number of hosts.\n\nThe current HTTP Agent also defaults client requests to using\n`Connection:keep-alive`. If no pending HTTP requests are waiting on a socket to\nbecome free ,the socket is closed. This means that Node's pool has the benefit\nof keep-alive when under load but still does not require developers to manually\nclose the HTTP clients using keep-alive.\n\nSockets are removed from the agent's pool when the socket emits either a\n`'close'` event or a special `'agentRemove'` event. This means that if you\nintend to keep one HTTP request open for a long time and don't want it to stay\nin the pool you can do something along the lines of:\n\n http.get(options, function(res) {\n // Do stuff\n }).on(\"socket\", function (socket) {\n socket.emit(\"agentRemove\");\n });\n\nAlternatively, you could just opt out of pooling entirely using `agent:false`:\n\n\n http.get({host:'localhost', port:80, path:'/', agent:false}, function (res)\n{\n // Do stuff\n });", "short_description": "Starting with Node.js version 0.5.3, there's a new implementation of the HTTP\nAgent which is used for pooling sockets used in HTTP client requests.\n", "ellipsis_description": "Starting with Node.js version 0.5.3, there's a new implementation of the HTTP\nAgent which is used for pooling socket...", "line": 249, "aliases": [], "children": [ { "id": "http.Agent.maxSockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "short_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "ellipsis_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5. ...", "line": 260, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent.maxSockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L260", "name": "maxSockets", "path": "http.Agent.maxSockets" }, { "id": "http.Agent.sockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "short_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "ellipsis_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!** ...", "line": 270, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent.sockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L270", "name": "sockets", "path": "http.Agent.sockets" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Agent", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L249", "name": "Agent", "path": "http.Agent" }, { "id": "http.ClientRequest", "type": "class", "superclass": "http", "description": "This object is created internally and returned from [[http.request\n`http.request()`]]. It represents an _in-progress_ request whose header has\nalready been queued. The header is still mutable using the `setHeader(name,\nvalue)`, `getHeader(name)`, and `removeHeader(name)` methods. The actual header\nwill be sent along with the first data chunk or when closing the connection.\nThis is both a [[streams.WritableStream `Writable Stream`]] and an\n[[eventemitter `EventEmitter`]].\n\nTo get the response, add a listener for `'response'` to the request object.\n`'response'` will be emitted from the request object when the response headers\nhave been received. The `'response'` event is executed with one argument which\nis an instance of `http.ClientResponse`.\n\nNote: Node.js does not check whether `Content-Length`and the length of the body which has been transmitted are equal or not.\n\nDuring the `'response'` event, one can add listeners to the response object,\nparticularly to listen for the `'data'` event. Note that the `'response'` event\nis called before any part of the response body is received, so there is no need\nto worry about racing to catch the first part of the body. As long as a listener\nfor `'data'` is added during the `'response'` event, the entire body will be\ncaught.\n\n#### Example\n\n // Good\n request.on('response', function (response) {\n response.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n });\n\n // Bad - misses all or part of the body\n request.on('response', function (response) {\n setTimeout(function () {\n response.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n }, 10);\n });", "short_description": "This object is created internally and returned from [[http.request\n`http.request()`]]. It represents an _in-progress_ request whose header has\nalready been queued. The header is still mutable using the `setHeader(name,\nvalue)`, `getHeader(name)`, and `removeHeader(name)` methods. The actual header\nwill be sent along with the first data chunk or when closing the connection.\nThis is both a [[streams.WritableStream `Writable Stream`]] and an\n[[eventemitter `EventEmitter`]].\n", "ellipsis_description": "This object is created internally and returned from [[http.request\n`http.request()`]]. It represents an _in-progres...", "line": 836, "aliases": [], "children": [ { "id": "http.ClientRequest.abort", "type": "class method", "signatures": [ { "args": [] } ], "description": "Aborts a request, since NOde.js version 0.3.8.", "short_description": "Aborts a request, since NOde.js version 0.3.8.", "ellipsis_description": "Aborts a request, since NOde.js version 0.3.8. ...", "line": 938, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.abort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L938", "name": "abort", "path": "http.ClientRequest.abort" }, { "id": "http.ClientRequest.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to send at the end", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use for the data", "optional": true } ], "description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request is chunked, this will send the terminating\n`'0\\r\\n\\r\\n'`.\n\nIf `data` is specified, it is equivalent to calling `request.write(data,\nencoding)` followed by `request.end()`.", "short_description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request is chunked, this will send the terminating\n`'0\\r\\n\\r\\n'`.\n", "ellipsis_description": "Finishes sending the request. If any parts of the body are unsent, it will flush\nthem to the stream. If the request ...", "line": 927, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L927", "name": "end", "path": "http.ClientRequest.end" }, { "id": "http.ClientRequest.setNoDelay", "type": "class method", "signatures": [ { "args": [ { "name": "noDelay", "default_value": true, "optional": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "noDelay", "types": [ "Boolean" ], "description": "If `true`, then the data is fired off immediately each time the socket is written", "optional": true } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setNoDelay `net.Socket.setNoDelay()`]] is c...", "line": 963, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setNoDelay", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L963", "name": "setNoDelay", "path": "http.ClientRequest.setNoDelay" }, { "id": "http.ClientRequest.setSocketKeepAlive", "type": "class method", "signatures": [ { "args": [ { "name": "enable", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "initialDelay", "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "enable", "types": [ "Boolean" ], "description": "If `true`, then keep-alive funcitonality is set", "optional": true }, { "name": "initalDelay", "types": [ "Number" ], "description": "Sets the initial delay before the first keep-alive probe is sent on an idle socket" } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setKeepAlive `net.Socket.setKeepAlive()`]] ...", "line": 977, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setSocketKeepAlive", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L977", "name": "setSocketKeepAlive", "path": "http.ClientRequest.setSocketKeepAlive" }, { "id": "http.ClientRequest.setTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeout", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "timeout", "types": [ "Number" ], "description": "The timeout length, in milliseconds" }, { "name": "callback", "types": [ "Function" ], "description": "An optional function to execute once the timeout completes", "optional": true } ], "description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is called.", "short_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is called.", "ellipsis_description": "Once a socket is assigned to this request and is connected,\n[[net.Socket.setTimeout `net.Socket.setTimeout()`]] is c...", "line": 951, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.setTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L951", "name": "setTimeout", "path": "http.ClientRequest.setTimeout" }, { "id": "http.ClientRequest.write", "type": "class method", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Array" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Array" ], "description": "An array of integers or a string to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding of the chunk (only needed if it's a string)", "optional": true } ], "description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in that case, it's suggested you use the\n`['Transfer-Encoding', 'chunked']` header line when creating the request.", "short_description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in that case, it's suggested you use the\n`['Transfer-Encoding', 'chunked']` header line when creating the request.", "ellipsis_description": "Sends a chunk of the body. By calling this method many times, the user can\nstream a request body to a server—in tha...", "line": 910, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L910", "name": "write", "path": "http.ClientRequest.write" }, { "id": "http.ClientRequest@continue", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-continue'`. This is an instruction that the\nclient should send the request body.", "short_description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-continue'`. This is an instruction that the\nclient should send the request body.", "ellipsis_description": "Emitted when the server sends a `'100 Continue'` HTTP response, usually because\nthe request contained `'Expect: 100-...", "line": 895, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@continue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L895", "name": "continue", "path": "http.ClientRequest.event.continue" }, { "id": "http.ClientRequest@response", "type": "event", "signatures": [ { "args": [ { "name": "response", "types": [ "http.ClientResponse" ] } ] } ], "arguments": [ { "name": "response", "types": [ "http.ClientResponse" ], "description": "An instance of `http.ClientResponse`" } ], "description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n\nOptions include:\n\n- host: a domain name or IP address of the server to issue the request to\n- port: the port of remote server\n- socketPath: Unix Domain Socket (use either `host:port` or `socketPath`)", "short_description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n", "ellipsis_description": "Emitted when a response is received to this request. This event is emitted only\nonce.\n ...", "line": 854, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@response", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L854", "name": "response", "path": "http.ClientRequest.event.response" }, { "id": "http.ClientRequest@socket", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "The assigned socket" } ], "description": "Emitted after a socket is assigned to this request.", "short_description": "Emitted after a socket is assigned to this request.", "ellipsis_description": "Emitted after a socket is assigned to this request. ...", "line": 865, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@socket", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L865", "name": "socket", "path": "http.ClientRequest.event.socket" }, { "id": "http.ClientRequest@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "response", "types": [ "http.ClientResponse" ] }, { "name": "socket", "types": [ "net.Socket" ] }, { "name": "head", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "response", "types": [ "http.ClientResponse" ], "description": "The client's response" }, { "name": "socket", "types": [ "net.Socket" ], "description": "The assigned socket" }, { "name": "head", "types": [ "Object" ], "description": "The upgrade header" } ], "description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients receiving an upgrade header will have their\nconnections closed.\n\n#### Example\n\n", "short_description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients receiving an upgrade header will have their\nconnections closed.\n", "ellipsis_description": "Emitted each time a server responds to a request with an upgrade. If this event\nisn't being listened for, clients re...", "line": 883, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L883", "name": "upgrade", "path": "http.ClientRequest.event.upgrade" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientRequest", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L836", "name": "ClientRequest", "path": "http.ClientRequest" }, { "id": "http.ClientResponse", "type": "class", "superclass": "http", "description": "This object is created when making a request with [[http.request\n`http.request()`]]. It is passed to the `'response'` event of the request\nobject.\n\nThe response implements the [[streams.ReadableStream `Readable Stream`]]\ninterface.", "short_description": "This object is created when making a request with [[http.request\n`http.request()`]]. It is passed to the `'response'` event of the request\nobject.\n", "ellipsis_description": "This object is created when making a request with [[http.request\n`http.request()`]]. It is passed to the `'response'...", "line": 991, "aliases": [], "children": [ { "id": "http.ClientResponse.header", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The response headers object.", "short_description": "The response headers object.", "ellipsis_description": "The response headers object. ...", "line": 1058, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.header", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1058", "name": "header", "path": "http.ClientResponse.header" }, { "id": "http.ClientResponse.httpVersion", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the first integer and `response.httpVersionMinor`\nis the second.", "short_description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the first integer and `response.httpVersionMinor`\nis the second.", "ellipsis_description": "The HTTP version of the connected-to server. Usually either `'1.1'` or `'1.0'`.\n`response.httpVersionMajor` is the f...", "line": 1049, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.httpVersion", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1049", "name": "httpVersion", "path": "http.ClientResponse.httpVersion" }, { "id": "http.ClientResponse.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the response from emitting events. Useful to throttle back a download.", "short_description": "Pauses the response from emitting events. Useful to throttle back a download.", "ellipsis_description": "Pauses the response from emitting events. Useful to throttle back a download. ...", "line": 1090, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1090", "name": "pause", "path": "http.ClientResponse.pause" }, { "id": "http.ClientResponse.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes a paused response.", "short_description": "Resumes a paused response.", "ellipsis_description": "Resumes a paused response. ...", "line": 1097, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1097", "name": "resume", "path": "http.ClientResponse.resume" }, { "id": "http.ClientResponse.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use. Defaults to `null`, which means that the `'data'` event will emit a `Buffer` object.", "optional": true } ], "description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`.", "short_description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`.", "ellipsis_description": "Set the encoding for the response body, either `'utf8'`, `'ascii'`, or\n`'base64'`. ...", "line": 1081, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1081", "name": "setEncoding", "path": "http.ClientResponse.setEncoding" }, { "id": "http.ClientResponse.statusCode", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c.", "short_description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c.", "ellipsis_description": "The 3-digit HTTP response status code, like `200`, `404`, e.t.c. ...", "line": 1037, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.statusCode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1037", "name": "statusCode", "path": "http.ClientResponse.statusCode" }, { "id": "http.ClientResponse.trailers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The response trailers object. Only populated after the `end` event.", "short_description": "The response trailers object. Only populated after the `end` event.", "ellipsis_description": "The response trailers object. Only populated after the `end` event. ...", "line": 1068, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse.trailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1068", "name": "trailers", "path": "http.ClientResponse.trailers" }, { "id": "http.ClientResponse@close", "type": "event", "signatures": [ { "args": [ { "name": "err", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "err", "types": [ "Error" ], "description": "The error object" } ], "description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n\nFor more information, see [[http.ServerRequest]]'s `'close'` event.", "short_description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n", "ellipsis_description": "Indicates that the underlaying connection was terminated before the `end` event\nwas emitted.\n ...", "line": 1027, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1027", "name": "close", "path": "http.ClientResponse.event.close" }, { "id": "http.ClientResponse@data", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Buffer" ], "description": "The data received" } ], "description": "Emitted when a piece of the message body is received.", "short_description": "Emitted when a piece of the message body is received.", "ellipsis_description": "Emitted when a piece of the message body is received. ...", "line": 1002, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1002", "name": "data", "path": "http.ClientResponse.event.data" }, { "id": "http.ClientResponse@end", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "Buffer" ], "description": "The data received" } ], "description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response.", "short_description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response.", "ellipsis_description": "Emitted exactly once for each message. After it's emitted, no other events are\nemitted on the response. ...", "line": 1014, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L1014", "name": "end", "path": "http.ClientResponse.event.end" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ClientResponse", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L991", "name": "ClientResponse", "path": "http.ClientResponse" }, { "id": "http.Server", "type": "class", "superclass": "http", "description": "A representation of the server within the `http` module. To create an HTTP\nserver, you'll need to first call [[http.createServer `http.createServer()`]],\nwith something like this:\n\n\n\nThis object is also an [[eventemitter `eventemitter`]].\n\nFor more information, read [this article on how to create HTTP\nservers](../nodejs_dev_guide/creating_an_http_server.html).", "short_description": "A representation of the server within the `http` module. To create an HTTP\nserver, you'll need to first call [[http.createServer `http.createServer()`]],\nwith something like this:\n", "ellipsis_description": "A representation of the server within the `http` module. To create an HTTP\nserver, you'll need to first call [[http....", "line": 287, "aliases": [], "children": [ { "id": "http.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Server.close)\n\nStops the server from accepting new connections.", "short_description": "(related to: net.Server.close)\n", "ellipsis_description": "(related to: net.Server.close)\n ...", "line": 406, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L406", "name": "close", "path": "http.Server.close" }, { "id": "http.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to" }, { "name": "hostname", "types": [ "String" ], "description": "The hostname to listen to" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the server has been bound to the port (related to: net.Server.listen)" } ], "description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n\nThis function is asynchronous. The `callback()` is added as a listener for the\n[[net.Server@listening `net.Server@listening`]] event.", "short_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n", "ellipsis_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts conne...", "line": 394, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L394", "name": "listen", "path": "http.Server.listen" }, { "id": "http.Server@checkContinue", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of `http.ServerRequest`" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of `http.ServerResponse`" } ], "description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n\nHandling this event involves calling `response.writeContinue` if the client\nshould continue to send the request body, or generating an appropriate HTTP\nresponse (_e.g._ `400 Bad Request`) if the client should not continue to send\nthe request body.\n\nNote: When this event is emitted and handled, the `request` event is not be emitted.", "short_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n", "ellipsis_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the s...", "line": 342, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@checkContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L342", "name": "checkContinue", "path": "http.Server.event.checkContinue" }, { "id": "http.Server@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception being thrown" } ], "description": "If a client connection emits an `'error'` event, it's forwarded here.", "short_description": "If a client connection emits an `'error'` event, it's forwarded here.", "ellipsis_description": "If a client connection emits an `'error'` event, it's forwarded here. ...", "line": 372, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L372", "name": "clientError", "path": "http.Server.event.clientError" }, { "id": "http.Server@close", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 321, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L321", "name": "close", "path": "http.Server.event.close" }, { "id": "http.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "short_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "ellipsis_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also b...", "line": 311, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L311", "name": "connection", "path": "http.Server.event.connection" }, { "id": "http.Server@request", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of [[http.ServerRequest]]" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of [[http.ServerResponse]]" } ], "description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "short_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "ellipsis_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple reques...", "line": 298, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L298", "name": "request", "path": "http.Server.event.request" }, { "id": "http.Server@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "socket", "types": [ "Number" ] }, { "name": "head", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "The arguments for the http request, as it is in the request event" }, { "name": "socket", "types": [ "Number" ], "description": "The network socket between the server and client" }, { "name": "head", "types": [ "Buffer" ], "description": "The first packet of the upgraded stream; this can be empty" } ], "description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n\nAfter this event is emitted, the request's socket won't have a `data` event\nlistener, meaning you will need to bind to it in order to handle data sent to\nthe server on that socket.", "short_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n", "ellipsis_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upg...", "line": 361, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L361", "name": "upgrade", "path": "http.Server.event.upgrade" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L287", "name": "Server", "path": "http.Server" }, { "id": "http.ServerRequest", "type": "class", "superclass": "http", "description": "This object is created internally by an HTTP server—not by the user—and passed\nas the first argument to a `'request'` listener.\n\nThe request implements the [[streams.ReadableStream Readable Stream]] interface;\nit is also an [[eventemitter `eventemitter`]] with the following events:", "short_description": "This object is created internally by an HTTP server—not by the user—and passed\nas the first argument to a `'request'` listener.\n", "ellipsis_description": "This object is created internally by an HTTP server—not by the user—and passed\nas the first argument to a `'request'...", "line": 420, "aliases": [], "children": [ { "id": "http.ServerRequest.connection", "type": "class property", "signatures": [ { "returns": [ { "type": "net.Socket" } ] } ], "description": "The `net.Socket` object associated with the connection.\n\nWith HTTPS support, use `request.connection.verifyPeer()` and\n`request.connection.getPeerCertificate()` to obtain the client's authentication\ndetails.", "short_description": "The `net.Socket` object associated with the connection.\n", "ellipsis_description": "The `net.Socket` object associated with the connection.\n ...", "line": 587, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L587", "name": "connection", "path": "http.ServerRequest.connection" }, { "id": "http.ServerRequest.headers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Returns the request header.\n\n\n\n\nread-only", "short_description": "Returns the request header.\n", "ellipsis_description": "Returns the request header.\n ...", "line": 516, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.headers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L516", "name": "headers", "path": "http.ServerRequest.headers" }, { "id": "http.ServerRequest.httpVersion", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first integer and `request.httpVersionMinor`\nis the second.", "short_description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first integer and `request.httpVersionMinor`\nis the second.", "ellipsis_description": "The HTTP protocol version as a string; for example: `'1.1'`, `'1.0'`.\n`request.httpVersionMajor` is the first intege...", "line": 540, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.httpVersion", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L540", "name": "httpVersion", "path": "http.ServerRequest.httpVersion" }, { "id": "http.ServerRequest.method", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The request method as a string, like `'GET'` or `'DELETE'`.", "short_description": "The request method as a string, like `'GET'` or `'DELETE'`.", "ellipsis_description": "The request method as a string, like `'GET'` or `'DELETE'`. ...", "line": 474, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.method", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L474", "name": "method", "path": "http.ServerRequest.method" }, { "id": "http.ServerRequest.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses request from emitting events. Useful to throttle back an upload.", "short_description": "Pauses request from emitting events. Useful to throttle back an upload.", "ellipsis_description": "Pauses request from emitting events. Useful to throttle back an upload. ...", "line": 562, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L562", "name": "pause", "path": "http.ServerRequest.pause" }, { "id": "http.ServerRequest.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes a paused request.", "short_description": "Resumes a paused request.", "ellipsis_description": "Resumes a paused request. ...", "line": 572, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L572", "name": "resume", "path": "http.ServerRequest.resume" }, { "id": "http.ServerRequest.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use, either `'utf8'` or `'binary'`", "optional": true } ], "description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object.", "short_description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object.", "ellipsis_description": "Set the encoding for the request body. Defaults to `null`, which means that the\n`'data'` event emits a `Buffer` object. ...", "line": 553, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L553", "name": "setEncoding", "path": "http.ServerRequest.setEncoding" }, { "id": "http.ServerRequest.trailers", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n\n\n\n\nread-only", "short_description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n", "ellipsis_description": "Contains the HTTP trailers (if present). Only populated after the `'end'` event.\n ...", "line": 527, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.trailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L527", "name": "trailers", "path": "http.ServerRequest.trailers" }, { "id": "http.ServerRequest.url", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the request is:\n\n GET /status?name=ryan HTTP/1.1\\r\\n\n Accept: text/plain\\r\\n\n \\r\\n\n\nThen `request.url` becomes:\n\n '/status?name=ryan'\n\n#### Example\n\nIf you would like to parse the URL into its parts, you can use\n`require('url').parse(request.url)`. For example:\n\n\n\nIf you would like to extract the params from the query string, you can use\n[[querystring.parse `require('querystring').parse()`]], or pass `true` as the\nsecond argument to `require('url').parse`. For example:\n\n\n\n\nread-only", "short_description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the request is:\n", "ellipsis_description": "Request URL string. This contains only the URL that is present in the actual\nHTTP request. Fo example, if the reques...", "line": 505, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest.url", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L505", "name": "url", "path": "http.ServerRequest.url" }, { "id": "http.ServerRequest@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n\nJust like `'end'`, this event occurs only once per request, and no more `'data'`\nevents will fire afterwards.\n\nNote: `'close'` can fire after `'end'`, but not vice versa.\n\n\nread-only", "short_description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n", "ellipsis_description": "Indicates that the underlaying connection was terminated before `response.end()`\nwas called or able to flush.\n ...", "line": 463, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L463", "name": "close", "path": "http.ServerRequest.event.close" }, { "id": "http.ServerRequest@data", "type": "event", "signatures": [ { "args": [ { "name": "chunk", "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "String" ], "description": "The data that's received (as a string)" } ], "description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http.ServerRequest.setEncoding\n`request.setEncoding()`]], otherwise it's a [Buffer](buffer.html).\n\nNote that the **data will be lost** if there is no listener when a\n`ServerRequest` emits a `'data'` event.", "short_description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http.ServerRequest.setEncoding\n`request.setEncoding()`]], otherwise it's a [Buffer](buffer.html).\n", "ellipsis_description": "Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with [[http....", "line": 436, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L436", "name": "data", "path": "http.ServerRequest.event.data" }, { "id": "http.ServerRequest@end", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request.", "short_description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request.", "ellipsis_description": "Emitted exactly once for each request. After that, no more `'data'` events are\nemitted on the request. ...", "line": 448, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L448", "name": "end", "path": "http.ServerRequest.event.end" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerRequest", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L420", "name": "ServerRequest", "path": "http.ServerRequest" }, { "id": "http.ServerResponse", "type": "class", "superclass": "http", "description": "This object is created internally by a HTTP server—not by the user. It is passed\nas the second parameter to the `'request'` event. It is a\n[[streams.WritableStream `Writable Stream`]].", "short_description": "This object is created internally by a HTTP server—not by the user. It is passed\nas the second parameter to the `'request'` event. It is a\n[[streams.WritableStream `Writable Stream`]].", "ellipsis_description": "This object is created internally by a HTTP server—not by the user. It is passed\nas the second parameter to the `'re...", "line": 599, "aliases": [], "children": [ { "id": "http.ServerResponse.addTrailers", "type": "class method", "signatures": [ { "args": [ { "name": "headers", "types": [ "String" ] } ] } ], "arguments": [ { "name": "headers", "types": [ "String" ], "description": "The trailing header to add" } ], "description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n\nTrailers are only emitted if chunked encoding is used for the response; if it is\nnot (_e.g._ if the request was `'HTTP/1.0'`), they are silently discarded.\n\n#### Example\n\nHTTP requires the `Trailer` header to be sent if you intend to emit trailers,\nwith a list of the header fields in its value. For example:\n\n response.writeHead(200, { 'Content-Type': 'text/plain',\n 'Trailer': 'Content-MD5' });\n response.write(fileData);\n response.addTrailers({'Content-MD5': \"7895bf4b8828b55ceaf47747b4bca667\"});\n response.end();", "short_description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n", "ellipsis_description": "This method adds HTTP trailing headers (a header, but at the end of the message)\nto the response.\n ...", "line": 768, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.addTrailers", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L768", "name": "addTrailers", "path": "http.ServerResponse.addTrailers" }, { "id": "http.ServerResponse.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "Some data to write before finishing", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding for the data", "optional": true } ], "description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consider this message complete. `response.end()`\n**must** be called on each response.\n\nIf `data` is specified, it is equivalent to calling `response.write(data,\nencoding)` followed by `response.end()`.", "short_description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consider this message complete. `response.end()`\n**must** be called on each response.\n", "ellipsis_description": "This method signals to the server that all of the response headers and body has\nbeen sent; that server should consid...", "line": 787, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L787", "name": "end", "path": "http.ServerResponse.end" }, { "id": "http.ServerResponse.getHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The name of the header to retrieve" } ], "description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. This can only be called before headers get\nimplicitly flushed.\n\n#### Example\n\n var stringContentType = response.getHeader('content-type');", "short_description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. This can only be called before headers get\nimplicitly flushed.\n", "ellipsis_description": "Reads out a header that's already been queued but not sent to the client. Note\nthat the name is case-insensitive. ...", "line": 702, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.getHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L702", "name": "getHeader", "path": "http.ServerResponse.getHeader" }, { "id": "http.ServerResponse.removeHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The header to remove" } ], "description": "Removes a header that's queued for implicit sending.\n\n#### Example\n\n response.removeHeader(\"Content-Encoding\");", "short_description": "Removes a header that's queued for implicit sending.\n", "ellipsis_description": "Removes a header that's queued for implicit sending.\n ...", "line": 717, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.removeHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L717", "name": "removeHeader", "path": "http.ServerResponse.removeHeader" }, { "id": "http.ServerResponse.setHeader", "type": "class method", "signatures": [ { "args": [ { "name": "name", "types": [ "String" ] }, { "name": "value", "types": [ "String" ] } ] } ], "arguments": [ { "name": "name", "types": [ "String" ], "description": "The name of the header to set" }, { "name": "value", "types": [ "String" ], "description": "The value to set" } ], "description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value is replaced. Use an array of strings here\nif you need to send multiple headers with the same name.\n\n#### Examples\n\n response.setHeader(\"Content-Type\", \"text/html\");\n\n response.setHeader(\"Set-Cookie\", [\"type=ninja\", \"language=javascript\"]);", "short_description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value is replaced. Use an array of strings here\nif you need to send multiple headers with the same name.\n", "ellipsis_description": "Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value ...", "line": 685, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.setHeader", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L685", "name": "setHeader", "path": "http.ServerResponse.setHeader" }, { "id": "http.ServerResponse.statusCode", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code that will be send to the client when the\nheaders get flushed; for example: `response.statusCode = 404;`.\n\nAfter the response header is sent to the client, this property indicates the\nstatus code which was sent out.", "short_description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code that will be send to the client when the\nheaders get flushed; for example: `response.statusCode = 404;`.\n", "ellipsis_description": "When using implicit headers (not calling `response.writeHead()` explicitly),\nthis property controls the status code ...", "line": 665, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.statusCode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L665", "name": "statusCode", "path": "http.ServerResponse.statusCode" }, { "id": "http.ServerResponse.write", "type": "class method", "signatures": [ { "args": [ { "name": "chunk", "types": [ "String", "Buffer" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "chunk", "types": [ "String", "Buffer" ], "description": "A string or buffer to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (if `chunk` is a string)", "optional": true } ], "description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and flush the implicit headers.\n\nThis sends a chunk of the response body. This method may be called multiple\ntimes to provide successive parts of the body.\n\nNote: This is the raw HTTP body and has nothing to do with higher-level multi-part body encodings that may be used.\n\nThe first time `response.write()` is called, it sends the buffered header\ninformation and the first body to the client. The second time `response.write()`\nis called, Node.js assumes you're going to be streaming data, and sends that\nseparately. That is, the response is buffered up to the first chunk of body.", "short_description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and flush the implicit headers.\n", "ellipsis_description": "If this method is called and `response.writeHead()` has not been called, it'll\nswitch to implicit header mode and fl...", "line": 741, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L741", "name": "write", "path": "http.ServerResponse.write" }, { "id": "http.ServerResponse.writeContinue", "type": "class method", "signatures": [ { "args": [] } ], "description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more information, see the\n[[http.Server@checkContinue `http.Server@checkContinue`]] event.", "short_description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more information, see the\n[[http.Server@checkContinue `http.Server@checkContinue`]] event.", "ellipsis_description": "Sends an `HTTP/1.1 100 Continue` message to the client, indicating that the\nrequest body should be sent. For more in...", "line": 622, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.writeContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L622", "name": "writeContinue", "path": "http.ServerResponse.writeContinue" }, { "id": "http.ServerResponse.writeHead", "type": "class method", "signatures": [ { "args": [ { "name": "statusCode", "types": [ "Number" ] }, { "name": "reasonPhrase", "optional": true, "types": [ "String" ] }, { "name": "headers", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "statusCode", "types": [ "Number" ], "description": "The 3-digit HTTP status code, like `404`" }, { "name": "reasonPhrase", "types": [ "String" ], "description": "A human-readable string describing the status", "optional": true }, { "name": "headers", "types": [ "Object" ], "description": "Any response headers", "optional": true } ], "description": "Sends a response header to the request.\n\nThis method must only be called once on a message and it must be called before\n`response.end()` is called.\n\nIf you call `response.write()` or `response.end()` before calling this, the\nimplicit/mutable headers will be calculated and call this function for you.\n\n#### Example\n\n var body = 'hello world';\n response.writeHead(200, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain' });\n\nNote: `Content-Length` is given in bytes, not characters. The above example works because the string `'hello world'` contains only single byte characters. If the body contains higher coded characters then `Buffer.byteLength()` should be used to determine the number of bytes in a given encoding. Node.js does not check whether `Content-Length` and the length of the body which has been transmitted are equal or not.", "short_description": "Sends a response header to the request.\n", "ellipsis_description": "Sends a response header to the request.\n ...", "line": 649, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse.writeHead", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L649", "name": "writeHead", "path": "http.ServerResponse.writeHead" }, { "id": "http.ServerResponse@close", "type": "event", "signatures": [ { "args": [] } ], "description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or able to flush.", "short_description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or able to flush.", "ellipsis_description": "If emitted, it it indicates that the underlaying connection was terminated\nbefore `response.end()` was called or abl...", "line": 610, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L610", "name": "close", "path": "http.ServerResponse.event.close" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/http.markdown", "fileName": "http", "resultingFile": "http.html#http.ServerResponse", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/http.markdown#L599", "name": "ServerResponse", "path": "http.ServerResponse" }, { "id": "https", "type": "class", "description": "\nHTTPS is the HTTP protocol over TLS/SSL. In Node.js, this is implemented as a\nseparate module. To use this module, include `require('https')` in your code.\n\nCreating HTTPS servers is somewhat complicated and requires generating\ncertificates.\n\n #### Examples\n\n\n\nOr, with pfx:\n\n", "stability": "3 - Stable", "short_description": "\nHTTPS is the HTTP protocol over TLS/SSL. In Node.js, this is implemented as a\nseparate module. To use this module, include `require('https')` in your code.\n", "ellipsis_description": "\nHTTPS is the HTTP protocol over TLS/SSL. In Node.js, this is implemented as a\nseparate module. To use this module, ...", "line": 21, "aliases": [], "children": [ { "id": "https.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientResponse" ] }, { "name": "response" } ], "callback": true, "optional": true, "types": [ "http.ClientRequest" ] } ], "callback": { "name": "callback", "args": [ { "name": "request", "type": [ "http.ClientResponse" ] }, { "name": "response" } ], "callback": true, "optional": true, "types": [ "http.ClientRequest" ] }, "returns": [ { "type": "https.Server" } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "request", "types": [ "http.ClientRequest" ], "description": "Any options you want to pass to the server" }, { "name": "response", "types": [ "http.ClientResponse" ], "description": "An optional listener (related to: tls.createServer)" } ], "description": "Returns a new HTTPS web server object.\n\nThe `options` object has a mix of required and optional values:\n\n - `key`: A string or `Buffer` containing the private key of the server in a\nPEM format. (Required)\n - `cert`: A string or `Buffer` containing the certificate key of the server in\na PEM format. (Required)\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simplier: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `passphrase`: A string of a passphrase for the private key.\n\n - `rejectUnauthorized`: If `true` the server rejects any connection that is\nnot authorized with the list of supplied CAs. This option only has an effect if\n`requestCert` is `true`. This defaults to `false`.\n\n - `requestCert`: If `true` the server requests a certificate from clients that\nconnect and attempt to verify that certificate. This defaults to `false`.\n\n - `sessionIdContext`: A string containing an opaque identifier for session\nresumption. If `requestCert` is `true`, the default is an MD5 hash value\ngenerated from the command line. Otherwise, the default is not provided.\n\n - `SNICallback`: A function that is called if the client supports the SNI TLS\nextension. Only one argument will be passed to it: `servername`. `SNICallback`\nshould return a SecureContext instance. You can use\n`crypto.createCredentials(...).context` to get a proper SecureContext. If\n`SNICallback` wasn't provided, a default callback within the high-level API is\nused (for more information, see below).", "short_description": "Returns a new HTTPS web server object.\n", "ellipsis_description": "Returns a new HTTPS web server object.\n ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L71", "name": "createServer", "path": "https.createServer" }, { "id": "https.get", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Options to pass to the request" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the method finishes" } ], "description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n\nSince most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and [[http.request\n`http.request()`]] is that it sets the method to GET and calls `req.end()`\nautomatically.\n\n#### Example\n\n", "short_description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n", "ellipsis_description": "Exactly like [[http.get `http.get()`]] but for HTTPS.\n ...", "line": 176, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.get", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L176", "name": "get", "path": "https.get" }, { "id": "https.globalAgent", "type": "class property", "signatures": [ { "returns": [ { "type": "https.Agent" } ] } ], "description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests.", "short_description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests.", "ellipsis_description": "A global instance of the [[https.Agent `https.Agent`]], which is used as the\ndefault for all HTTPS client requests. ...", "line": 184, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.globalAgent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L184", "name": "globalAgent", "path": "https.globalAgent" }, { "id": "https.request", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute" } ], "description": "Makes a request to a secure web server.\n\nAll options from [http.request `httprequest()`]] are valid for `options`:\n\n- host: a domain name or IP address of the server to issue the request to.\nDefaults to `'localhost'`.\n- hostname: this supports `url.parse()`; `hostname` is preferred over `host`\n- port: the port of the remote server. Defaults to `80`.\n- socketPath: the Unix Domain Socket (use either `host:port` or `socketPath`)\n- method: a string specifying the HTTP request method. Defaults to `'GET'`.\n- path: the request path. Defaults to `'/'`. This should include a query string\n(if any) For example, `'/index.html?page=12'`\n- headers: an object containing request headers\n- auth: used for basic authentication. For example, `'user:password'` computes\nan Authorization header.\n- agent: this controls [[https.Agent `https.Agent`]] behavior. When an Agent is\nused, the request defaults to `Connection: keep-alive`. The possible values are:\n - `undefined`: uses [[http.globalAgent globalAgent]] for this host\n and port (default).\n - `Agent` object: this explicitlys use the passed in `Agent`\n - `false`: this opts out of connection pooling with an Agent, and defaults the\nrequest to `Connection: close`.\n\nThe following options from [tls.connect()](tls.html#tls.connect) can also be\nspecified. However, a [[http.globalAgent globalAgent]] silently ignores these.\n\n - `pfx`: Certificate, private key, and CA certificates to use for SSL. The\n default is `null`.\n\n - `key`: A string or `Buffer` containing the private key of the client in aPEM\nformat. The default is `null`.\n\n - `passphrase`: A string of a passphrase for the private key or pfx. The\n default is `null`.\n\n - `cert`: A string or `Buffer` containing the certificate key of the client in\na PEM format; in other words, the public x509 certificate to use. The default is\n`null`.\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n#### Example\n\n\n\nHere's an example specifying these options using a custom `Agent`:\n\n var options = {\n host: 'encrypted.google.com',\n port: 443,\n path: '/',\n method: 'GET',\n key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')\n };\n options.agent = new https.Agent(options);\n\n var req = https.request(options, function(res) {\n ...\n }\n\nOr, if you choose not to use an `Agent`:\n\n var options = {\n host: 'encrypted.google.com',\n port: 443,\n path: '/',\n method: 'GET',\n key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),\n cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),\n agent: false\n };\n\n var req = https.request(options, function(res) {\n ...\n }", "short_description": "Makes a request to a secure web server.\n", "ellipsis_description": "Makes a request to a secure web server.\n ...", "line": 158, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L158", "name": "request", "path": "https.request" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https", "subclasses": [ "https.Agent", "https.Server" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L21", "name": "https", "path": "https" }, { "id": "https.Agent", "type": "class", "superclass": "https", "description": "An `Agent` object for HTTPS, similar to [[http.Agent `http.Agent`]]. For more\ninformation, see [[https.request `https.request()`]].", "short_description": "An `Agent` object for HTTPS, similar to [[http.Agent `http.Agent`]]. For more\ninformation, see [[https.request `https.request()`]].", "ellipsis_description": "An `Agent` object for HTTPS, similar to [[http.Agent `http.Agent`]]. For more\ninformation, see [[https.request `http...", "line": 194, "aliases": [], "children": [ { "id": "https.Agent.maxSockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "short_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5.", "ellipsis_description": "Determines how many concurrent sockets the agent can have open per host. By\ndefault, this is set to 5. ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent.maxSockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L202", "name": "maxSockets", "path": "https.Agent.maxSockets" }, { "id": "https.Agent.sockets", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "short_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!**", "ellipsis_description": "An object which contains arrays of sockets currently in use by the Agent.\n**Don't modify this!** ...", "line": 210, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent.sockets", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L210", "name": "sockets", "path": "https.Agent.sockets" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Agent", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L194", "name": "Agent", "path": "https.Agent" }, { "id": "https.Server", "type": "class", "superclass": "https", "description": "This class is a subclass of [[tls.Server `tls.Server`]] and emits the same\nevents as [[http.Server `http.Server`]].\n\nCreating HTTPS servers is somewhat complicated and requires generating\ncertificates.", "short_description": "This class is a subclass of [[tls.Server `tls.Server`]] and emits the same\nevents as [[http.Server `http.Server`]].\n", "ellipsis_description": "This class is a subclass of [[tls.Server `tls.Server`]] and emits the same\nevents as [[http.Server `http.Server`]].\n ...", "line": 221, "aliases": [], "children": [ { "id": "https.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Server.close)\n\nStops the server from accepting new connections.", "short_description": "(related to: net.Server.close)\n", "ellipsis_description": "(related to: net.Server.close)\n ...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L323", "name": "close", "path": "https.Server.close" }, { "id": "https.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to listen to" }, { "name": "hostname", "types": [ "String" ], "description": "The hostname to listen to" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the server has been bound to the port (related to: net.Server.listen)" } ], "description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n\nThis function is asynchronous. The `callback()` is added as a listener for the\n[[net.Server@listening `'listening'` event of `net.Server`.", "short_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). To listen to a Unix socket, supply a filename instead of port\nand hostname.\n", "ellipsis_description": "Begin accepting connections on the specified port and hostname. If the hostname\nis omitted, the server accepts conne...", "line": 314, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L314", "name": "listen", "path": "https.Server.listen" }, { "id": "https.Server@checkContinue", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of `http.ServerRequest`" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of `http.ServerResponse`" } ], "description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n\nHandling this event involves calling `response.writeContinue` if the client\nshould continue to send the request body, or generating an appropriate HTTP\nresponse (_e.g._ `400 Bad Request`) if the client should not continue to send\nthe request body.\n\nNote: When this event is emitted and handled, the `request` event is not be emitted.", "short_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the server will automatically respond with a `100\nContinue` as appropriate.\n", "ellipsis_description": "Emitted each time a request with an `http Expect: 100-continue` is received. If\nthis event isn't listened for, the s...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@checkContinue", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L267", "name": "checkContinue", "path": "https.Server.event.checkContinue" }, { "id": "https.Server@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception being thrown" } ], "description": "If a client connection emits an `'error'` event, it's forwarded here.", "short_description": "If a client connection emits an `'error'` event, it's forwarded here.", "ellipsis_description": "If a client connection emits an `'error'` event, it's forwarded here. ...", "line": 293, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L293", "name": "clientError", "path": "https.Server.event.clientError" }, { "id": "https.Server@close", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 249, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L249", "name": "close", "path": "https.Server.event.close" }, { "id": "https.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An object of type [[net.Socket `net.Socket`]]" } ], "description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "short_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also be accessed at\n[[http.ServerRequest.connection]].", "ellipsis_description": "Emitted when a new TCP stream is established. Usually users won't want to access\nthis event. The `socket` can also b...", "line": 241, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L241", "name": "connection", "path": "https.Server.event.connection" }, { "id": "https.Server@request", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "response", "types": [ "http.ServerResponse" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "An instance of [[http.ServerRequest]]" }, { "name": "response", "types": [ "http.ServerResponse" ], "description": "An instance of [[http.ServerResponse]]" } ], "description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "short_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple requests per connection.", "ellipsis_description": "Emitted each time there is a request. Note that, in the case of keep-alive\nconnections, there may be multiple reques...", "line": 231, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@request", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L231", "name": "request", "path": "https.Server.event.request" }, { "id": "https.Server@upgrade", "type": "event", "signatures": [ { "args": [ { "name": "request", "types": [ "http.ServerRequest" ] }, { "name": "socket", "types": [ "Number" ] }, { "name": "head", "types": [ "Buffer" ] } ] } ], "arguments": [ { "name": "request", "types": [ "http.ServerRequest" ], "description": "The arguments for the http request, as it is in the request event" }, { "name": "socket", "types": [ "Number" ], "description": "The network socket between the server and client" }, { "name": "head", "types": [ "Buffer" ], "description": "The first packet of the upgraded stream; this can be empty" } ], "description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n\nAfter this event is emitted, the request's socket won't have a `data` event\nlistener, meaning you will need to bind to it in order to handle data sent to\nthe server on that socket.", "short_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upgrade will have their connections closed.\n", "ellipsis_description": "Emitted each time a client requests a http upgrade. If this event isn't listened\nfor, then clients requesting an upg...", "line": 283, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server@upgrade", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L283", "name": "upgrade", "path": "https.Server.event.upgrade" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/https.markdown", "fileName": "https", "resultingFile": "https.html#https.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/https.markdown#L221", "name": "Server", "path": "https.Server" }, { "id": "module.children", "type": "class property", "signatures": [ { "returns": [ { "type": "Array" } ] } ], "description": "The module objects required by this one.", "short_description": "The module objects required by this one.", "ellipsis_description": "The module objects required by this one. ...", "line": 430, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.children", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L430", "name": "children", "path": "module.children" }, { "id": "module.filename", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The fully resolved filename to the module.", "short_description": "The fully resolved filename to the module.", "ellipsis_description": "The fully resolved filename to the module. ...", "line": 408, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.filename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L408", "name": "filename", "path": "module.filename" }, { "id": "module.id", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The identifier for the module. Typically this is the fully resolved filename.", "short_description": "The identifier for the module. Typically this is the fully resolved filename.", "ellipsis_description": "The identifier for the module. Typically this is the fully resolved filename. ...", "line": 401, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.id", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L401", "name": "id", "path": "module.id" }, { "id": "module.loaded", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "Identifies wether or not the module is done loading (`true`), or is in the\nprocess of loading.", "short_description": "Identifies wether or not the module is done loading (`true`), or is in the\nprocess of loading.", "ellipsis_description": "Identifies wether or not the module is done loading (`true`), or is in the\nprocess of loading. ...", "line": 416, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.loaded", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L416", "name": "loaded", "path": "module.loaded" }, { "id": "module.parent", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "The module that required this one.", "short_description": "The module that required this one.", "ellipsis_description": "The module that required this one. ...", "line": 423, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.parent", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L423", "name": "parent", "path": "module.parent" }, { "id": "module.require", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "id", "types": [ "String" ], "description": "The name of the module" } ], "description": "The `module.require` method provides a way to load a module as if `require()`\nwas called from the original module. The object returned is actually the\n`exports` from the resolved module.\n\nNote that in order to do this, you must get a reference to the `module` object.\nSince `require()` returns the `exports`, and the `module` is typically *only*\navailable within a specific module's code, it must be explicitly exported in\norder to be used.", "short_description": "The `module.require` method provides a way to load a module as if `require()`\nwas called from the original module. The object returned is actually the\n`exports` from the resolved module.\n", "ellipsis_description": "The `module.require` method provides a way to load a module as if `require()`\nwas called from the original module. T...", "line": 394, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#module.require", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L394", "name": "require", "path": "module.require" }, { "id": "Modules", "type": "class", "description": "\nNode.js has a simple module loading system. In Node.js, files and modules are in\none-to-one correspondence.\n\nFor example, imagine a scenario where `foo.js` loads the module `circle.js` in\nthe same directory.\n\nThe contents of `foo.js` are:\n\n var circle = require('./circle.js');\n console.log( 'The area of a circle of radius 4 is '\n + circle.area(4));\n\nThe contents of `circle.js` are:\n\n var PI = Math.PI;\n\n exports.area = function (r) {\n return PI * r * r;\n };\n\n exports.circumference = function (r) {\n return 2 * PI * r;\n };\n\nThe module `circle.js` has exported the functions `area()` and\n`circumference()`. To export an object, add to the special\n[`exports`](#module.exports) object.\n\nVariables local to a module are private. In this example, the variable `PI` is\nprivate to `circle.js`.\n\n#### Cycles\n\nWhenever there are circular `require()` calls, a module might not be done being\nexecuted when it is returned.\n\nConsider this situation with the following files. In `a.js':\n\n console.log('a starting');\n exports.done = false;\n var b = require('./b.js');\n console.log('in a, b.done = %j', b.done);\n exports.done = true;\n console.log('a done');\n\nIn `b.js`:\n\n console.log('b starting');\n exports.done = false;\n var a = require('./a.js');\n console.log('in b, a.done = %j', a.done);\n exports.done = true;\n console.log('b done');\n\nAnd in `main.js`:\n\n console.log('main starting');\n var a = require('./a.js');\n var b = require('./b.js');\n console.log('in main, a.done=%j, b.done=%j', a.done, b.done);\n\nWhen `main.js` loads `a.js`, `a.js` loads `b.js`. At that point, `b.js` tries to\nload `a.js`. In order to prevent an infinite loop an \"unfinished copy\" of the\n`a.js` exports object is returned to the `b.js` module. `b.js` then finishes\nloading, and its exports object is provided to the `a.js` module.\n\nBy the time `main.js` finishes loading both modules, they've both finished\nexecuting. The output of this program would thus be:\n\n $ node main.js\n main starting\n a starting\n b starting\n in b, a.done = false\n b done\n in a, b.done = true\n a done\n in main, a.done=true, b.done=true\n\nIf you have cyclic module dependencies in your program, make sure to plan\naccordingly.\n\n#### Core Modules\n\nNode.js has several modules compiled into the binary. These modules are\ndescribed in greater detail elsewhere in this documentation.\n\nThe core modules are defined in Node's source in the `lib/` folder.\n\nCore modules are always preferentially loaded if their identifier is passed to\n`require()`. For instance, `require('http')` always returns the built in HTTP\nmodule, even if there is a file by that name.\n\n#### File Modules\n\nIf the exact filename is not found, then Node.js attempts to load the required\nfilename with the added extension of `.js`, `.json`, and then `.node`.\n\n`.js` files are interpreted as Javascript text files, and `.json` files are\nparsed as JSON text files. `.node` files are interpreted as compiled addon\nmodules loaded with `dlopen`.\n\nA module prefixed with `'/'` is an absolute path to the file. For example,\n`require('/home/marco/foo.js')` loads the file at `/home/marco/foo.js`.\n\nA module prefixed with `'./'` is relative to the file calling `require()`. That\nis, `circle.js` must be in the same directory as `foo.js` for\n`require('./circle')` to find it.\n\nWithout a leading `'/'` or `'./'` to indicate a file, the module is either a\n\"core module\" or is loaded from the `node_modules` folder.\n\nFor example, if the file at `'/home/ry/projects/foo.js'` is called by\n`require('bar.js')`, then Node.js looks for it in the following locations, in\nthis order:\n\n* `/home/ry/projects/node_modules/bar.js`\n* `/home/ry/node_modules/bar.js`\n* `/home/node_modules/bar.js`\n* `/node_modules/bar.js`\n\nThis allows programs to localize their dependencies, so that they don't clash.\n\n#### Folders as Modules\n\nIt is convenient to organize programs and libraries into self-contained\ndirectories, and then provide a single entry point to that library.\n\nThere are three ways in which a folder may be passed to `require()` as an\nargument.\n\nThe first is to create a `package.json` file in the root of the folder, which\nspecifies a `main` module. An example `package.json` file might look like this:\n\n { \"name\" : \"some-library\",\n \"main\" : \"./lib/some-library.js\" }\n\nIf this was in a folder at `./some-library`, then `require('./some-library')`\nwould attempt to load `./some-library/lib/some-library.js`.\n\nThis is the extent of Node's awareness of `package.json` files.\n\nIf there is no `package.json` file present in the directory, then Node.js\nattempts to load an `index.js` or `index.node` file out of that directory. For\nexample, if there was no `package.json` file in the above example, then\n`require('./some-library')` would attempt to load:\n\n* `./some-library/index.js`\n* `./some-library/index.node`\n\n#### Caching\n\nModules are cached after the first time they are loaded. This means (among\nother things) that every call to `require('foo')` gets exactly the same object\nreturned, if it would resolve to the same file.\n\nMultiple calls to `require('foo')` may not cause the module code to be executed\nmultiple times. This is an important feature. With it, \"partially done\"\nobjects can be returned, thus allowing transitive dependencies to be loaded even\nwhen they would cause cycles.\n\nIf you want to have a module execute code multiple times, then export a\nfunction, and call that function.\n\n#### Module Caching Caveats\n\nModules are cached based on their resolved filename. Since modules may resolve\nto a different filename based on the location of the calling module (loading\nfrom `node_modules` folders), it is not a guarantee that `require('foo')` always\nreturns the exact same object, if it would resolve to different files.\n\n#### The `module` Object\n\nIn each module, the `module` variable is a reference to the object representing\nthe current module. In particular, `module.exports` is the same as the `exports`\nobject.\n\n`module` isn't actually a global, but rather local to each module.\n\n\n\nThe `exports` object is created by the Module system. Sometimes, this is not\nacceptable, as some developers want their module to be an instance of some\nclass.\n\nTo do this assign the desired export object to `module.exports`. For example\nsuppose we were making a module called `a.js`\n\n var EventEmitter = require('events').EventEmitter;\n\n module.exports = new EventEmitter();\n\n // Do some work, and after some time emit\n // the 'ready' event from the module itself.\n setTimeout(function() {\n module.exports.emit('ready');\n }, 1000);\n\nThen, in another file we could do\n\n var a = require('./a');\n a.on('ready', function() {\n console.log('module a is ready');\n });\n\n\nNote that the assignment to `module.exports` must be done immediately. It can't\nbe done in any callbacks. For example, this does not work:\n\nIn a file called `x.js`:\n\n setTimeout(function() {\n module.exports = { a: \"hello\" };\n }, 0);\n\nIn a file called `y.js`:\n\n var x = require('./x');\n console.log(x.a);\n\n\n#### All Together Now\n\nTo get the exact filename that will be loaded when `require()` is called, use\nthe `require.resolve()` function.\n\nPutting together all of the above, here is the high-level algorithm (in\npseudocode) of what `require.resolve()` does:\n\n
\n
To `require(X)` from module at path Y:
\n
\n
\n    1. If X is a core module,\n        a. return the core module\n        b. STOP\n    2. If X begins with './' or '/' or '../'\n        a. LOAD_AS_FILE(Y + X)\n        b. LOAD_AS_DIRECTORY(Y + X)\n    3. LOAD_NODE_MODULES(X, dirname(Y))\n    4. THROW \"not found\"\n    
\n
\n
To `LOAD_AS_FILE(X)`:
\n
\n
\n    1. If X is a file, load X as Javascript text.  STOP\n    2. If X.js is a file, load X.js as Javascript text.  STOP\n    3. If X.node is a file, load X.node as binary addon.  STOP\n    
\n
\n
To `LOAD_AS_DIRECTORY(X)`:
\n
\n
\n    1. If X/package.json is a file,\n       a. Parse X/package.json, and look for \"main\" field.\n       b. let M = X + (json main field)\n       c. LOAD_AS_FILE(M)\n    2. If X/index.js is a file, load X/index.js as Javascript text.  STOP\n    3. If X/index.node is a file, load X/index.node as binary addon.  STOP\n    
\n
\n
To `LOAD_NODE_MODULES(X, START)`:
\n
\n
\n    1. let DIRS=NODE_MODULES_PATHS(START)\n    2. for each DIR in DIRS:\n       a. LOAD_AS_FILE(DIR/X)\n       b. LOAD_AS_DIRECTORY(DIR/X)\n    
\n
\n
To `NODE_MODULES_PATHS(START)`:
\n
\n
\n    1. let PARTS = path split(START)\n    2. let ROOT = index of first instance of \"node_modules\" in PARTS, or 0\n    3. let I = count of PARTS - 1\n    4. let DIRS = []\n    5. while I > ROOT,\n       a. if PARTS[I] = \"node_modules\" CONTINUE\n       c. DIR = path join(PARTS[0 .. I] + \"node_modules\")\n       b. DIRS = DIRS + DIR\n       c. let I = I - 1\n    6. return DIRS\n    
\n
\n\n#### Loading from the global folders\n\nIf the `NODE_PATH` environment variable is set to a colon-delimited list of\nabsolute paths, then Node.js searches those paths for modules if they are not\nfound elsewhere. (Note: On Windows, `NODE_PATH` is delimited by semicolons\ninstead of colons.)\n\nAdditionally, Node.js searches in the following locations:\n\n* 1: `$HOME/.node_modules`\n* 2: `$HOME/.node_libraries`\n* 3: `$PREFIX/lib/node`\n\nWhere `$HOME` is the user's home directory, and `$PREFIX` is Node's configured\n`installPrefix`.\n\nThese are mostly for historic reasons. You are highly encouraged to place your\ndependencies locally in `node_modules` folders. They will be loaded faster, and\nmore reliably.\n\n#### Accessing the `main` module\n\nWhen a file is run directly from Node.js, `require.main` is set to its `module`.\nThat means that you can determine whether a file has been run directly by\ntesting for the following:\n\n require.main === module\n\nFor a file `foo.js`, this is `true` if run via `node foo.js`, but `false` if run\nby `require('./foo')`.\n\nBecause `module` provides a `filename` property (normally equivalent to\n`__filename`), the entry point of the current application can be obtained by\nchecking `require.main.filename`.\n\n#### Package Manager Tips\n\nThe semantics of Node's `require()` function were designed to be general enough\nto support a number of sane directory structures. Package manager programs such\nas `dpkg`, `rpm`, and `npm` will hopefully find it possible to build native\npackages from Node modules without modification.\n\nBelow we give a suggested directory structure that could work:\n\nLet's say that we wanted to have the folder at\n`/usr/lib/node//` hold the contents of a specific\nversion of a package.\n\nPackages can depend on one another. In order to install package `foo`, you may\nhave to install a specific version of package `bar`. The `bar` package may\nitself have dependencies, and in some cases, these dependencies may even collide\nor form cycles.\n\nSince Node.js looks up the `realpath` of any modules it loads (that is, resolves\nsymlinks), and then looks for their dependencies in the `node_modules` folders\nas described above, this situation is very simple to resolve with the following\narchitecture:\n\n* `/usr/lib/node/foo/1.2.3/` - Contents of the `foo` package, version 1.2.3.\n* `/usr/lib/node/bar/4.3.2/` - Contents of the `bar` package that `foo` depends\non.\n* `/usr/lib/node/foo/1.2.3/node_modules/bar` - Symbolic link to\n`/usr/lib/node/bar/4.3.2/`.\n* `/usr/lib/node/bar/4.3.2/node_modules/*` - Symbolic links to the packages that\n`bar` depends on.\n\nThus, even if a cycle is encountered, or if there are dependency conflicts,\nevery module will be able to get a version of its dependency that it can use.\n\nWhen the code in the `foo` package does `require('bar')`, it gets the version\nthat is symlinked into `/usr/lib/node/foo/1.2.3/node_modules/bar`. Then, when\nthe code in the `bar` package calls `require('quux')`, it gets the version that\nis symlinked into `/usr/lib/node/bar/4.3.2/node_modules/quux`.\n\nFurthermore, to make the module lookup process even more optimal, rather than\nputting packages directly in `/usr/lib/node`, we could put them in\n`/usr/lib/node_modules//`. Then Node.js doesn't bother looking\nfor missing dependencies in `/usr/node_modules` or `/node_modules`.\n\nIn order to make modules available to the Node.js REPL, it might be useful to\nalso add the `/usr/lib/node_modules` folder to the `$NODE_PATH` environment\nvariable. Since the module lookups using `node_modules` folders are all\nrelative, and based on the real path of the files making the calls to\n`require()`, the packages themselves can be anywhere.", "stability": "5 - Locked", "short_description": "\nNode.js has a simple module loading system. In Node.js, files and modules are in\none-to-one correspondence.\n", "ellipsis_description": "\nNode.js has a simple module loading system. In Node.js, files and modules are in\none-to-one correspondence.\n ...", "line": 379, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/modules.markdown", "fileName": "modules", "resultingFile": "modules.html#Modules", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/modules.markdown#L379", "name": "Modules", "path": "Modules" }, { "id": "net", "type": "class", "description": "\nThe `net` module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers and clients (called streams). You can include\nthis module in your code with `require('net');`\n\n\n#### Example\n\nHere is an example of a echo server which listens for connections on port 8124:\n\n\n\nYou can test this by using `telnet`:\n\n telnet localhost 8124\n\nTo listen on the socket `/tmp/echo.sock` the third line from the last would just\nbe changed to\n\n server.listen('/tmp/echo.sock', function() { //'listening' listener\n\nYou can use `nc` to connect to a UNIX domain socket server:\n\n nc -U /tmp/echo.sock", "stability": "3 - Stable", "short_description": "\nThe `net` module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers and clients (called streams). You can include\nthis module in your code with `require('net');`\n", "ellipsis_description": "\nThe `net` module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers a...", "line": 31, "aliases": [], "children": [ { "id": "net.connect", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event (alias of: createConnection)" } ], "description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n\nThe arguments for these methods change the type of connection. For example, if\nyou include `host`, you create a TCP connection to `port` on `host`. If you\ndon't include it, you create a unix socket connection to `path`.", "short_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n", "ellipsis_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connec...", "line": 66, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L66", "name": "connect", "path": "net.connect" }, { "id": "net.createConnection", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event" } ], "description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n\nThe arguments for these methods change the type of connection. For example, if\nyou include `host`, you create a TCP connection to `port` on `host`. If you\ndon't include it, you create a unix socket connection to `path`.", "short_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connect'` event is emitted.\n", "ellipsis_description": "Construct a new socket object and opens a socket to the given location. When the\nsocket is established, the `'connec...", "line": 83, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.createConnection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L83", "name": "createConnection", "path": "net.createConnection" }, { "id": "net.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "default_value": { "allowHalfOpen": false }, "optional": true, "types": [ "Object" ] }, { "name": "connectionListener", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "An object with any options you want to include", "optional": true }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event", "optional": true } ], "description": "Creates a new TCP server.\n\nIf `allowHalfOpen` is `true`, then the socket won't automatically send FIN\npacket when the other end of the socket sends a FIN packet. The socket becomes\nnon-readable, but still writable. You should call the `end()` method explicitly.\nSee [[net.Socket@end `'end'`]] event for more information.", "short_description": "Creates a new TCP server.\n", "ellipsis_description": "Creates a new TCP server.\n ...", "line": 48, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L48", "name": "createServer", "path": "net.createServer" }, { "id": "net.isIP", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and returns `6` for IP version 6 addresses.", "short_description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and returns `6` for IP version 6 addresses.", "ellipsis_description": "Tests if `input` is an IP address. Returns `0` for invalid strings, returns `4`\nfor IP version 4 addresses, and retu...", "line": 93, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIP", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L93", "name": "isIP", "path": "net.isIP" }, { "id": "net.isIPv4", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Returns `true` if input is a version 4 IP address.", "short_description": "Returns `true` if input is a version 4 IP address.", "ellipsis_description": "Returns `true` if input is a version 4 IP address. ...", "line": 101, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIPv4", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L101", "name": "isIPv4", "path": "net.isIPv4" }, { "id": "net.isIPv6", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "input", "types": [ "String" ], "description": "The data to check against" } ], "description": "Returns `true` if input is a version 6 IP address.", "short_description": "Returns `true` if input is a version 6 IP address.", "ellipsis_description": "Returns `true` if input is a version 6 IP address. ...", "line": 109, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.isIPv6", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L109", "name": "isIPv6", "path": "net.isIPv6" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net", "subclasses": [ "net.Server", "net.Socket" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L31", "name": "net", "path": "net" }, { "id": "net.Server", "type": "class", "superclass": "net", "description": "This class is used to create a TCP or UNIX server. A server is a `net.Socket`\nthat can listen for new incoming connections.\n\n#### Example\n\n", "short_description": "This class is used to create a TCP or UNIX server. A server is a `net.Socket`\nthat can listen for new incoming connections.\n", "ellipsis_description": "This class is used to create a TCP or UNIX server. A server is a `net.Socket`\nthat can listen for new incoming conne...", "line": 121, "aliases": [], "children": [ { "id": "net.Server.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was assigned when giving getting an\nOS-assigned address.\n\nThis returns an object with two properties, like this:\n\n {\"address\":\"127.0.0.1\", \"port\":2121}`\n\n#### Example\n\n", "short_description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was assigned when giving getting an\nOS-assigned address.\n", "ellipsis_description": "Returns the bound address and port of the server as reported by the operating\nsystem. Useful to find which port was ...", "line": 226, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L226", "name": "address", "path": "net.Server.address" }, { "id": "net.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close' event.", "short_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close' event.", "ellipsis_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed wh...", "line": 209, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L209", "name": "close", "path": "net.Server.close" }, { "id": "net.Server.connections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of concurrent connections on the server.", "short_description": "The number of concurrent connections on the server.", "ellipsis_description": "The number of concurrent connections on the server. ...", "line": 242, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L242", "name": "connections", "path": "net.Server.connections" }, { "id": "net.Server.listen", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to" }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@listening `'listening'`]] event" } ], "description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). A port value of zero will assign a random port.\n\nThis function is asynchronous. When the server has been bound, the\n`'listening'` event is emitted.\n\nOne issue some users run into is getting `EADDRINUSE` errors. This means that\nanother server is already running on the requested port. One way of handling\nthis would be to wait a second and then try again. This can be done with\n\n server.on('error', function (e) {\n if (e.code == 'EADDRINUSE') {\n console.log('Address in use, retrying...');\n setTimeout(function () {\n server.close();\n server.listen(PORT, HOST);\n }, 1000);\n }\n });\n\nNote: All sockets in Node.js set `SO_REUSEADDR` already.", "short_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connections directed to any IPv4 address\n(`INADDR_ANY`). A port value of zero will assign a random port.\n", "ellipsis_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server accepts connec...", "line": 190, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L190", "name": "listen", "path": "net.Server.listen" }, { "id": "net.Server.maxConnections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Set this property to reject connections when the server's connection count gets\nhigh.", "short_description": "Set this property to reject connections when the server's connection count gets\nhigh.", "ellipsis_description": "Set this property to reject connections when the server's connection count gets\nhigh. ...", "line": 235, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.maxConnections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L235", "name": "maxConnections", "path": "net.Server.maxConnections" }, { "id": "net.Server.pause", "type": "class method", "signatures": [ { "args": [ { "name": "msecs", "default_value": 1000, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "msecs", "types": [ "Number" ], "description": "The number of milliseconds to pause for" } ], "description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "short_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "ellipsis_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections...", "line": 200, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L200", "name": "pause", "path": "net.Server.pause" }, { "id": "net.Server@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server closes.", "short_description": "Emitted when the server closes.", "ellipsis_description": "Emitted when the server closes. ...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L146", "name": "close", "path": "net.Server.event.close" }, { "id": "net.Server@connection", "type": "event", "signatures": [ { "args": [ { "name": "socket", "types": [ "net.Socket" ] } ] } ], "arguments": [ { "name": "socket", "types": [ "net.Socket" ], "description": "An instance of `net.Socket`" } ], "description": "Emitted when a new connection is made.", "short_description": "Emitted when a new connection is made.", "ellipsis_description": "Emitted when a new connection is made. ...", "line": 138, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@connection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L138", "name": "connection", "path": "net.Server.event.connection" }, { "id": "net.Server@error", "type": "event", "signatures": [ { "args": [ { "name": "exception" } ] } ], "description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the discussion of [[net.Server.listen\n`net.Server.listen`]]", "short_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the discussion of [[net.Server.listen\n`net.Server.listen`]]", "ellipsis_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. See an example in the d...", "line": 156, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L156", "name": "error", "path": "net.Server.event.error" }, { "id": "net.Server@listening", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the server has been bound after calling `server.listen`.", "short_description": "Emitted when the server has been bound after calling `server.listen`.", "ellipsis_description": "Emitted when the server has been bound after calling `server.listen`. ...", "line": 130, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L130", "name": "listening", "path": "net.Server.event.listening" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L121", "name": "Server", "path": "net.Server" }, { "id": "net.Socket", "type": "class", "superclass": "net", "description": "This object is an abstraction of a TCP or UNIX socket. `net.Socket` instances\nimplement a duplex Stream interface. They can be created by the user and used\nas a client (with `connect()`) or they can be created by Node.js and passed to\nthe user through the `'connection'` event of a server.", "short_description": "This object is an abstraction of a TCP or UNIX socket. `net.Socket` instances\nimplement a duplex Stream interface. They can be created by the user and used\nas a client (with `connect()`) or they can be created by Node.js and passed to\nthe user through the `'connection'` event of a server.", "ellipsis_description": "This object is an abstraction of a TCP or UNIX socket. `net.Socket` instances\nimplement a duplex Stream interface. ...", "line": 253, "aliases": [], "children": [ { "id": "net.Socket.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two properties that looks like this:\n\n\t\t{\"address\":\"192.168.57.1\", \"port\":62053}", "short_description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two properties that looks like this:\n", "ellipsis_description": "Returns the bound address and port of the socket as reported by the operating\nsystem. Returns an object with two pro...", "line": 452, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L452", "name": "address", "path": "net.Socket.address" }, { "id": "net.Socket.bufferSize", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. The computer can't always keep up with\nthe amount of data that is written to a socket—the network connection simply\nmight be too slow. Node.js will internally queue up the data written to a socket\nand send it out over the wire whenever it's possible. (Internally, it's polling\non the socket's file descriptor for being writable.)\n\nThe consequence of this internal buffering is that memory may grow. This\nproperty shows the number of characters currently buffered to be written. The\nnumber of characters is approximately equal to the number of bytes to be\nwritten, but the buffer may contain strings, and the strings are lazily encoded,\nso the _exact_ number of bytes is not known.\n\nNote: Users who experience a large or growing `bufferSize` should attempt to \"throttle\" the data flows in their program with `pause()` and `resume()`.", "short_description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. The computer can't always keep up with\nthe amount of data that is written to a socket—the network connection simply\nmight be too slow. Node.js will internally queue up the data written to a socket\nand send it out over the wire whenever it's possible. (Internally, it's polling\non the socket's file descriptor for being writable.)\n", "ellipsis_description": "`net.Socket` has the property that `socket.write()` always works. This is to\nhelp users get up and running quickly. ...", "line": 323, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bufferSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L323", "name": "bufferSize", "path": "net.Socket.bufferSize" }, { "id": "net.Socket.bytesRead", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The amount of received bytes.", "short_description": "The amount of received bytes.", "ellipsis_description": "The amount of received bytes. ...", "line": 477, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bytesRead", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L477", "name": "bytesRead", "path": "net.Socket.bytesRead" }, { "id": "net.Socket.bytesWritten", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The amount of bytes sent.", "short_description": "The amount of bytes sent.", "ellipsis_description": "The amount of bytes sent. ...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.bytesWritten", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L485", "name": "bytesWritten", "path": "net.Socket.bytesWritten" }, { "id": "net.Socket.close", "type": "class method", "signatures": [ { "args": [ { "name": "had_error", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "had_error", "types": [ "Boolean" ], "description": "A `true` boolean if the socket was closed due to a transmission error" } ], "description": "Emitted once the socket is fully closed.", "short_description": "Emitted once the socket is fully closed.", "ellipsis_description": "Emitted once the socket is fully closed. ...", "line": 557, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L557", "name": "close", "path": "net.Socket.close" }, { "id": "net.Socket.connect", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "default_value": "localhost", "optional": true, "types": [ "String" ] }, { "name": "connectionListener", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "connectionListener", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "The name of the host to connect to; it's entirely optional, as you can just use `(port, connectListener)` if you wish", "optional": true }, { "name": "connectionListener", "types": [ "Function" ], "description": "Automatically set as a listener for the [[net.Server@connection `'connection'`]] event", "optional": true } ], "description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. If a `path` is given, the socket is opened\nas a Unix socket to that path.\n\nNormally this method isn't needed, as `net.createConnection()` opens the socket.\nUse this only if you are implementing a custom Socket or if a Socket is closed\nand you want to reuse it to connect to another server.\n\nThis function is asynchronous. When the `'connect'` event is emitted the socket\nis established. If there is a problem connecting, the `'connect'` event isn't\nemitted, and the `'error'` event is emitted with the exception.", "short_description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. If a `path` is given, the socket is opened\nas a Unix socket to that path.\n", "ellipsis_description": "Opens the connection for a given socket. If `port` and `host` are given, then\nthe socket is opened as a TCP socket. ...", "line": 302, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L302", "name": "connect", "path": "net.Socket.connect" }, { "id": "net.Socket.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error).", "short_description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error).", "ellipsis_description": "Ensures that no more I/O activity happens on this socket. Only necessary in case\nof errors (like with a parse error). ...", "line": 379, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L379", "name": "destroy", "path": "net.Socket.destroy" }, { "id": "net.Socket.drain", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Socket.write)\n\nEmitted when the write buffer becomes empty. Can be used to throttle uploads.", "short_description": "(related to: net.Socket.write)\n", "ellipsis_description": "(related to: net.Socket.write)\n ...", "line": 539, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.drain", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L539", "name": "drain", "path": "net.Socket.drain" }, { "id": "net.Socket.end", "type": "class method", "signatures": [ { "args": [ { "name": "data", "optional": true, "types": [ "String" ] }, { "name": "encoding", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to write first", "optional": true }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use", "optional": true } ], "description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n\nIf `data` is specified, it's equivalent to calling `socket.write(data,\nencoding)` followed by `socket.end()`.", "short_description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n", "ellipsis_description": "Half-closes the socket, _i.e._, it sends a FIN packet. It is possible the server\ncan still send some data.\n ...", "line": 371, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L371", "name": "end", "path": "net.Socket.end" }, { "id": "net.Socket.error", "type": "class method", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "Any exceptions encountered" } ], "description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event.", "short_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event.", "ellipsis_description": "Emitted when an error occurs. The `'close'` event is called directly following\nthis event. ...", "line": 548, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L548", "name": "error", "path": "net.Socket.error" }, { "id": "new net.Socket", "type": "constructor", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "An object of options you can pass" } ], "description": "Constructs a new socket object.\n\n`options` is an object with the following defaults:\n\n {\n fd: null\n type: null\n allowHalfOpen: false\n }\n\nwhere\n\n* `fd` allows you to specify the existing file descriptor of socket.\n* `type` specifies the underlying protocol. It can be `'tcp4'`, `'tcp6'`, or\n`'unix'`.\n* `allowHalfOpen` is a boolean indicating how the socket should end. For more\ninformation, see the [[net.createServer `createServer()`]] method and the\n[[net.Socket@end `'end'`]] event.", "short_description": "Constructs a new socket object.\n", "ellipsis_description": "Constructs a new socket object.\n ...", "line": 279, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L279", "name": "new", "path": "net.Socket.new" }, { "id": "net.Socket.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload.", "short_description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload.", "ellipsis_description": "Pauses the reading of data. That is, `'data'` events are no longer emitted.\nUseful to throttle back an upload. ...", "line": 388, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L388", "name": "pause", "path": "net.Socket.pause" }, { "id": "net.Socket.remoteAddress", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "short_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "ellipsis_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`. ...", "line": 461, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.remoteAddress", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L461", "name": "remoteAddress", "path": "net.Socket.remoteAddress" }, { "id": "net.Socket.remotePort", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The numeric representation of the remote port. For example, `80` or `21`.", "short_description": "The numeric representation of the remote port. For example, `80` or `21`.", "ellipsis_description": "The numeric representation of the remote port. For example, `80` or `21`. ...", "line": 469, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.remotePort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L469", "name": "remotePort", "path": "net.Socket.remotePort" }, { "id": "net.Socket.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes reading after a call to `pause()`.", "short_description": "Resumes reading after a call to `pause()`.", "ellipsis_description": "Resumes reading after a call to `pause()`. ...", "line": 395, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L395", "name": "resume", "path": "net.Socket.resume" }, { "id": "net.Socket.setEncoding", "type": "class method", "signatures": [ { "args": [ { "name": "encoding", "default_value": "null", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding to use (either `'ascii'`, `'utf8'`, or `'base64'`)", "optional": true } ], "description": "Sets the encoding for data that is received.", "short_description": "Sets the encoding for data that is received.", "ellipsis_description": "Sets the encoding for data that is received. ...", "line": 332, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setEncoding", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L332", "name": "setEncoding", "path": "net.Socket.setEncoding" }, { "id": "net.Socket.setKeepAlive", "type": "class method", "signatures": [ { "args": [ { "name": "enable", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "initialDelay", "default_value": 0, "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "enable", "types": [ "Boolean" ], "description": "Enables or disables whether to stay alive", "optional": true }, { "name": "initialDelay", "types": [ "Number" ], "description": "The delay (in milliseconds) between the last data packet received and the first keepalive probe", "optional": true } ], "description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n\nSetting `initialDelay` to 0 for leaves the value unchanged from the default (or\nprevious) setting.\n\n\n#### Example\n\n", "short_description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n", "ellipsis_description": "Enable and disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe i...", "line": 442, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setKeepAlive", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L442", "name": "setKeepAlive", "path": "net.Socket.setKeepAlive" }, { "id": "net.Socket.setNoDelay", "type": "class method", "signatures": [ { "args": [ { "name": "noDelay", "default_value": true, "optional": true, "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "noDelay", "types": [ "Boolean" ], "description": "If `true`, immediately fires off data each time `socket.write()` is called.", "optional": true } ], "description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the Nagle algorithm, they buffer data before\nsending it off.", "short_description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the Nagle algorithm, they buffer data before\nsending it off.", "ellipsis_description": "Disables [the Nagle algorithm](http://en.wikipedia.org/wiki/Nagle's_algorithm).\nBy default TCP connections use the N...", "line": 423, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setNoDelay", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L423", "name": "setNoDelay", "path": "net.Socket.setNoDelay" }, { "id": "net.Socket.setSecure", "type": "class method", "signatures": [ { "args": [] } ], "description": "(deprecated: 0.3.0)\n\nThis function was used to upgrade the connection to SSL/TLS. See the [[tls TLS]]\nsection for the new API.", "short_description": "(deprecated: 0.3.0)\n", "ellipsis_description": "(deprecated: 0.3.0)\n ...", "line": 343, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setSecure", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L343", "name": "setSecure", "path": "net.Socket.setSecure" }, { "id": "net.Socket.setTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeout", "types": [ "Number" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "timeout", "types": [ "Number" ], "description": "The timeout length (in milliseconds)" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute as a one time listener for the `'timeout'` event.", "optional": true } ], "description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't have a timeout.\n\nWhen an idle timeout is triggered the socket will receive a `'timeout'` event\nbut the connection will not be severed. The user must manually `end()` or\n`destroy()` the socket.\n\nIf `timeout` is 0, then the existing idle timeout is disabled.", "short_description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't have a timeout.\n", "ellipsis_description": "Sets the socket to timeout after `timeout` milliseconds of inactivity on the\nsocket. By default `net.Socket` don't h...", "line": 412, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.setTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L412", "name": "setTimeout", "path": "net.Socket.setTimeout" }, { "id": "net.Socket.timeout", "type": "class method", "signatures": [ { "args": [] } ], "description": "(related to: net.Socket.setTimeout)\n\nEmitted if the socket times out from inactivity. This is only to notify that the\nsocket has been idle. The user must manually close the connection.", "short_description": "(related to: net.Socket.setTimeout)\n", "ellipsis_description": "(related to: net.Socket.setTimeout)\n ...", "line": 529, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.timeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L529", "name": "timeout", "path": "net.Socket.timeout" }, { "id": "net.Socket.write", "type": "class method", "signatures": [ { "args": [ { "name": "data", "types": [ "String" ] }, { "name": "encoding", "default_value": "utf8", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "data", "types": [ "String" ], "description": "The data to write" }, { "name": "enocding", "types": [ "String" ], "description": "The encoding to use" }, { "name": "callback", "types": [ "Function" ], "description": "The callback to execute once the write is finished", "optional": true } ], "description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 encoding.\n\nReturns `true` if the entire data was flushed successfully to the kernel buffer.\nReturns `false` if all or part of the data was queued in user memory. `'drain'`\nis emitted when the buffer is again free.", "short_description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 encoding.\n", "ellipsis_description": "Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string—it defaults to UTF8 en...", "line": 358, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L358", "name": "write", "path": "net.Socket.write" }, { "id": "net.Socket@connect", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connect()`]].", "short_description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connect()`]].", "ellipsis_description": "Emitted when a socket connection is successfully established. For more\ninformation, see [[net.Socket.connect `connec...", "line": 494, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L494", "name": "connect", "path": "net.Socket.event.connect" }, { "id": "net.Socket@data", "type": "event", "signatures": [ { "args": [ { "name": "data", "types": [ "Buffer", "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "Buffer", "String" ], "description": "A `Buffer` or `String`, depending on what it is" } ], "description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n\nFor more information, see the [[streams.ReadableStream ReadableStream]] section.", "short_description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n", "ellipsis_description": "Emitted when data is received. The encoding of `data` is set by\n`socket.setEncoding()`.\n ...", "line": 505, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L505", "name": "data", "path": "net.Socket.event.data" }, { "id": "net.Socket@end", "type": "event", "signatures": [ { "args": [] } ], "description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pending write queue. However, by setting\n`allowHalfOpen == true` the socket won't automatically `end()` its side,\nallowing the user to write arbitrary amounts of data, with the caveat that the\nuser is required to `end()` their side now.\n\nEmitted when the other end of the socket sends a FIN packet.", "short_description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pending write queue. However, by setting\n`allowHalfOpen == true` the socket won't automatically `end()` its side,\nallowing the user to write arbitrary amounts of data, with the caveat that the\nuser is required to `end()` their side now.\n", "ellipsis_description": "By default (when `allowHalfOpen == false`), the socket destroys its file\ndescriptor once it has written out its pend...", "line": 518, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L518", "name": "end", "path": "net.Socket.event.end" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/net.markdown", "fileName": "net", "resultingFile": "net.html#net.Socket", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/net.markdown#L253", "name": "Socket", "path": "net.Socket" }, { "id": "os", "type": "class", "description": "\nThis provides a way to retrieve various information about the underlaying\noperating system. Add `require('os')` in your code to access this module.\n\n#### Example\n\n", "stability": "4 - API Frozen", "short_description": "\nThis provides a way to retrieve various information about the underlaying\noperating system. Add `require('os')` in your code to access this module.\n", "ellipsis_description": "\nThis provides a way to retrieve various information about the underlaying\noperating system. Add `require('os')` in ...", "line": 15, "aliases": [], "children": [ { "id": "os.arch", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system CPU architecture.", "short_description": "Returns the operating system CPU architecture.", "ellipsis_description": "Returns the operating system CPU architecture. ...", "line": 23, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.arch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L23", "name": "arch", "path": "os.arch" }, { "id": "os.cpus", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": [ "Object" ], "array": true } ] } ], "description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and times (an object containing the number\nof CPU ticks spent in: user, nice, sys, idle, and irq).\n\n#### Example\n\nExample inspection of os.cpus:\n\n [ { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 252020,\n nice: 0,\n sys: 30340,\n idle: 1070356870,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 306960,\n nice: 0,\n sys: 26980,\n idle: 1071569080,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 248450,\n nice: 0,\n sys: 21750,\n idle: 1070919370,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 256880,\n nice: 0,\n sys: 19430,\n idle: 1070905480,\n irq: 20 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 511580,\n nice: 20,\n sys: 40900,\n idle: 1070842510,\n irq: 0 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 291660,\n nice: 0,\n sys: 34360,\n idle: 1070888000,\n irq: 10 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 308260,\n nice: 0,\n sys: 55410,\n idle: 1071129970,\n irq: 880 } },\n { model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',\n speed: 2926,\n times:\n { user: 266450,\n nice: 1480,\n sys: 34920,\n idle: 1072572010,\n irq: 30 } } ]", "short_description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and times (an object containing the number\nof CPU ticks spent in: user, nice, sys, idle, and irq).\n", "ellipsis_description": "Returns an array of objects containing information about each CPU/core\ninstalled: the model, speed (in MHz), and tim...", "line": 103, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.cpus", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L103", "name": "cpus", "path": "os.cpus" }, { "id": "os.freemem", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the amount of free system memory in bytes.", "short_description": "Returns the amount of free system memory in bytes.", "ellipsis_description": "Returns the amount of free system memory in bytes. ...", "line": 114, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.freemem", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L114", "name": "freemem", "path": "os.freemem" }, { "id": "os.hostname", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the hostname of the operating system.", "short_description": "Returns the hostname of the operating system.", "ellipsis_description": "Returns the hostname of the operating system. ...", "line": 125, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.hostname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L125", "name": "hostname", "path": "os.hostname" }, { "id": "os.loadavg", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": [ "Number" ], "array": true } ] } ], "description": "Returns an array containing the 1, 5, and 15 minute load averages.", "short_description": "Returns an array containing the 1, 5, and 15 minute load averages.", "ellipsis_description": "Returns an array containing the 1, 5, and 15 minute load averages. ...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.loadavg", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L162", "name": "loadavg", "path": "os.loadavg" }, { "id": "os.networkInterfaces", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns a list of network interfaces.\n\n#### Example\n\n { lo0:\n [ { address: '::1', family: 'IPv6', internal: true },\n { address: 'fe80::1', family: 'IPv6', internal: true },\n { address: '127.0.0.1', family: 'IPv4', internal: true } ],\n en1:\n [ { address: 'fe80::cabc:c8ff:feef:f996', family: 'IPv6',\n internal: false },\n { address: '10.0.1.123', family: 'IPv4', internal: false } ],\n vmnet1: [ { address: '10.99.99.254', family: 'IPv4', internal: false } ],\n vmnet8: [ { address: '10.88.88.1', family: 'IPv4', internal: false } ],\n ppp0: [ { address: '10.2.0.231', family: 'IPv4', internal: false } ] }", "short_description": "Returns a list of network interfaces.\n", "ellipsis_description": "Returns a list of network interfaces.\n ...", "line": 151, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.networkInterfaces", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L151", "name": "networkInterfaces", "path": "os.networkInterfaces" }, { "id": "os.platform", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system platform.", "short_description": "Returns the operating system platform.", "ellipsis_description": "Returns the operating system platform. ...", "line": 173, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.platform", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L173", "name": "platform", "path": "os.platform" }, { "id": "os.release", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system release.", "short_description": "Returns the operating system release.", "ellipsis_description": "Returns the operating system release. ...", "line": 184, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.release", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L184", "name": "release", "path": "os.release" }, { "id": "os.totalmem", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the total amount of system memory in bytes.", "short_description": "Returns the total amount of system memory in bytes.", "ellipsis_description": "Returns the total amount of system memory in bytes. ...", "line": 194, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.totalmem", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L194", "name": "totalmem", "path": "os.totalmem" }, { "id": "os.type", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the operating system name.", "short_description": "Returns the operating system name.", "ellipsis_description": "Returns the operating system name. ...", "line": 204, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.type", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L204", "name": "type", "path": "os.type" }, { "id": "os.uptime", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the system uptime in seconds.", "short_description": "Returns the system uptime in seconds.", "ellipsis_description": "Returns the system uptime in seconds. ...", "line": 214, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os.uptime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L214", "name": "uptime", "path": "os.uptime" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/os.markdown", "fileName": "os", "resultingFile": "os.html#os", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/os.markdown#L15", "name": "os", "path": "os" }, { "id": "path", "type": "class", "description": "\nThis module contains utilities for handling and transforming file paths. Add\n`require('path')` to your code to use this module.\n\nAlmost all these methods perform only string transformations. **The file system\nis not consulted to check whether paths are valid.** `path.exists` and\n`path.existsSync` are the exceptions, and should logically be found in the fs\nmodule as they do access the file system.\n\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThis module contains utilities for handling and transforming file paths. Add\n`require('path')` to your code to use this module.\n", "ellipsis_description": "\nThis module contains utilities for handling and transforming file paths. Add\n`require('path')` to your code to use ...", "line": 21, "aliases": [], "children": [ { "id": "path.basename", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] }, { "name": "ext", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" }, { "name": "ext", "types": [ "String" ], "description": "If provided, the extension to omit", "optional": true } ], "description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.ht\nml) command.\n\n#### Example\n\n", "short_description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.ht\nml) command.\n", "ellipsis_description": "Return the last portion of a path. Similar to the Unix\n[`basename`](http://www.kernel.org/doc/man-pages/online/page...", "line": 146, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.basename", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L146", "name": "basename", "path": "path.basename" }, { "id": "path.dirname", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" } ], "description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.htm\nl) command.\n\n#### Example\n\n", "short_description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pages/man3/basename.3.htm\nl) command.\n", "ellipsis_description": "Return the directory name of a path. Similar to the Unix\n[`dirname`](http://www.kernel.org/doc/man-pages/online/pag...", "line": 129, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.dirname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L129", "name": "dirname", "path": "path.dirname" }, { "id": "path.exists", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] }, { "name": "callback", "args": [ { "name": "exists", "type": [ "Boolean" ] } ], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "exists", "type": [ "Boolean" ] } ], "callback": true, "optional": true, "types": [ "Function" ] }, "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path to check" }, { "name": "callback", "types": [ "Function" ], "description": "A callback to execute once the method completes", "optional": true }, { "name": "exists", "types": [ "Boolean" ], "description": "This is `true` if the path actually exists" } ], "description": "Tests whether or not the given path exists by checking with the file system.\n\n#### Example\n\n", "short_description": "Tests whether or not the given path exists by checking with the file system.\n", "ellipsis_description": "Tests whether or not the given path exists by checking with the file system.\n ...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.exists", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L178", "name": "exists", "path": "path.exists" }, { "id": "path.existsSync", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path to check" } ], "description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n\n#### Returns\n`true` if the path exists, `false` otherwise.", "short_description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n", "ellipsis_description": "The synchronous version of `path.exists`. Tests whether or not the given path\nexists by checking with the file system\n ...", "line": 192, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.existsSync", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L192", "name": "existsSync", "path": "path.existsSync" }, { "id": "path.extname", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "A path" } ], "description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is no '.' in the last portion of the path or the\nfirst character of it is '.', then the method returns an empty string.\n\n#### Examples\n\n", "short_description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is no '.' in the last portion of the path or the\nfirst character of it is '.', then the method returns an empty string.\n", "ellipsis_description": "Return the extension of the path, from the last '.' to end of string in the last\nportion of the path. If there is n...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.extname", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L162", "name": "extname", "path": "path.extname" }, { "id": "path.join", "type": "class method", "signatures": [ { "args": [ { "name": "path1", "types": [ "String" ] }, { "name": "path2", "types": [ "String" ] }, { "name": "paths", "ellipsis": true, "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "path1", "types": [ "String" ], "description": "The first path to join" }, { "name": "path2", "types": [ "String" ], "description": "The second path to join" }, { "name": "paths", "types": [ "String" ], "description": "Additional paths to join", "optional": true } ], "description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n\n#### Example\n\n", "short_description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n", "ellipsis_description": "Join all arguments together and normalize the resulting path. Non-string\narguments are ignored.\n ...", "line": 55, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.join", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L55", "name": "join", "path": "path.join" }, { "id": "path.normalize", "type": "class method", "signatures": [ { "args": [ { "name": "p", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "p", "types": [ "String" ], "description": "The path to normalize" } ], "description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n\nWhen multiple slashes are found, they're replaced by a single one; when the path\ncontains a trailing slash, it is preserved. On Windows backslashes are used.\n\n#### Example\n\n", "short_description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n", "ellipsis_description": "Normalize a string path, taking care of `'..'` and `'.'` parts.\n ...", "line": 38, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.normalize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L38", "name": "normalize", "path": "path.normalize" }, { "id": "path.relative", "type": "class method", "signatures": [ { "args": [ { "name": "from", "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "The starting path" }, { "name": "to", "types": [ "String" ], "description": "To final path" } ], "description": "Solve the relative path from `from` to `to`.\n\nAt times, you have two absolute paths, and you need to derive the relative path\nfrom one to the other. This is actually the reverse transform of [[path.resolve\n`path.resolve()`]], which means you'll see that:\n\n path.resolve(from, path.relative(from, to)) == path.resolve(to)\n\n#### Example\n\n", "short_description": "Solve the relative path from `from` to `to`.\n", "ellipsis_description": "Solve the relative path from `from` to `to`.\n ...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.relative", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L113", "name": "relative", "path": "path.relative" }, { "id": "path.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "from", "ellipsis": true, "optional": true, "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "Paths to prepend (and append) to `to`", "optional": true }, { "name": "to", "types": [ "String" ], "description": "The path to resolve" } ], "description": "Resolves `to` to an absolute path.\n\nIf `to` isn't already absolute, the `from` arguments are prepended in right to\nleft order, until an absolute path is found. If, after using all the `from`\npaths still no absolute path is found, the current working directory is used as\nwell. The resulting path is normalized, and trailing slashes are removed unless\nthe path gets resolved to the root directory. Non-string arguments are ignored.\n\nAnother way to think of it is as a sequence of `cd` commands in a shell. The\nfollowing call:\n\n path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')\n\nis similar to:\n\n cd foo/bar\n cd /tmp/file/\n cd ..\n cd a/../subfile\n pwd\n\nThe difference is that the different paths don't need to exist and may also be\nfiles.\n\n#### Examples\n\n", "short_description": "Resolves `to` to an absolute path.\n", "ellipsis_description": "Resolves `to` to an absolute path.\n ...", "line": 92, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L92", "name": "resolve", "path": "path.resolve" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/path.markdown", "fileName": "path", "resultingFile": "path.html#path", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/path.markdown#L21", "name": "path", "path": "path" }, { "id": "process", "type": "class", "metadata": { "type": "global" }, "description": "The `process` object is a global object, and can be accessed from anywhere. It\nis an instance of [[eventemitter `EventEmitter`]].\n\n\n#### Example: Handling Signal Events\n\nSignal events are emitted when processes receive a signal. See\n[sigaction(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/sigaction.2\n.html) for a list of standard POSIX signal names such as SIGINT, SIGUSR1, etc.\n\n#### Example: Listening for `SIGINT`:\n\n", "short_description": "The `process` object is a global object, and can be accessed from anywhere. It\nis an instance of [[eventemitter `EventEmitter`]].\n", "ellipsis_description": "The `process` object is a global object, and can be accessed from anywhere. It\nis an instance of [[eventemitter `Eve...", "line": 21, "aliases": [], "children": [ { "id": "process.arch", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n\n#### Example\n\n", "short_description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n", "ellipsis_description": "Identifies which processor architecture you're running on: `'arm'`, `'ia32'`, or\n`'x64'`.\n ...", "line": 290, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.arch", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L290", "name": "arch", "path": "process.arch" }, { "id": "process.argv", "type": "class property", "signatures": [ { "returns": [ { "type": "Array" } ] } ], "description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of the Javascript file. The next elements\nwill be any additional command line arguments.\n\n#### Example\n\nFirst, create a file called process.argv.js:\n\n\n\nThen, using the Node.js REPL, type the following command:\n\n $ node process-2.js one two=three four\n\nYou should see the following results:\n\n 0: node\n 1: /process.js\n 2: one\n 3: two=three\n 4: four", "short_description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of the Javascript file. The next elements\nwill be any additional command line arguments.\n", "ellipsis_description": "An array containing the command line arguments. The first element is 'node',\nand the second element is the name of ...", "line": 320, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.argv", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L320", "name": "argv", "path": "process.argv" }, { "id": "process.chdir", "type": "class method", "signatures": [ { "args": [ { "name": "directory", "types": [ "String" ] } ] } ], "arguments": [ { "name": "directory", "types": [ "String" ], "description": "The directory name to change to" } ], "description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n\n#### Example\n\n console.log('Starting at directory: ' + process.cwd());\n try {\n process.chdir('/tmp');\n console.log('New directory: ' + process.cwd());\n }\n catch (err) {\n console.log('chdir failed: ' + err);\n }", "short_description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n", "ellipsis_description": "Changes the current working directory of the process or throws an exception if\nthat fails.\n ...", "line": 86, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.chdir", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L86", "name": "chdir", "path": "process.chdir" }, { "id": "process.cwd", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the current working directory of the process. For example:\n\n console.log('Current directory: ' + process.cwd());", "short_description": "Returns the current working directory of the process. For example:\n", "ellipsis_description": "Returns the current working directory of the process. For example:\n ...", "line": 99, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.cwd", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L99", "name": "cwd", "path": "process.cwd" }, { "id": "process.env", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/online/pages/man7/environ.7.html).", "short_description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/online/pages/man7/environ.7.html).", "ellipsis_description": "An object containing the user environment. For more information, see\n[environ(7)](http://kernel.org/doc/man-pages/on...", "line": 443, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.env", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L443", "name": "env", "path": "process.env" }, { "id": "process.execPath", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "This is the absolute pathname of the executable that started the process.\n\n#### Example\n\n", "short_description": "This is the absolute pathname of the executable that started the process.\n", "ellipsis_description": "This is the absolute pathname of the executable that started the process.\n ...", "line": 333, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.execPath", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L333", "name": "execPath", "path": "process.execPath" }, { "id": "process.exit", "type": "class method", "signatures": [ { "args": [ { "name": "code", "default_value": 0, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "code", "types": [ "Number" ], "description": "The code to end with" } ], "description": "Ends the process with the specified `code`.\n\n#### Example: Exiting with a 'failure' code:\n\n process.exit(1);\n\nThe shell that executed this should see the exit code as `1`.", "short_description": "Ends the process with the specified `code`.\n", "ellipsis_description": "Ends the process with the specified `code`.\n ...", "line": 116, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L116", "name": "exit", "path": "process.exit" }, { "id": "process.getgid", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, see\n[getgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getgid.2.html).\n\n#### Example\n\n", "short_description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, see\n[getgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getgid.2.html).\n", "ellipsis_description": "Gets the group identity of the process. This is the numerical group id, not the\ngroup name. For more information, se...", "line": 132, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.getgid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L132", "name": "getgid", "path": "process.getgid" }, { "id": "process.getuid", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more information, see\n[getuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getuid.2.html).\n\n#### Example\n\n", "short_description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more information, see\n[getuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/getuid.2.html).\n", "ellipsis_description": "Gets the user identity of the process. Note that this is the numerical userid,\nnot the username. For more informatio...", "line": 148, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.getuid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L148", "name": "getuid", "path": "process.getuid" }, { "id": "process.installPrefix", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A compiled-in property that exposes the `NODE_PREFIX`.\n\n#### Example\n\n", "short_description": "A compiled-in property that exposes the `NODE_PREFIX`.\n", "ellipsis_description": "A compiled-in property that exposes the `NODE_PREFIX`.\n ...", "line": 417, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.installPrefix", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L417", "name": "installPrefix", "path": "process.installPrefix" }, { "id": "process.kill", "type": "class method", "signatures": [ { "args": [ { "name": "pid", "types": [ "Number" ] }, { "name": "signal", "default_value": "SIGTERM", "types": [ "String" ] } ] } ], "arguments": [ { "name": "pid", "types": [ "Number" ], "description": "The process id to kill" }, { "name": "signal", "types": [ "String" ], "description": "A string describing the signal to send; the default is `SIGTERM`." } ], "description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[kill(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n\nNote: Just because the name of this function is `process.kill`, it is really just a signal sender, like the `kill` system call. The signal sent may do something other than kill the target process.\n\n#### Example: Sending a signal to yourself\n\n process.on('SIGHUP', function () {\n console.log('Got SIGHUP signal.');\n });\n\n setTimeout(function () {\n console.log('Exiting.');\n process.exit(0);\n }, 100);\n\n process.kill(process.pid, 'SIGHUP');", "short_description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[kill(2)](http://www.kernel.org/doc/man-pages/online/pages/man2/kill.2.html).\n", "ellipsis_description": "Send a signal to a process. The `signal` names are strings like 'SIGINT' or\n'SIGUSR1'. For more information, see\n[ki...", "line": 178, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.kill", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L178", "name": "kill", "path": "process.kill" }, { "id": "process.memoryUsage", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n\n#### Example\n\n\n\nThis generates:\n\n { rss: 4935680,\n heapTotal: 1826816,\n heapUsed: 650472 }\n\nIn this object, `heapTotal` and `heapUsed` refer to V8's memory usage.", "short_description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n", "ellipsis_description": "Returns an object describing the memory usage of the Node.js process measured in\nbytes.\n ...", "line": 201, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.memoryUsage", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L201", "name": "memoryUsage", "path": "process.memoryUsage" }, { "id": "process.nextTick", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "The callback function to execute on the next tick" } ], "description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it's much more efficient.\n\n#### Example\n\n", "short_description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it's much more efficient.\n", "ellipsis_description": "On the next loop around the event loop call this callback. This is **not** a\nsimple alias to `setTimeout(fn, 0)`; it...", "line": 216, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.nextTick", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L216", "name": "nextTick", "path": "process.nextTick" }, { "id": "process.pid", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Returns the PID of the process.\n\n#### Example\n\n", "short_description": "Returns the PID of the process.\n", "ellipsis_description": "Returns the PID of the process.\n ...", "line": 346, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.pid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L346", "name": "pid", "path": "process.pid" }, { "id": "process.platform", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n\n#### Example\n\n", "short_description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n", "ellipsis_description": "Identifies the platform you're running on, like `'linux2'`, `'darwin'`, etc.\n ...", "line": 359, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.platform", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L359", "name": "platform", "path": "process.platform" }, { "id": "process.setgid", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "id", "types": [ "Number" ], "description": "The new identity for the group process" } ], "description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is specified, this method blocks while\nresolving it to a numerical ID. For more information, see\n[setgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setgid.2.html).\n\n#### Example\n\n", "short_description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is specified, this method blocks while\nresolving it to a numerical ID. For more information, see\n[setgid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setgid.2.html).\n", "ellipsis_description": "Sets the group identity of the process. This accepts either a numerical ID or a\ngroupname string. If a groupname is ...", "line": 233, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.setgid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L233", "name": "setgid", "path": "process.setgid" }, { "id": "process.setuid", "type": "class method", "signatures": [ { "args": [ { "name": "id", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "id", "types": [ "Number" ], "description": "The new identity for the user process" } ], "description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is specified, this method blocks while resolving\nit to a numerical ID. For more information, see\n[setuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setuid.2.html).\n\n#### Example\n\n", "short_description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is specified, this method blocks while resolving\nit to a numerical ID. For more information, see\n[setuid(2)](http://kernel.org/doc/man-pages/online/pages/man2/setuid.2.html).\n", "ellipsis_description": "Sets the user identity of the process. This accepts either a numerical ID or a\nusername string. If a username is sp...", "line": 250, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.setuid", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L250", "name": "setuid", "path": "process.setuid" }, { "id": "process.stderr", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.WriteStream" } ] } ], "description": "A writable stream to stderr.\n\n`process.stderr` and `process.stdout` are unlike other streams in Node.js in\nthat writes to them are usually blocking. They are blocking in the case that\nthey refer to regular files or TTY file descriptors. In the case they refer to\npipes, they are non-blocking like other streams.", "short_description": "A writable stream to stderr.\n", "ellipsis_description": "A writable stream to stderr.\n ...", "line": 432, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stderr", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L432", "name": "stderr", "path": "process.stderr" }, { "id": "process.stdin", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.ReadStream" } ] } ], "description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to read from it.\n\n#### Example\n\nHere's an example of opening standard input and listening for both events:\n\n", "short_description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to read from it.\n", "ellipsis_description": "A `Readable Stream` for stdin. The stdin stream is paused by default, so one\nmust call `process.stdin.resume()` to r...", "line": 459, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stdin", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L459", "name": "stdin", "path": "process.stdin" }, { "id": "process.stdout", "type": "class property", "signatures": [ { "returns": [ { "type": "fs.WriteStream" } ] } ], "description": "A writable stream to `stdout`.\n\n`process.stderr` and `process.stdout` are unlike other streams in Node.js in\nthat writes to them are usually blocking. They are blocking in the case that\nthey refer to regular files or TTY file descriptors. In the case they refer to\npipes, they are non-blocking like other streams.\n\nAs an aside, here's what the innards of `console.log()` look like:\n\n console.log (d) {\n process.stdout.write(d + '\\n');\n };", "short_description": "A writable stream to `stdout`.\n", "ellipsis_description": "A writable stream to `stdout`.\n ...", "line": 481, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.stdout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L481", "name": "stdout", "path": "process.stdout" }, { "id": "process.title", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A getter and setter to set what is displayed in `ps`.", "short_description": "A getter and setter to set what is displayed in `ps`.", "ellipsis_description": "A getter and setter to set what is displayed in `ps`. ...", "line": 368, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.title", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L368", "name": "title", "path": "process.title" }, { "id": "process.umask", "type": "class method", "signatures": [ { "args": [ { "name": "mask", "optional": true, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "mask", "types": [ "Number" ], "description": "The mode creation mask to get or set", "optional": true } ], "description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Returns the old mask if `mask` argument is given,\notherwise returns the current mask.\n\n#### Example\n\n", "short_description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Returns the old mask if `mask` argument is given,\notherwise returns the current mask.\n", "ellipsis_description": "Sets or reads the process's file mode creation mask. Child processes inherit the\nmask from the parent process. Retur...", "line": 266, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.umask", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L266", "name": "umask", "path": "process.umask" }, { "id": "process.uptime", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Number" } ] } ], "description": "Returns the number of seconds Node.js has been running.", "short_description": "Returns the number of seconds Node.js has been running.", "ellipsis_description": "Returns the number of seconds Node.js has been running. ...", "line": 276, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.uptime", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L276", "name": "uptime", "path": "process.uptime" }, { "id": "process.version", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "A compiled-in property that exposes the `NODE_VERSION`.\n\n#### Example\n\n", "short_description": "A compiled-in property that exposes the `NODE_VERSION`.\n", "ellipsis_description": "A compiled-in property that exposes the `NODE_VERSION`.\n ...", "line": 381, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.version", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L381", "name": "version", "path": "process.version" }, { "id": "process.versions", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "A property exposing version strings of Node.js and its dependencies.\n\n#### Example\n\nThe following code:\n\n\n\noutputs something similar to:\n\n { node: '0.4.12',\n v8: '3.1.8.26',\n ares: '1.7.4',\n ev: '4.4',\n openssl: '1.0.0e-fips' }", "short_description": "A property exposing version strings of Node.js and its dependencies.\n", "ellipsis_description": "A property exposing version strings of Node.js and its dependencies.\n ...", "line": 404, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process.versions", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L404", "name": "versions", "path": "process.versions" }, { "id": "process@exit", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's state (like for unit tests). The main\nevent loop will no longer be run after the `exit` callback finishes, so timers\nmay not be scheduled.\n\n#### Example: Listening for an `'exit'` event:\n\n process.on('exit', function () {\n process.nextTick(function () {\n console.log('This will not run');\n });\n console.log('About to exit.');\n });", "short_description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's state (like for unit tests). The main\nevent loop will no longer be run after the `exit` callback finishes, so timers\nmay not be scheduled.\n", "ellipsis_description": "Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module's stat...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process@exit", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L43", "name": "exit", "path": "process.event.exit" }, { "id": "process@uncaughtException", "type": "event", "signatures": [ { "args": [ { "name": "err", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "err", "types": [ "Error" ], "description": "The standard Error Object" } ], "description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the default action (which is to print a\nstack trace and exit) won't occur.\n\n#### Example: Listening for an `'uncaughtException'`:\n\n\n\nNote: An `uncaughtException` is a very crude mechanism for exception handling. Using `try / catch` in your program gives you more control over your program's flow. Especially for server programs that are designed to stay running forever, `uncaughtException` can be a useful safety mechanism.", "short_description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the default action (which is to print a\nstack trace and exit) won't occur.\n", "ellipsis_description": "Emitted when an exception bubbles all the way back to the event loop. If a\nlistener is added for this exception, the...", "line": 63, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process@uncaughtException", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L63", "name": "uncaughtException", "path": "process.event.uncaughtException" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/process.markdown", "fileName": "process", "resultingFile": "process.html#process", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/process.markdown#L21", "name": "process", "path": "process" }, { "id": "querystring", "type": "class", "description": "\nThis module provides utilities for dealing with query strings in URLs. To\ninclude this module, add `require('querystring')` to your code.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThis module provides utilities for dealing with query strings in URLs. To\ninclude this module, add `require('querystring')` to your code.\n", "ellipsis_description": "\nThis module provides utilities for dealing with query strings in URLs. To\ninclude this module, add `require('querys...", "line": 15, "aliases": [], "children": [ { "id": "querystring.escape", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary.", "short_description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary.", "ellipsis_description": "The escape function used by `querystring.stringify()`, provided so that it can\nbe overridden, if necessary. ...", "line": 26, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.escape", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L26", "name": "escape", "path": "querystring.escape" }, { "id": "querystring.parse", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] }, { "name": "sep", "default_value": "&", "optional": true, "types": [ "String" ] }, { "name": "eq", "default_value": "=", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The query string to parse" }, { "name": "sep", "types": [ "String" ], "description": "The separator character", "optional": true }, { "name": "eq", "types": [ "String" ], "description": "The equivalency character", "optional": true } ], "description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignment characters.\n\n#### Example\n\n", "short_description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignment characters.\n", "ellipsis_description": "Deserialize a query string to an object and returns it. You can choose to\noverride the default separator and assignm...", "line": 43, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.parse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L43", "name": "parse", "path": "querystring.parse" }, { "id": "querystring.stringify", "type": "class method", "signatures": [ { "args": [ { "name": "obj", "types": [ "Object" ] }, { "name": "sep", "default_value": "&", "optional": true, "types": [ "String" ] }, { "name": "eq", "default_value": "=", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "obj", "types": [ "Object" ], "description": "The JSON object to serialize" }, { "name": "sep", "types": [ "String" ], "description": "The separator character", "optional": true }, { "name": "eq", "types": [ "String" ], "description": "The equivalency character", "optional": true } ], "description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignment characters.\n\n#### Examples\n\n", "short_description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignment characters.\n", "ellipsis_description": "Serialize an object to a query string and returns it. You can choose to override\nthe default separator and assignmen...", "line": 59, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.stringify", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L59", "name": "stringify", "path": "querystring.stringify" }, { "id": "querystring.unescape", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary.", "short_description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary.", "ellipsis_description": "The `unescape()` function, used by `querystring.parse()`, is provided so that it\ncan be overridden if necessary. ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring.unescape", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L71", "name": "unescape", "path": "querystring.unescape" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/querystring.markdown", "fileName": "querystring", "resultingFile": "querystring.html#querystring", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/querystring.markdown#L15", "name": "querystring", "path": "querystring" }, { "id": "readline", "type": "class", "description": "\nReadline allows you to read of a stream (such as STDIN) on a line-by-line basis.\nTo use this module, add `require('readline')` to your code.\n\nNote: Once you've invoked this module, your Node.js program won't terminate until you've closed the interface, and the STDIN stream. Here's how to allow your program to gracefully terminate:\n\n\n\n\n#### Example: Crafting a tiny command line interface:\n\n\n\nFor more real-life use cases, take a look at this slightly more complicated\n[example](https://gist.github.com/901104), as well as the\n[http-console](https://github.com/cloudhead/http-console) module.", "stability": "3 - Stable", "short_description": "\nReadline allows you to read of a stream (such as STDIN) on a line-by-line basis.\nTo use this module, add `require('readline')` to your code.\n", "ellipsis_description": "\nReadline allows you to read of a stream (such as STDIN) on a line-by-line basis.\nTo use this module, add `require('...", "line": 24, "aliases": [], "children": [ { "id": "readline.createInterface", "type": "class method", "signatures": [ { "args": [ { "name": "input", "types": [ "streams.ReadableStream" ] }, { "name": "output", "optional": true, "types": [ "streams.WritableStream" ] }, { "name": "completer", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "completer", "args": [], "callback": true, "types": [ "Function" ] }, "returns": [ { "type": "readline.interface" } ] } ], "arguments": [ { "name": "input", "types": [ "streams.ReadableStream" ], "description": "The readable stream" }, { "name": "output", "types": [ "streams.WritableStream" ], "description": "The writeable stream", "optional": true }, { "name": "completer", "types": [ "Function" ], "description": "A function to use for autocompletion" } ], "description": "Takes two streams and creates a readline interface.\n\nWhen passed a substring, `completer()` returns `[[substr1, substr2, ...],\noriginalsubstring]`.\n\n`completer()` runs in an asynchronous manner if it accepts just two arguments:\n\n function completer(linePartial, callback) {\n callback(null, [['123'], linePartial]);\n }\n\n#### Example\n\n`createInterface()` is commonly used with `process.stdin` and `process.stdout`\nin order to accept user input:\n\n var readline = require('readline');\n\n var myTerminal = readline.createInterface(process.stdin, process.stdout);", "short_description": "Takes two streams and creates a readline interface.\n", "ellipsis_description": "Takes two streams and creates a readline interface.\n ...", "line": 54, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.createInterface", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L54", "name": "createInterface", "path": "readline.createInterface" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline", "subclasses": [ "readline.interface" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L24", "name": "readline", "path": "readline" }, { "id": "readline.interface", "type": "class", "superclass": "readline", "description": "The class that represents a readline interface with a stdin and stdout stream.", "short_description": "The class that represents a readline interface with a stdin and stdout stream.", "ellipsis_description": "The class that represents a readline interface with a stdin and stdout stream. ...", "line": 62, "aliases": [], "children": [ { "id": "readline.interface.close", "type": "class method", "signatures": [ { "args": [ { "name": "line" } ] } ], "description": "Closes the `tty`. Without this call, your program will run indefinitely.", "short_description": "Closes the `tty`. Without this call, your program will run indefinitely.", "ellipsis_description": "Closes the `tty`. Without this call, your program will run indefinitely. ...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L80", "name": "close", "path": "readline.interface.close" }, { "id": "readline.interface.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pauses the `tty`.", "short_description": "Pauses the `tty`.", "ellipsis_description": "Pauses the `tty`. ...", "line": 71, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L71", "name": "pause", "path": "readline.interface.pause" }, { "id": "readline.interface.prompt", "type": "class method", "signatures": [ { "args": [] } ], "description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user a new spot to write.", "short_description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user a new spot to write.", "ellipsis_description": "Readies the readline for input from the user, putting the current `setPrompt`\noptions on a new line, giving the user...", "line": 91, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.prompt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L91", "name": "prompt", "path": "readline.interface.prompt" }, { "id": "readline.interface.question", "type": "class method", "signatures": [ { "args": [ { "name": "query", "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "query", "types": [ "String" ], "description": "A string to display the user" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" } ], "description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n\n#### Example\n\n readline.interface.question('What is your favorite food?', function(answer)\n{\n console.log('Oh, so your favorite food is ' + answer);\n });", "short_description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n", "ellipsis_description": "Prepends the prompt with `query` and invokes `callback` with the user's respons\nafter it has been entered.\n ...", "line": 112, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.question", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L112", "name": "question", "path": "readline.interface.question" }, { "id": "readline.interface.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes `tty`.", "short_description": "Resumes `tty`.", "ellipsis_description": "Resumes `tty`. ...", "line": 122, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L122", "name": "resume", "path": "readline.interface.resume" }, { "id": "readline.interface.setPrompt", "type": "class method", "signatures": [ { "args": [ { "name": "prompt", "types": [ "String" ] }, { "name": "length", "types": [ "String" ] } ] } ], "arguments": [ { "name": "prompt", "types": [ "String" ], "description": "The prompting character; this can also be a phrase" }, { "name": "length", "types": [ "String" ], "description": "The length before line wrapping" } ], "description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's prompt.", "short_description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's prompt.", "ellipsis_description": "Sets the prompt character. For example, when you run `node` on the command line,\nyou'll see `> `, which is Node's pr...", "line": 135, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.setPrompt", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L135", "name": "setPrompt", "path": "readline.interface.setPrompt" }, { "id": "readline.interface.write", "type": "class method", "signatures": [ { "args": [] } ], "description": "Writes to the `tty`.", "short_description": "Writes to the `tty`.", "ellipsis_description": "Writes to the `tty`. ...", "line": 144, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L144", "name": "write", "path": "readline.interface.write" }, { "id": "readline.interface@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is finished using your program.\n\n#### Example\n\nExample of listening for `close`, and exiting the program afterward:\n\n", "short_description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is finished using your program.\n", "ellipsis_description": "Emitted whenever the `in` stream receives a `^C` (`SIGINT`) or `^D` (`EOT`).\nThis is a good way to know the user is ...", "line": 161, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L161", "name": "close", "path": "readline.interface.event.close" }, { "id": "readline.interface@line", "type": "event", "signatures": [ { "args": [ { "name": "line", "types": [ "String" ] } ] } ], "arguments": [ { "name": "line", "types": [ "String" ], "description": "The line that prompted the event" } ], "description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a good hook to listen for user input.\n\n#### Example\n\n", "short_description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a good hook to listen for user input.\n", "ellipsis_description": "Emitted whenever the `in` stream receives a `\\n`, usually received when the user\nhits Enter, or Return. This is a go...", "line": 174, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface@line", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L174", "name": "line", "path": "readline.interface.event.line" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/readline.markdown", "fileName": "readline", "resultingFile": "readline.html#readline.interface", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/readline.markdown#L62", "name": "interface", "path": "readline.interface" }, { "id": "repl", "type": "class", "description": "A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. REPL provides a way to interactively run\nJavascript and see the results. It can be used for debugging, testing, or just\ntrying things out.\n\nBy executing `node` without any arguments from the command line, you'll be\ndropped into the REPL. It has a simplistic emacs line-editing:\n\n mjr:~$ node\n Type '.help' for options.\n > a = [ 1, 2, 3];\n [ 1, 2, 3 ]\n > a.forEach(function (v) {\n ... console.log(v);\n ... });\n 1\n 2\n 3\n\nFor advanced line-editors, start `node` with the environmental variable\n`NODE_NO_READLINE=1`. This starts the REPL in canonical terminal settings which\nallow you to use with `rlwrap`.\n\nFor a quicker configuration, you could add this to your `.bashrc` file:\n\n alias node=\"env NODE_NO_READLINE=1 rlwrap node\"\n\n#### REPL Features\n\nInside the REPL, multi-line expressions can be input, and tab completion is\nsupported for both global and local variables.\n\nThe special variable `_` contains the result of the last expression, like so:\n\n > [ \"a\", \"b\", \"c\" ]\n [ 'a', 'b', 'c' ]\n > _.length\n 3\n > _ += 1\n 4\n\nThe REPL provides access to any variables in the global scope. You can expose a\nvariable to the REPL explicitly by assigning it to the `context` object\nassociated with each `REPLServer`. For example:\n\n // repl_test.js\n var repl = require(\"repl\"),\n msg = \"message\";\n\n repl.start().context.m = msg;\n\nThings in the `context` object appear as local within the REPL:\n\n mjr:~$ node repl_test.js\n > m\n 'message'\n\n#### Special Commands\n\nThere are a few special REPL commands:\n\n - `.break`: while inputting a multi-line expression, sometimes you get lost or\njust don't care about completing it; this wipes it out so you can start over\n - `.clear`: resets the `context` object to an empty object and clears any\nmulti-line expression.\n - `.exit`: closes the I/O stream, which causes the REPL to exit.\n - `.help`: shows this list of special commands\n - `.save`: save the current REPL session to a file, like so: `>.save\n./file/to/save.js`\n - `.load`: loads a file into the current REPL session, like so: `>.load\n./file/to/load.js`\n\n#### Key Combinations\n\nThe following key combinations in the REPL have special effects:\n\n - `C` - Similar to the `.break` keyword, this terminates the current\ncommand. Press twice on a blank line to forcibly exit the REPL.\n - `D` - Similar to the `.exit` keyword, it closes to stream and exits\nthe REPL", "short_description": "A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. REPL provides a way to interactively run\nJavascript and see the results. It can be used for debugging, testing, or just\ntrying things out.\n", "ellipsis_description": "A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. RE...", "line": 87, "aliases": [], "children": [ { "id": "repl.start", "type": "class method", "signatures": [ { "args": [ { "name": "prompt", "default_value": "> ", "optional": true, "types": [ "String" ] }, { "name": "stream", "default_value": "process.stdin", "optional": true, "types": [ "String" ] }, { "name": "eval", "default_value": "eval", "optional": true, "types": [ "String" ] }, { "name": "useGlobal", "default_value": false, "optional": true, "types": [ "String" ] }, { "name": "ignoreUndefined", "default_value": false, "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "prompt", "types": [ "String" ], "description": "The starting prompt", "optional": true }, { "name": "stream", "types": [ "String" ], "description": "The stream to read from", "optional": true }, { "name": "eval", "types": [ "String" ], "description": "An asynchronous wrapper function that executes after each line", "optional": true }, { "name": "useGlobal", "types": [ "String" ], "description": "If `true`, then the REPL uses the global objectm instead of scripts in a separate context", "optional": true }, { "name": "ignoreUndefined", "types": [ "String" ], "description": "If `true`, the REPL won't output return valyes of a command if it's `undefined`", "optional": true } ], "description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n\nYou can use your own `eval` function if it has the following signature:\n\n function eval(cmd, callback) {\n callback(null, result);\n }\n\nMultiple REPLs can be started against the same running instance of node. Each\nshare the same global object but will have unique I/O.\n\n#### Example\n\nHere's an example that starts a REPL on stdin, a Unix socket, and a TCP socket:\n\n var net = require(\"net\"),\n repl = require(\"repl\");\n\n connections = 0;\n\n repl.start(\"node via stdin> \");\n\n net.createServer(function (socket) {\n connections += 1;\n repl.start(\"node via Unix socket> \", socket);\n }).listen(\"/tmp/node-repl-sock\");\n\n net.createServer(function (socket) {\n connections += 1;\n repl.start(\"node via TCP socket> \", socket);\n }).listen(5001);", "short_description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n", "ellipsis_description": "Starts a REPL with `prompt` as the prompt and `stream` for all I/O.\n ...", "line": 133, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/repl.markdown", "fileName": "repl", "resultingFile": "repl.html#repl.start", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/repl.markdown#L133", "name": "start", "path": "repl.start" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/repl.markdown", "fileName": "repl", "resultingFile": "repl.html#repl", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/repl.markdown#L87", "name": "repl", "path": "repl" }, { "id": "socket", "type": "class", "superclass": "dgram", "description": "The dgram Socket class encapsulates the datagram functionality. It should be\ncreated via `dgram.createSocket(type, [callback])`.", "short_description": "The dgram Socket class encapsulates the datagram functionality. It should be\ncreated via `dgram.createSocket(type, [callback])`.", "ellipsis_description": "The dgram Socket class encapsulates the datagram functionality. It should be\ncreated via `dgram.createSocket(type, ...", "line": 201, "aliases": [], "children": [ { "id": "socket@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this socket.", "short_description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this socket.", "ellipsis_description": "Emitted when a socket is closed with [[dgram.close `dgram.close()`]]. No new\n`message` events are emitted on this s...", "line": 227, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L227", "name": "close", "path": "socket.event.close" }, { "id": "socket@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The error that was encountered" } ], "description": "Emitted when an error occurs.", "short_description": "Emitted when an error occurs.", "ellipsis_description": "Emitted when an error occurs. ...", "line": 235, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L235", "name": "error", "path": "socket.event.error" }, { "id": "socket@listening", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created.", "short_description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created.", "ellipsis_description": "Emitted when a socket starts listening for datagrams. This happens as soon as\nUDP sockets are created. ...", "line": 219, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L219", "name": "listening", "path": "socket.event.listening" }, { "id": "socket@message", "type": "event", "signatures": [ { "args": [ { "name": "msg", "types": [ "Buffer" ] }, { "name": "rinfo", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "msg", "types": [ "Buffer" ], "description": "A `Buffer` of information" }, { "name": "rinfo", "types": [ "Object" ], "description": "An object with the sender's address information and the number of bytes in the datagram." } ], "description": "Emitted when a new datagram is available on a socket.", "short_description": "Emitted when a new datagram is available on a socket.", "ellipsis_description": "Emitted when a new datagram is available on a socket. ...", "line": 211, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket@message", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L211", "name": "message", "path": "socket.event.message" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/dgram.markdown", "fileName": "dgram", "resultingFile": "dgram.html#socket", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/dgram.markdown#L201", "name": "socket", "path": "socket" }, { "id": "streams", "type": "class", "description": "\nA stream is an abstract interface implemented by various objects in Node.js. For\nexample, a request to an HTTP server is a stream, as is stdout. Streams can be\nreadable, writable, or both. All streams are instances of [[eventemitter\n`EventEmitter`]].\n\nFor more information, see [this article on understanding\nstreams](../nodejs_dev_guide/understanding_streams.html).\n\n#### Example: Printing to the console\n\n\n\n#### Example: Reading from the console\n\n", "stability": "2 - Unstable", "short_description": "\nA stream is an abstract interface implemented by various objects in Node.js. For\nexample, a request to an HTTP server is a stream, as is stdout. Streams can be\nreadable, writable, or both. All streams are instances of [[eventemitter\n`EventEmitter`]].\n", "ellipsis_description": "\nA stream is an abstract interface implemented by various objects in Node.js. For\nexample, a request to an HTTP serv...", "line": 23, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams", "subclasses": [ "streams.ReadableStream", "streams.WritableStream" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L23", "name": "streams", "path": "streams" }, { "id": "streams.ReadableStream", "type": "class", "superclass": "streams", "description": "", "short_description": "", "ellipsis_description": " ...", "line": 30, "aliases": [], "children": [ { "id": "streams.ReadableStream.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Closes the underlying file descriptor. The stream will not emit any more events.", "short_description": "Closes the underlying file descriptor. The stream will not emit any more events.", "ellipsis_description": "Closes the underlying file descriptor. The stream will not emit any more events. ...", "line": 94, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L94", "name": "destroy", "path": "streams.ReadableStream.destroy" }, { "id": "streams.ReadableStream.pause", "type": "class method", "signatures": [ { "args": [] } ], "description": "Pause any incoming `'data'` events.", "short_description": "Pause any incoming `'data'` events.", "ellipsis_description": "Pause any incoming `'data'` events. ...", "line": 104, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L104", "name": "pause", "path": "streams.ReadableStream.pause" }, { "id": "streams.ReadableStream.pipe", "type": "class method", "signatures": [ { "args": [ { "name": "destination", "types": [ "streams.WritableStream" ] }, { "name": "options", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "streams" } ] } ], "arguments": [ { "name": "destination", "types": [ "streams.WritableStream" ], "description": "The WriteStream to connect to" }, { "name": "options", "types": [ "Object" ], "description": "Any optional commands to send", "optional": true } ], "description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destination`. Incoming data on this stream is\nthen written to `destination`. The destination and source streams are kept in\nsync by Node.js pausing and resuming as necessary.\n\nThis function returns the `destination` stream.\n\nBy default, `end()` is called on the destination when the source stream emits\n`end`, so that `destination` is no longer writable. Pass `{ end: false }` into\n`options` to keep the destination stream open.\n\n#### Example\n\nEmulating the Unix `cat` command:\n\n process.stdin.resume(); // process.stdin is paused by default, so we need to\nstart it up\n process.stdin.pipe(process.stdout); // type something into the console &\nwatch it repeat\n\nThis keeps `process.stdout` open so that \"Goodbye\" can be written at the end.\n\n process.stdin.resume();\n\n process.stdin.pipe(process.stdout, { end: false });\n\n process.stdin.on(\"end\", function() {\n process.stdout.write(\"Goodbye\\n\");\n });\n\n\n\n\n/** related to: streams.ReadableStream.data\nstreams.ReadableStream.setEncoding(encoding)\n- encoding {String} The encoding to use; this can be `'utf8'`, `'ascii'`, or\n`'base64'`.\n\nMakes the `data` event emit a string instead of a `Buffer`.", "short_description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destination`. Incoming data on this stream is\nthen written to `destination`. The destination and source streams are kept in\nsync by Node.js pausing and resuming as necessary.\n", "ellipsis_description": "This is the `Stream.prototype()` method available on all `Stream` objects. It\nconnects this read stream to a `destin...", "line": 154, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.pipe", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L154", "name": "pipe", "path": "streams.ReadableStream.pipe" }, { "id": "streams.ReadableStream.resume", "type": "class method", "signatures": [ { "args": [] } ], "description": "Resumes the incoming `'data'` events after a `pause()`.", "short_description": "Resumes the incoming `'data'` events after a `pause()`.", "ellipsis_description": "Resumes the incoming `'data'` events after a `pause()`. ...", "line": 163, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream.resume", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L163", "name": "resume", "path": "streams.ReadableStream.resume" }, { "id": "streams.ReadableStream@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HTTP request don't emit `close`.", "short_description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HTTP request don't emit `close`.", "ellipsis_description": "Emitted when the underlying file descriptor has been closed. Not all streams\nemit this. For example, an incoming HT...", "line": 41, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L41", "name": "close", "path": "streams.ReadableStream.event.close" }, { "id": "streams.ReadableStream@data", "type": "event", "signatures": [ { "args": [ { "name": "data", "types": [ "Buffer", "String" ] } ] } ], "arguments": [ { "name": "data", "types": [ "Buffer", "String" ], "description": "The data being emitted" } ], "description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream.", "short_description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream.", "ellipsis_description": "The `data` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was previously used on the stream. ...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@data", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L53", "name": "data", "path": "streams.ReadableStream.event.data" }, { "id": "streams.ReadableStream@end", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happen. If the stream is also writable, it may\nbe possible to continue writing.", "short_description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happen. If the stream is also writable, it may\nbe possible to continue writing.", "ellipsis_description": "Emitted when the stream has received an EOF (FIN in TCP terminology). Indicates\nthat no more `data` events will happ...", "line": 65, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L65", "name": "end", "path": "streams.ReadableStream.event.end" }, { "id": "streams.ReadableStream@error", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted if there was an error receiving data.", "short_description": "Emitted if there was an error receiving data.", "ellipsis_description": "Emitted if there was an error receiving data. ...", "line": 74, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L74", "name": "error", "path": "streams.ReadableStream.event.error" }, { "id": "streams.ReadableStream@pipe", "type": "event", "signatures": [ { "args": [ { "name": "src", "types": [ "streams.ReadableStream" ] } ] } ], "arguments": [ { "name": "src", "types": [ "streams.ReadableStream" ], "description": "The readable stream" } ], "description": "Emitted when the stream is passed to a readable stream's pipe method.", "short_description": "Emitted when the stream is passed to a readable stream's pipe method.", "ellipsis_description": "Emitted when the stream is passed to a readable stream's pipe method. ...", "line": 85, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream@pipe", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L85", "name": "pipe", "path": "streams.ReadableStream.event.pipe" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.ReadableStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L30", "name": "ReadableStream", "path": "streams.ReadableStream" }, { "id": "streams.WritableStream", "type": "class", "superclass": "streams", "description": "", "short_description": "", "ellipsis_description": " ...", "line": 170, "aliases": [], "children": [ { "id": "streams.WritableStream.destroy", "type": "class method", "signatures": [ { "args": [] } ], "description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent.", "short_description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent.", "ellipsis_description": "Closes the underlying file descriptor. The stream doesn't emit any more events.\nAny queued write data is not sent. ...", "line": 225, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L225", "name": "destroy", "path": "streams.WritableStream.destroy" }, { "id": "streams.WritableStream.destroySoon", "type": "class method", "signatures": [ { "args": [] } ], "description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, as long as there is no data\nleft in the queue for writes.", "short_description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, as long as there is no data\nleft in the queue for writes.", "ellipsis_description": "After the write queue is drained, this closes the file descriptor.\n`destroySoon()` can still destroy straight away, ...", "line": 237, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.destroySoon", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L237", "name": "destroySoon", "path": "streams.WritableStream.destroySoon" }, { "id": "streams.WritableStream.end", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The message to send" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to send" } ], "description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n\nFor `streams.WritableStream.end(string, encoding)`, a `string` with the given\n`encoding` is sent. This is useful to reduce the number of packets sent.\n\nFor `streams.WritableStream.end(Buffer)`, a `buffer` is sent.", "short_description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n", "ellipsis_description": "Terminates the stream with EOF or FIN. This call send queued write data before\nclosing the stream.\n ...", "line": 258, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.end", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L258", "name": "end", "path": "streams.WritableStream.end" }, { "id": "streams.WritableStream.writable", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`, or if `destroy()` was called.", "short_description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`, or if `destroy()` was called.", "ellipsis_description": "A boolean that is `true` by default, but turns `false` after an `error` event\noccurs, the stream comes to an `'end'`...", "line": 180, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.writable", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L180", "name": "writable", "path": "streams.WritableStream.writable" }, { "id": "streams.WritableStream.write", "type": "class method", "signatures": [ {} ], "arguments": [ { "name": "string", "types": [ "String" ], "description": "The string to write" }, { "name": "encoding", "types": [ "String" ], "description": "The encoding to use; defaults to `utf8`" }, { "name": "fd", "types": [ "Number" ], "description": "An optional file descriptor to pass" }, { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to write to" } ], "description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been flushed to the kernel buffer. Returns\n`false` to indicate that the kernel buffer is full, and the data will be sent\nout in the future. The `drain` event indicates when the kernel buffer is empty\nagain.\n\nIf `fd` is specified, it's interpreted as an integral file descriptor to be sent\nover the stream. This is only supported for UNIX streams, and is ignored\notherwise. When writing a file descriptor in this manner, closing the descripton\nbefore the stream drains risks sending an invalid (closed) FD.", "short_description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been flushed to the kernel buffer. Returns\n`false` to indicate that the kernel buffer is full, and the data will be sent\nout in the future. The `drain` event indicates when the kernel buffer is empty\nagain.\n", "ellipsis_description": "Writes `string` with the given `encoding` to the stream, or write `buffer`.\nReturns `true` if the string has been fl...", "line": 283, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L283", "name": "write", "path": "streams.WritableStream.write" }, { "id": "streams.WritableStream@close", "type": "event", "signatures": [ { "args": [] } ], "description": "Emitted when the underlying file descriptor has been closed.", "short_description": "Emitted when the underlying file descriptor has been closed.", "ellipsis_description": "Emitted when the underlying file descriptor has been closed. ...", "line": 192, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L192", "name": "close", "path": "streams.WritableStream.event.close" }, { "id": "streams.WritableStream@drain", "type": "event", "signatures": [ { "args": [] } ], "description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again.", "short_description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again.", "ellipsis_description": "After a `write()` method returns `false`, this event is emitted to indicate that\nit is safe to write again. ...", "line": 203, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@drain", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L203", "name": "drain", "path": "streams.WritableStream.event.drain" }, { "id": "streams.WritableStream@error", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The exception that was received" } ], "description": "Emitted when there's an error with the exception `exception`.", "short_description": "Emitted when there's an error with the exception `exception`.", "ellipsis_description": "Emitted when there's an error with the exception `exception`. ...", "line": 214, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream@error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L214", "name": "error", "path": "streams.WritableStream.event.error" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/stream.markdown", "fileName": "stream", "resultingFile": "stream.html#streams.WritableStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/stream.markdown#L170", "name": "WritableStream", "path": "streams.WritableStream" }, { "id": "string_decoder", "type": "class", "description": "\nStringDecoder decodes a [[Buffer buffer]] to a string. It is a simple interface\n to `buffer.toString()` but provides additional support for utf8.\n\n To use this module, add `require('string_decoder')` to your code.\n\n #### Example\n\n", "stability": "3 - Stable", "short_description": "\nStringDecoder decodes a [[Buffer buffer]] to a string. It is a simple interface\n to `buffer.toString()` but provides additional support for utf8.\n", "ellipsis_description": "\nStringDecoder decodes a [[Buffer buffer]] to a string. It is a simple interface\n to `buffer.toString()` but provide...", "line": 16, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/string_decoder.markdown", "fileName": "string_decoder", "resultingFile": "string_decoder.html#string_decoder", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/string_decoder.markdown#L16", "name": "string_decoder", "path": "string_decoder" }, { "id": "new StringDecoder", "type": "constructor", "signatures": [ { "args": [ { "name": "encoding", "default_value": "utf8", "types": [ "String" ] } ] } ], "arguments": [ { "name": "encoding", "types": [ "String" ], "description": "The encoding that the string is in" } ], "description": "Creates a new `StringDecoder`.", "short_description": "Creates a new `StringDecoder`.", "ellipsis_description": "Creates a new `StringDecoder`. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/string_decoder.markdown", "fileName": "string_decoder", "resultingFile": "string_decoder.html#StringDecoder.new", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/string_decoder.markdown#L24", "name": "new", "path": "StringDecoder.new" }, { "id": "StringDecoder.write", "type": "class method", "signatures": [ { "args": [ { "name": "buffer", "types": [ "Buffer" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "buffer", "types": [ "Buffer" ], "description": "The buffer to convert (related to: buffer.toString)" } ], "description": "Returns a decoded string.", "short_description": "Returns a decoded string.", "ellipsis_description": "Returns a decoded string. ...", "line": 32, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/string_decoder.markdown", "fileName": "string_decoder", "resultingFile": "string_decoder.html#StringDecoder.write", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/string_decoder.markdown#L32", "name": "write", "path": "StringDecoder.write" }, { "id": "timer", "type": "class", "metadata": { "type": "global" }, "description": "\nThe timer functions are useful for scheduling functions to run after a defined\namount of time. All of the objects in this class are global; the method calls\ndon't need to be prepended with an object name.\n\nIt's important to note that your callback probably *won't* be called in exactly\n`delay` milliseconds. Node.js makes no guarantees about the exact timing of when\nthe callback is fired, nor of the ordering things will fire in. The callback is\ncalled as close as possible to the time specified.\n\nThe difference between ``setInterval()` and `setTimeout()` is simple:\n`setTimeout()` executes a function after a certain period of time, while\n`setInterval()` executes a function, then after a set period of time, executes\nthe function again, then waits again, and executes again. This continues until\n`clearInterval()` is called.\n\n\n#### Example: The Wrong Way to use Timers\n\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t setTimeout(function () {\n\t\t console.log(i);\n\t\t }, i);\n\t\t }\n\nThe code above prints the number `5` five times. This happens because the loop\nfills up before the first `setTimeout()` is called.\n\n#### Example: The Right Way to use Timers\n\nThe solution to the above problem is to create a\n[closure](http://stackoverflow.com/questions/1801957/what-exactly-does-closure-r\nefer-to-in-javascript) so that the current value of `i` is stored:\n\n for (var i = 0; i < 5; i++) {\n (\n function(i) {\n setTimeout(function () {\n console.log(i);\n }, i);\n }\n )(i)};", "stability": "5 - Locked", "short_description": "\nThe timer functions are useful for scheduling functions to run after a defined\namount of time. All of the objects in this class are global; the method calls\ndon't need to be prepended with an object name.\n", "ellipsis_description": "\nThe timer functions are useful for scheduling functions to run after a defined\namount of time. All of the objects i...", "line": 54, "aliases": [], "children": [ { "id": "timer.clearInterval", "type": "class method", "signatures": [ { "args": [ { "name": "intervalId", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "intervalId", "types": [ "Number" ], "description": "The id of the interval" } ], "description": "Stops a interval from triggering.", "short_description": "Stops a interval from triggering.", "ellipsis_description": "Stops a interval from triggering. ...", "line": 66, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.clearInterval", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L66", "name": "clearInterval", "path": "timer.clearInterval" }, { "id": "timer.clearTimeout", "type": "class method", "signatures": [ { "args": [ { "name": "timeoutId", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "timeoutId", "types": [ "Number" ], "description": "The id of the timeout" } ], "description": "Prevents a timeout from triggering.", "short_description": "Prevents a timeout from triggering.", "ellipsis_description": "Prevents a timeout from triggering. ...", "line": 77, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.clearTimeout", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L77", "name": "clearTimeout", "path": "timer.clearTimeout" }, { "id": "timer.setInterval", "type": "class method", "signatures": [ { "args": [ { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] }, { "name": "delay", "types": [ "Number" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "Object" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "callback", "types": [ "Function" ], "description": "The callback function to execute" }, { "name": "delay", "types": [ "Number" ], "description": "The delay (in milliseconds) before executing the callback" }, { "name": "arg", "types": [ "Object" ], "description": "Any optional arguments to pass the to callback", "optional": true } ], "description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for possible use with `clearInterval()`.\nOptionally, you can also pass arguments to the callback.\n\n\n#### Example\n\t\tvar interval_count = 0;\n\n\t\t// Set an interval for one second, twice;\n\t\t// on the third second, break out\n\t\tsetInterval(function(param) {\n\t\t ++interval_count;\n\n\t\t if (interval_count == 3)\n\t\t clearInterval(this);\n\t\t}, 1000, 'test param');\n\n\n\n\n/**\n timer.setTimeout(callback(), delay [, arg...])\n- callback {Function} The callback function to execute\n- delay {Number} The delay (in milliseconds) before executing the callback\n- arg {Object} Any optional arguments to pass the to callback\n\nThis function schedules the execution of a one-time callback function after a\ndefined delay, It returns a `timeoutId`, which can be used later with\n`clearTimeout()`. Optionally, you can also pass arguments to the callback.", "short_description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for possible use with `clearInterval()`.\nOptionally, you can also pass arguments to the callback.\n", "ellipsis_description": "This schedules the repeated execution of a callback function after a defined\ndelay. It returns an `intervalId` for p...", "line": 118, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer.setInterval", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L118", "name": "setInterval", "path": "timer.setInterval" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/timers.markdown", "fileName": "timers", "resultingFile": "timers.html#timer", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/timers.markdown#L54", "name": "timer", "path": "timer" }, { "id": "tls", "type": "class", "description": "\nThe `tls` module uses OpenSSL to provide both the Transport Layer Security and\nthe Secure Socket Layer; in other words, it provides encrypted stream\ncommunications. To access this module, add `require('tls')` in your code.\n\nTLS/SSL is a public/private key infrastructure. Each client and each server must\nhave a private key. A private key is created in your terminal like this:\n\n openssl genrsa -out ryans-key.pem 1024\n\nwhere `ryans-key.pm` is the name of your file. All servers (and some clients)\nneed to have a certificate. Certificates are public keys signed by a Certificate\nAuthority— or, they are self-signed. The first step to getting a certificate is\nto create a \"Certificate Signing Request\" (CSR) file. This is done using:\n\n openssl req -new -key ryans-key.pem -out ryans-csr.pem\n\nTo create a self-signed certificate with the CSR, enter this:\n\n openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out\nryans-cert.pem\n\nAlternatively, you can send the CSR to a Certificate Authority for signing.\n\n(Documentation on creating a CA are pending; for now, interested users should\njust look at\n[`test/fixtures/keys/Makefile`](https://github.com/joyent/node/blob/master/test/\nfixtures/keys/Makefile) in the Node.js source code.)\n\nTo create .pfx or .p12, do this:\n\n openssl pkcs12 -export -in agent5-cert.pem -inkey agent5-key.pem \\\n -certfile ca-cert.pem -out agent5.pfx\n\n - `in`: The certificate\n - `inkey`: The private key\n - `certfile`: All the CA certs concatenated in one file, like this:\n `cat ca1-cert.pem ca2-cert.pem > ca-cert.pem`\n\n#### Using NPN and SNI\n\nNPN (Next Protocol Negotiation) and SNI (Server Name Indication) are TLS\nhandshake extensions provided with this module.\n\nNPN is to use one TLS server for multiple protocols (HTTP, SPDY).\nSNI is to use one TLS server for multiple hostnames with different SSL\ncertificates.", "stability": "3 - Stable", "short_description": "\nThe `tls` module uses OpenSSL to provide both the Transport Layer Security and\nthe Secure Socket Layer; in other words, it provides encrypted stream\ncommunications. To access this module, add `require('tls')` in your code.\n", "ellipsis_description": "\nThe `tls` module uses OpenSSL to provide both the Transport Layer Security and\nthe Secure Socket Layer; in other wo...", "line": 56, "aliases": [], "children": [ { "id": "tls.connect", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "default_value": "localhost", "optional": true, "types": [ "String" ] }, { "name": "options", "optional": true, "types": [ "Object" ] }, { "name": "secureConnectListener", "optional": true, "types": [ "Function" ] } ], "returns": [ { "type": "tls.CleartextStream" } ] } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The port to connect to" }, { "name": "host", "types": [ "String" ], "description": "An optional hostname to connect to`", "optional": true }, { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server", "optional": true }, { "name": "secureConnectionListener", "types": [ "Function" ], "description": "An optional listener" } ], "description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.CleartextStream`]] object.\n\n`options` should be an object that specifies the following values:\n\n - `key`: A string or `Buffer` containing the private key of the client in aPEM\nformat. The default is `null`.\n\n - `passphrase`: A string of a passphrase for the private key. The default is\n`null`.\n\n - `cert`: A string or `Buffer` containing the certificate key of the client in\na PEM format; in other words, the public x509 certificate to use. The default is\n`null`.\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simpler: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `servername`: The server name for the SNI (Server Name Indication) TLS\nextension.\n\n`secureConnectionListener` automatically sets a listener for the\n[`secureConnection`](#tls.event.secureConnection) event.\n\n\n#### Example: Connecting to an echo server on port 8000:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n // These are necessary only if using the client certificate authentication\n key: fs.readFileSync('client-key.pem'),\n cert: fs.readFileSync('client-cert.pem'),\n\n // This is necessary only if the server uses the self-signed certificate\n ca: [ fs.readFileSync('server-cert.pem') ]\n };\n\n var cleartextStream = tls.connect(8000, options, function() {\n console.log('client connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n });\n cleartextStream.setEncoding('utf8');\n cleartextStream.on('data', function(data) {\n console.log(data);\n });\n cleartextStream.on('end', function() {\n server.close();\n });\n\nOr, with pfx:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n pfx: fs.readFileSync('client.pfx')\n };\n\n var cleartextStream = tls.connect(8000, options, function() {\n console.log('client connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n });\n cleartextStream.setEncoding('utf8');\n cleartextStream.on('data', function(data) {\n console.log(data);\n });\n cleartextStream.on('end', function() {\n server.close();\n });", "short_description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.CleartextStream`]] object.\n", "ellipsis_description": "Creates a new client connection to the given `port` and `host`. This function\nreturns a [[tls.CleartextStream `tls.C...", "line": 175, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.connect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L175", "name": "connect", "path": "tls.connect" }, { "id": "tls.createSecurePair", "type": "class method", "signatures": [ { "args": [ { "name": "credentials", "optional": true, "types": [ "Object" ] }, { "name": "isServer", "optional": true, "types": [ "Boolean" ] }, { "name": "requestCert", "optional": true, "types": [ "Boolean" ] }, { "name": "rejectUnauthorized", "optional": true, "types": [ "Boolean" ] } ], "returns": [ { "type": "tls.SecurePair" } ] } ], "arguments": [ { "name": "credentials", "types": [ "Object" ], "description": "An optional credentials object from [[crypto.createCredentials `crypto.createCredentials()`]]", "optional": true }, { "name": "isServer", "types": [ "Boolean" ], "description": "An optional boolean indicating whether this TLS connection should be opened as a server (`true`) or a client (`false`)", "optional": true }, { "name": "requestCert", "types": [ "Boolean" ], "description": "A boolean indicating whether a server should request a certificate from a connecting client; only applies to server connections", "optional": true }, { "name": "rejectUnauthorized", "types": [ "Boolean" ], "description": "A boolean indicating whether a server should automatically reject clients with invalid certificates; only applies to servers with `requestCert` enabled", "optional": true } ], "description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data. This function returns a\nSecurePair object with [[tls.CleartextStream `tls.CleartextStream`]] and\n`encrypted` stream properties.\n\nGenerally, the encrypted strean is piped to/from an incoming encrypted data\nstream, and the cleartext one is used as a replacement for the initial encrypted\nstream.", "short_description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data. This function returns a\nSecurePair object with [[tls.CleartextStream `tls.CleartextStream`]] and\n`encrypted` stream properties.\n", "ellipsis_description": "Creates a new secure `pair` object with two streams, one of which reads/writes\nencrypted data, and one reads/writes ...", "line": 202, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.createSecurePair", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L202", "name": "createSecurePair", "path": "tls.createSecurePair" }, { "id": "tls.createServer", "type": "class method", "signatures": [ { "args": [ { "name": "options", "types": [ "Object" ] }, { "name": "secureConnectionListener", "optional": true, "types": [ "Function" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "Any options you want to pass to the server" }, { "name": "secureConnectionListener", "types": [ "Function" ], "description": "An optional listener", "optional": true } ], "description": "Creates a new [[tls.Server `tls.Server`]].\n\nThe `options` object has the following mix of required values:\n\n - `pfx`: A string or `Buffer` containing the private key, certificate, and\n CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\n the `key`, `cert`, and `ca` options.)\n\n - `key`: A string or `Buffer` containing the private key of the server in a\nPEM format. (Required)\n\n - `cert`: A string or `Buffer` containing the certificate key of the server in\na PEM format. (Required)\n\n`options` also has the following option values:\n\n - `ca`: An array of strings or `Buffer`s of trusted certificates. These are\nused to authorize connections. If this is omitted, several \"well-known root\" CAs\nwill be used, like VeriSign.\n\n - `NPNProtocols`: An array of strings or a `Buffer` containing supported NPN\nprotocols.\n `Buffer` should have the following format: `0x05hello0x05world`, where\nthe preceding byte indicates the following protocol name's length. Passing an\narray is usually much simplier: `['hello', 'world']`.\n Protocols should be ordered by their priority.\n\n - `passphrase`: A string of a passphrase for the private key or pfx.\n\n - `rejectUnauthorized`: If `true` the server rejects any connection that is\nnot authorized with the list of supplied CAs. This option only has an effect if\n`requestCert` is `true`. This defaults to `false`.\n\n - `requestCert`: If `true` the server requests a certificate from clients that\nconnect and attempt to verify that certificate. This defaults to `false`.\n\n - `sessionIdContext`: A string containing an opaque identifier for session\nresumption. If `requestCert` is `true`, the default is an MD5 hash value\ngenerated from the command line. Otherwise, the default is not provided.\n\n - `SNICallback`: A function that is called if the client supports the SNI TLS\nextension. Only one argument will be passed to it: `servername`. `SNICallback`\nshould return a SecureContext instance. You can use\n`crypto.createCredentials(...).context` to get a proper SecureContext. If\n`SNICallback` wasn't provided, a default callback within the high-level API is\nused (for more information, see below).\n\n`secureConnectionListener` automatically sets a listener for the\n[`secureConnection`](#tls.event.secureConnection) event.\n\n#### Example\n\nHere's a simple \"echo\" server:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n key: fs.readFileSync('server-key.pem'),\n cert: fs.readFileSync('server-cert.pem'),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n // This is necessary only if the client uses the self-signed certificate.\n ca: [ fs.readFileSync('client-cert.pem') ]\n };\n\n var server = tls.createServer(options, function(cleartextStream) {\n console.log('server connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n cleartextStream.write(\"welcome!\\n\");\n cleartextStream.setEncoding('utf8');\n cleartextStream.pipe(cleartextStream);\n });\n server.listen(8000, function() {\n console.log('server bound');\n });\n\nOr, with pfx:\n\n var tls = require('tls');\n var fs = require('fs');\n\n var options = {\n pfx: fs.readFileSync('server.pfx'),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n };\n\n var server = tls.createServer(options, function(cleartextStream) {\n console.log('server connected',\n cleartextStream.authorized ? 'authorized' : 'unauthorized');\n cleartextStream.write(\"welcome!\\n\");\n cleartextStream.setEncoding('utf8');\n cleartextStream.pipe(cleartextStream);\n });\n server.listen(8000, function() {\n console.log('server bound');\n });\n\nYou can test this server by connecting to it with `openssl s_client`:\n\n openssl s_client -connect 127.0.0.1:8000", "short_description": "Creates a new [[tls.Server `tls.Server`]].\n", "ellipsis_description": "Creates a new [[tls.Server `tls.Server`]].\n ...", "line": 316, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.createServer", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L316", "name": "createServer", "path": "tls.createServer" }, { "id": "tls@secureConnection", "type": "event", "signatures": [ { "args": [ { "name": "cleartextStream", "types": [ "tls.CleartextStream" ] } ] } ], "arguments": [ { "name": "cleartextStream", "types": [ "tls.CleartextStream" ], "description": "A object containing the NPN and SNI string protocols" } ], "description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.CleartextStream CleartextStream]]. It has\nall the common stream methods and events.\n\nIf [[tls.CleartextStream.authorized `tls.CleartextStream.authorized`]] is\n`false`, then [[tls.CleartextStream.authorizationError\n`tls.Cleartext.authorizationError`]] is set to describe how the authorization\nfailed. Depending on the settings of the TLS server, your unauthorized\nconnections may still be accepted.\n\n`cleartextStream.npnProtocol` is a string containing the selected NPN protocol.\n`cleartextStream.servername` is a string containing the servername requested\nwith SNI.", "short_description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.CleartextStream CleartextStream]]. It has\nall the common stream methods and events.\n", "ellipsis_description": "This event is emitted after a new connection has been successfully handshaked.\nThe argument is a instance of [[tls.C...", "line": 80, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls@secureConnection", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L80", "name": "secureConnection", "path": "tls.event.secureConnection" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls", "subclasses": [ "tls.Server", "tls.SecurePair", "tls.CleartextStream" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L56", "name": "tls", "path": "tls" }, { "id": "tls.CleartextStream", "type": "class", "superclass": "tls", "description": "This is a stream on top of the encrypted stream that makes it possible to\nread/write an encrypted data as a cleartext data.\n\nThis instance implements the duplex [[streams `Stream`]] interfaces. It has all\nthe common stream methods and events.", "short_description": "This is a stream on top of the encrypted stream that makes it possible to\nread/write an encrypted data as a cleartext data.\n", "ellipsis_description": "This is a stream on top of the encrypted stream that makes it possible to\nread/write an encrypted data as a cleartex...", "line": 439, "aliases": [], "children": [ { "id": "tls.CleartextStream.authorizationError", "type": "class property", "signatures": [ { "returns": [ { "type": "Error" } ] } ], "description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStream.authorized === false`.", "short_description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStream.authorized === false`.", "ellipsis_description": "The reason why the peer's certificate has not been verified. This property\nbecomes available only when `cleartextStr...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.authorizationError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L485", "name": "authorizationError", "path": "tls.CleartextStream.authorizationError" }, { "id": "tls.CleartextStream.authorized", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`.", "short_description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`.", "ellipsis_description": "If `true`, the peer certificate was signed by one of the specified CAs;\notherwise, `false`. ...", "line": 473, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.authorized", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L473", "name": "authorized", "path": "tls.CleartextStream.authorized" }, { "id": "tls.CleartextStream.connections", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two properties, _e.g._\n`{\"address\":\"192.168.57.1\", \"port\":62053}`", "short_description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two properties, _e.g._\n`{\"address\":\"192.168.57.1\", \"port\":62053}`", "ellipsis_description": "Returns the bound address and port of the underlying socket as reported by the\noperating system. The object has two ...", "line": 531, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L531", "name": "connections", "path": "tls.CleartextStream.connections" }, { "id": "tls.CleartextStream.getPeerCertificate", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Object" } ] } ], "description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n\nIf the peer does not provide a certificate, it returns `null` or an empty\nobject.\n\n#### Example\n\n { subject:\n { C: 'UK',\n ST: 'Acknack Ltd',\n L: 'Rhys Jones',\n O: 'node.js',\n OU: 'Test TLS Certificate',\n CN: 'localhost' },\n issuer:\n { C: 'UK',\n ST: 'Acknack Ltd',\n L: 'Rhys Jones',\n O: 'node.js',\n OU: 'Test TLS Certificate',\n CN: 'localhost' },\n valid_from: 'Nov 11 09:52:22 2009 GMT',\n valid_to: 'Nov 6 09:52:22 2029 GMT',\n fingerprint:\n'2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF' }", "short_description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n", "ellipsis_description": "Returns an object representing the peer's certificate. The returned object has\nsome properties corresponding to the ...", "line": 520, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.getPeerCertificate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L520", "name": "getPeerCertificate", "path": "tls.CleartextStream.getPeerCertificate" }, { "id": "tls.CleartextStream.remoteAddress", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "short_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`.", "ellipsis_description": "The string representation of the remote IP address. For example,\n`'74.125.127.100'` or `'2001:4860:a005::68'`. ...", "line": 542, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.remoteAddress", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L542", "name": "remoteAddress", "path": "tls.CleartextStream.remoteAddress" }, { "id": "tls.CleartextStream.remotePort", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The numeric representation of the remote port. For example, `443`.", "short_description": "The numeric representation of the remote port. For example, `443`.", "ellipsis_description": "The numeric representation of the remote port. For example, `443`. ...", "line": 554, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream.remotePort", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L554", "name": "remotePort", "path": "tls.CleartextStream.remotePort" }, { "id": "tls.CleartextStream@clientError", "type": "event", "signatures": [ { "args": [ { "name": "exception", "types": [ "Error" ] } ] } ], "arguments": [ { "name": "exception", "types": [ "Error" ], "description": "The standard Error object" } ], "description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, and the error is passed along.", "short_description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, and the error is passed along.", "ellipsis_description": "If a client connection emits an 'error' event before a secure connection is\nestablished, this event is triggered, an...", "line": 465, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream@clientError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L465", "name": "clientError", "path": "tls.CleartextStream.event.clientError" }, { "id": "tls.CleartextStream@secureConnect", "type": "event", "signatures": [ { "args": [] } ], "description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server's certificate was authorized\nor not.\n\nIt is up to the user to test `cleartextStream.authorized` to see if the server\ncertificate was signed by one of the specified CAs. If\n`cleartextStream.authorized === false`, then the error can be found in\n`cleartextStream.authorizationError`. Also if NPN was used, you can check\n`cleartextStream.npnProtocol` for the negotiated protocol.", "short_description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server's certificate was authorized\nor not.\n", "ellipsis_description": "This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter...", "line": 455, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream@secureConnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L455", "name": "secureConnect", "path": "tls.CleartextStream.event.secureConnect" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.CleartextStream", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L439", "name": "CleartextStream", "path": "tls.CleartextStream" }, { "id": "tls.SecurePair", "type": "class", "superclass": "tls", "description": "Returned by [[tls.createSecurePair `tls.createSecurePair()`]].", "short_description": "Returned by [[tls.createSecurePair `tls.createSecurePair()`]].", "ellipsis_description": "Returned by [[tls.createSecurePair `tls.createSecurePair()`]]. ...", "line": 415, "aliases": [], "children": [ { "id": "tls.SecurePair@secure", "type": "event", "signatures": [ { "args": [] } ], "description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n\nSimilar to the checking for the server `'secureConnection'` event,\n[[tls.CleartextStream.authorized `tls.CleartextStream.authorized`]] should be\nchecked to confirm whether the certificate used properly authorized.", "short_description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n", "ellipsis_description": "The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n ...", "line": 428, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.SecurePair@secure", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L428", "name": "secure", "path": "tls.SecurePair.event.secure" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.SecurePair", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L415", "name": "SecurePair", "path": "tls.SecurePair" }, { "id": "tls.Server", "type": "class", "superclass": "tls", "description": "This class is a subclass of [[net.Server `net.Server`]] and has the same methods\nas it. However, instead of accepting just raw TCP connections, it also accepts\nencrypted connections using TLS or SSL.", "short_description": "This class is a subclass of [[net.Server `net.Server`]] and has the same methods\nas it. However, instead of accepting just raw TCP connections, it also accepts\nencrypted connections using TLS or SSL.", "ellipsis_description": "This class is a subclass of [[net.Server `net.Server`]] and has the same methods\nas it. However, instead of acceptin...", "line": 325, "aliases": [], "children": [ { "id": "tls.Server.addContext", "type": "class method", "signatures": [ { "args": [ { "name": "hostname", "types": [ "String" ] }, { "name": "credentials", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "hostname", "types": [ "String" ], "description": "The hostname to match" }, { "name": "credentials", "types": [ "Object" ], "description": "The credentials to use" } ], "description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can be used). `credentials` can contain\n`key`, `cert`, and `ca`.\n\n#### Example\n var serverResults = [];\n\n var server = tls.createServer(serverOptions, function(c) {\n serverResults.push(c.servername);\n });\n\n server.addContext('a.example.com', SNIContexts['a.example.com']);\n server.addContext('*.test.com', SNIContexts['asterisk.test.com']);\n\n server.listen(1337);", "short_description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can be used). `credentials` can contain\n`key`, `cert`, and `ca`.\n", "ellipsis_description": "Add secure context that will be used if client request's SNI hostname is\nmatching passed `hostname` (wildcards can b...", "line": 348, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.addContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L348", "name": "addContext", "path": "tls.Server.addContext" }, { "id": "tls.Server.address", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n\nFor more information, see [[net.Server.address `net.Server.address()`]].", "short_description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n", "ellipsis_description": "Returns the bound address and port of the server as reported by the operating\nsystem.\n ...", "line": 358, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.address", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L358", "name": "address", "path": "tls.Server.address" }, { "id": "tls.Server.close", "type": "class method", "signatures": [ { "args": [] } ], "description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close'` event.", "short_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed when it emits a `'close'` event.", "ellipsis_description": "Stops the server from accepting new connections. This function is asynchronous,\nand the server is finally closed whe...", "line": 367, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.close", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L367", "name": "close", "path": "tls.Server.close" }, { "id": "tls.Server.connections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "The number of concurrent connections on the server.", "short_description": "The number of concurrent connections on the server.", "ellipsis_description": "The number of concurrent connections on the server. ...", "line": 400, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.connections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L400", "name": "connections", "path": "tls.Server.connections" }, { "id": "tls.Server.listen", "type": "class method", "signatures": [ { "args": [ { "name": "port", "types": [ "Number" ] }, { "name": "host", "optional": true, "types": [ "String" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "port", "types": [ "Number" ], "description": "The specific port to listen to" }, { "name": "host", "types": [ "String" ], "description": "An optional host to listen to", "optional": true }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback to execute when the server has been bound", "optional": true } ], "description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept connections directed to any IPv4 address\n(`INADDR_ANY`).\n\nFor more information, see [[net.Server `net.Server`]].", "short_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept connections directed to any IPv4 address\n(`INADDR_ANY`).\n", "ellipsis_description": "Begin accepting connections on the specified `port` and `host`. If the `host`\nis omitted, the server will accept co...", "line": 382, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.listen", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L382", "name": "listen", "path": "tls.Server.listen" }, { "id": "tls.Server.maxConnections", "type": "class property", "signatures": [ { "returns": [ { "type": "Number" } ] } ], "description": "Set this property to reject connections when the server's connection count gets\nhigh.", "short_description": "Set this property to reject connections when the server's connection count gets\nhigh.", "ellipsis_description": "Set this property to reject connections when the server's connection count gets\nhigh. ...", "line": 408, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.maxConnections", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L408", "name": "maxConnections", "path": "tls.Server.maxConnections" }, { "id": "tls.Server.pause", "type": "class method", "signatures": [ { "args": [ { "name": "msecs", "default_value": 1000, "types": [ "Number" ] } ] } ], "arguments": [ { "name": "msecs", "types": [ "Number" ], "description": "The number of milliseconds to pause for" } ], "description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "short_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections against DoS attacks or other\noversubscriptions.", "ellipsis_description": "Stop accepting connections for the given number of milliseconds. This could be\nuseful for throttling new connections...", "line": 392, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server.pause", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L392", "name": "pause", "path": "tls.Server.pause" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tls.markdown", "fileName": "tls", "resultingFile": "tls.html#tls.Server", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tls.markdown#L325", "name": "Server", "path": "tls.Server" }, { "id": "tty", "type": "class", "description": "\nThis module controls printing to the terminal output. Use `require('tty')` to\naccess this module.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nThis module controls printing to the terminal output. Use `require('tty')` to\naccess this module.\n", "ellipsis_description": "\nThis module controls printing to the terminal output. Use `require('tty')` to\naccess this module.\n ...", "line": 14, "aliases": [], "children": [ { "id": "tty.getWindowSize", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "Array" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to check (deprecated: 0.6.0)" } ], "description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead.", "short_description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead.", "ellipsis_description": "This function no longer exists. Use [[process.stdout\n`process.stdout.getWindowSize()`]] instead. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.getWindowSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L24", "name": "getWindowSize", "path": "tty.getWindowSize" }, { "id": "tty.isatty", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to check" } ], "description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal.", "short_description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal.", "ellipsis_description": "Returns `true` or `false` depending on if the file descriptor is associated with\na terminal. ...", "line": 33, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.isatty", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L33", "name": "isatty", "path": "tty.isatty" }, { "id": "tty.setRawMode", "type": "class method", "signatures": [ { "args": [ { "name": "mode", "types": [ "Boolean" ] } ] } ], "arguments": [ { "name": "mode", "types": [ "Boolean" ], "description": "A boolean value indicating how to set the rawness" } ], "description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or default (`false`).", "short_description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or default (`false`).", "ellipsis_description": "This sets the properties of the current process's stdin file descriptor to act\neither as a raw device (`true`) or de...", "line": 42, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.setRawMode", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L42", "name": "setRawMode", "path": "tty.setRawMode" }, { "id": "tty.setWindowSize", "type": "class method", "signatures": [ { "args": [ { "name": "fd", "types": [ "Number" ] }, { "name": "row", "types": [ "Number" ] }, { "name": "col", "types": [ "Number" ] } ] } ], "arguments": [ { "name": "fd", "types": [ "Number" ], "description": "The file descriptor to use" }, { "name": "row", "types": [ "Number" ], "description": "The number of rows" }, { "name": "col", "types": [ "Number" ], "description": "The number of columns (deprecated: 0.6.0)" } ], "description": "This function no longer exists.", "short_description": "This function no longer exists.", "ellipsis_description": "This function no longer exists. ...", "line": 53, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty.setWindowSize", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L53", "name": "setWindowSize", "path": "tty.setWindowSize" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/tty.markdown", "fileName": "tty", "resultingFile": "tty.html#tty", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/tty.markdown#L14", "name": "tty", "path": "tty" }, { "id": "url", "type": "class", "description": "\nThis module has utilities for URL resolution and parsing. To use it, add\n`require('url')` to your code.\n\nParsed URL objects have some or all of the following fields, depending on\nwhether or not they exist in the URL string. Any parts that are not in the URL\nstring are not in the parsed object. All the examples shown use the following\nURL:\n\n`'http://user:pass@HOST.com:8080/p/a/t/h?query=string#hash'`\n\n* `href`: the full URL that was originally parsed. Both the protocol and host\nare in lowercase.\n\n For the URL above, this is:\n`'http://user:pass@host.com:8080/p/a/t/h?query=string#hash'`\n\n* `protocol`: the request protocol, in lowercase.\n\n For the URL above, this is: `'http:'`\n\n* `host`: the full lowercased host portion of the URL, including port and\nauthentication information.\n\n For the URL above, this is: `'user:pass@host.com:8080'`\n\n* `auth`: The authentication information from the URL.\n\n For the URL above, this is: `'user:pass'`\n\n* `hostname`: the lowercased hostname portion of the URL.\n\n For the URL above, this is: `'host.com'`\n\n* `port`: The port number of the URL.\n\n For the URL above, this is: `'8080'`\n\n* `pathname`: the path section of the URL, that comes after the host and before\nthe query, including the initial slash (if present).\n\n For the URL above, this is: `'/p/a/t/h'`\n\n* `search`: the 'query string' portion of the URL, including the leading\nquestion mark.\n\n For the URL above, this is: `'?query=string'`\n\n* `path`: a concatenation of `pathname` and `search`.\n\n For the URL above, this is: `'/p/a/t/h?query=string'`\n\n* `query`: either the 'params' portion of the query string, or a\nquerystring-parsed object.\n\n For the URL above, this is: `'query=string'` or `{'query':'string'}`\n\n* `hash`: the 'fragment' portion of the URL including the pound-sign.\n\n For the URL above, this is: `'#hash'`", "stability": "3 - Stable", "short_description": "\nThis module has utilities for URL resolution and parsing. To use it, add\n`require('url')` to your code.\n", "ellipsis_description": "\nThis module has utilities for URL resolution and parsing. To use it, add\n`require('url')` to your code.\n ...", "line": 70, "aliases": [], "children": [ { "id": "url.format", "type": "class method", "signatures": [ { "args": [ { "name": "urlObj", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "urlObj", "types": [ "String" ], "description": "The object to tranform into a URL" } ], "description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n\n* `href` is ignored.\n* `protocol` is treated the same with or without the trailing `:` (colon). Note\nthat:\n * The protocols `http`, `https`, `ftp`, `gopher`, and `file` are postfixed\n with `://`\n * All other protocols (like `mailto`, `xmpp`, `aim`, `sftp`, `foo`, etc) are\n postfixed with `:`\n* `auth` is used if it's available\n* `hostname` is only used if `host` is absent\n* `port` is only used if `host` is absent\n* `host` is only used in place of `auth`, `hostname`, and `port`\n* `pathname` is treated the same with or without the leading `/` (slash)\n* `search` is used in place of `query`\n* `query`, a [querystring](querystring.html) object, is only used if `search` is\nabsent\n* `search` is treated the same with or without the leading `?`\n* `hash` is treated the same with or without the leading `#`", "short_description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n", "ellipsis_description": "Takes a parsed URL object and returns a formatted URL string that contains these\nproperties:\n ...", "line": 116, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.format", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L116", "name": "format", "path": "url.format" }, { "id": "url.parse", "type": "class method", "signatures": [ { "args": [ { "name": "urlStr", "types": [ "String" ] }, { "name": "parseQueryString", "default_value": false, "optional": true, "types": [ "Boolean" ] }, { "name": "slashesDenoteHost", "default_value": false, "optional": true, "types": [ "Boolean" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "urlStr", "types": [ "String" ], "description": "The URL string" }, { "name": "parseQueryString", "types": [ "Boolean" ], "description": "If `true`, the method parses the URL using the [[querystring `querystring`]] module", "optional": true }, { "name": "slashesDenoteHost", "types": [ "Boolean" ], "description": "If `true`, `//foo/bar` acts like `{ host : 'foo', pathname '/bar' }`, instead of `{ pathname : '//foo/bar' }`", "optional": true } ], "description": "Takes a URL string, and return it as an object.", "short_description": "Takes a URL string, and return it as an object.", "ellipsis_description": "Takes a URL string, and return it as an object. ...", "line": 86, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.parse", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L86", "name": "parse", "path": "url.parse" }, { "id": "url.resolve", "type": "class method", "signatures": [ { "args": [ { "name": "from", "types": [ "String" ] }, { "name": "to", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "from", "types": [ "String" ], "description": "The base URL" }, { "name": "to", "types": [ "String" ], "description": "The href URL" } ], "description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n\n#### Example\n\n", "short_description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n", "ellipsis_description": "Takes a base URL, and an href URL, and resolves them as a browser would for an\nanchor tag.\n ...", "line": 131, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url.resolve", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L131", "name": "resolve", "path": "url.resolve" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/url.markdown", "fileName": "url", "resultingFile": "url.html#url", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/url.markdown#L70", "name": "url", "path": "url" }, { "id": "util", "type": "class", "description": "\n\nThe `util` module provides varies utilities that you can use in your Node.js\nprograms, fmostly around verifying the type of an object. To access these\nmethods, add `require('util')` to your code.", "stability": "5 - Locked", "short_description": "\n", "ellipsis_description": "\n ...", "line": 13, "aliases": [], "children": [ { "id": "util.debug", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`.", "short_description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`.", "ellipsis_description": "A synchronous output function. This block the process and outputs `string`\nimmediately to `stderr`. ...", "line": 24, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.debug", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L24", "name": "debug", "path": "util.debug" }, { "id": "util.error", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`.", "short_description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`.", "ellipsis_description": "Same as `util.debug()` except this will output all arguments immediately to\n`stderr`. ...", "line": 82, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.error", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L82", "name": "error", "path": "util.error" }, { "id": "util.format", "type": "class method", "signatures": [ { "args": [ { "name": "format", "types": [ "String" ] }, { "name": "arg", "ellipsis": true, "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "format", "types": [ "String" ], "description": "Placeholders used for formatting" }, { "name": "arg", "types": [ "String" ], "description": "The string to print, and any additional formatting arguments", "optional": true } ], "description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n\nThe first argument is a string that contains zero or more placeholders. Each\nplaceholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n* `%s` - String.\n* `%d` - Number (both integer and float).\n* `%j` - JSON.\n* `%%` - single percent sign (`'%'`). This does not consume an argument.\n\n\n#### Example\n\n", "short_description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_format_string#Format_placeh\nolders) way.\n", "ellipsis_description": "Returns a formatted string using the first argument in [a\n`printf()`-like](http://en.wikipedia.org/wiki/Printf_forma...", "line": 50, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.format", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L50", "name": "format", "path": "util.format" }, { "id": "util.inherits", "type": "class method", "signatures": [ { "args": [ { "name": "constructor", "types": [ "Function" ] }, { "name": "superConstructor", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "constructor", "types": [ "Function" ], "description": "The prototype methods to inherit" }, { "name": "superConstructor", "types": [ "Object" ], "description": "The new object's type" } ], "description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new object created from `superConstructor`.\n\nAs an additional convenience, `superConstructor` is accessible through the\n`constructor.super_` property.\n\nFor more information, see the MDN\n[`constructor`](https://developer.mozilla.org/en/Javascript/Reference/Global_Obj\nects/Object/constructor) documentation.\n\n#### Example\n\n", "short_description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new object created from `superConstructor`.\n", "ellipsis_description": "Inherit the prototype methods from one constructor into another. The prototype\nof `constructor` is set to a new obje...", "line": 207, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.inherits", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L207", "name": "inherits", "path": "util.inherits" }, { "id": "util.inspect", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] }, { "name": "showHidden", "default_value": false, "types": [ "Boolean" ] }, { "name": "depth", "default_value": 2, "types": [ "Number" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be represented" }, { "name": "showHidden", "types": [ "Boolean" ], "description": "Identifies whether the non-enumerable properties are also shown" }, { "name": "depth", "types": [ "Number" ], "description": "Indicates how many times to recurse while formatting the object" } ], "description": "Returns a string representation of `object`, which is useful for debugging.\n\nTo make the function recurse an object indefinitely, pass in `null` for `depth`.\n\nIf `colors` is `true`, the output is styled with ANSI color codes.\n\n#### Example\n\nHere's an example inspecting all the properties of the `util` object:\n\n", "short_description": "Returns a string representation of `object`, which is useful for debugging.\n", "ellipsis_description": "Returns a string representation of `object`, which is useful for debugging.\n ...", "line": 73, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.inspect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L73", "name": "inspect", "path": "util.inspect" }, { "id": "util.isArray", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is an `Array`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is an `Array`.\n", "ellipsis_description": "Returns `true` if the given object is an `Array`.\n ...", "line": 113, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isArray", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L113", "name": "isArray", "path": "util.isArray" }, { "id": "util.isDate", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is a `Date`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is a `Date`.\n", "ellipsis_description": "Returns `true` if the given object is a `Date`.\n ...", "line": 127, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isDate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L127", "name": "isDate", "path": "util.isDate" }, { "id": "util.isError", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given object is an `Error`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given object is an `Error`.\n", "ellipsis_description": "Returns `true` if the given object is an `Error`.\n ...", "line": 141, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isError", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L141", "name": "isError", "path": "util.isError" }, { "id": "util.isRegExp", "type": "class method", "signatures": [ { "args": [ { "name": "object", "types": [ "Object" ] } ], "returns": [ { "type": "Boolean" } ] } ], "arguments": [ { "name": "object", "types": [ "Object" ], "description": "The object to be identified" } ], "description": "Returns `true` if the given \"object\" is a `RegExp`.\n\n#### Example\n\n", "short_description": "Returns `true` if the given \"object\" is a `RegExp`.\n", "ellipsis_description": "Returns `true` if the given \"object\" is a `RegExp`.\n ...", "line": 156, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.isRegExp", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L156", "name": "isRegExp", "path": "util.isRegExp" }, { "id": "util.log", "type": "class method", "signatures": [ { "args": [ { "name": "str", "types": [ "String" ] } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "Outputs to `stdout`...but with a timestamp!", "short_description": "Outputs to `stdout`...but with a timestamp!", "ellipsis_description": "Outputs to `stdout`...but with a timestamp! ...", "line": 167, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.log", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L167", "name": "log", "path": "util.log" }, { "id": "util.print", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true } ] } ], "description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does not place newlines after each argument.", "short_description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does not place newlines after each argument.", "ellipsis_description": "A synchronous output function. Will block the process, cast each argument to a\nstring then output to `stdout`. Does ...", "line": 99, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.print", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L99", "name": "print", "path": "util.print" }, { "id": "util.pump", "type": "class method", "signatures": [ { "args": [ { "name": "readableStream", "types": [ "streams.ReadableStream" ] }, { "name": "writableStream", "types": [ "streams.WritableStream" ] }, { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [], "callback": true, "optional": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "readableStream", "types": [ "streams.ReadableStream" ], "description": "The stream to read from" }, { "name": "writableStream", "types": [ "streams.WritableStream" ], "description": "The stream to write to" }, { "name": "callback", "types": [ "Function" ], "description": "An optional callback function once the pump is through", "optional": true } ], "description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n\nWhen `writableStream.write(data)` returns `false`, `readableStream` is paused\nuntil the `drain` event occurs on the `writableStream`. `callback` gets an error\nas its only argument and is called when `writableStream` is closed or when an\nerror occurs.", "short_description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n", "ellipsis_description": "Reads the data from `readableStream` and sends it to the `writableStream`.\n ...", "line": 183, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.pump", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L183", "name": "pump", "path": "util.pump" }, { "id": "util.puts", "type": "class method", "signatures": [ { "args": [ { "name": "str", "ellipsis": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "str", "types": [ "String" ], "description": "The string to print" } ], "description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each argument.", "short_description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each argument.", "ellipsis_description": "A synchronous output function. Will block the process and output all arguments\nto `stdout` with newlines after each ...", "line": 91, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util.puts", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L91", "name": "puts", "path": "util.puts" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/util.markdown", "fileName": "util", "resultingFile": "util.html#util", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/util.markdown#L13", "name": "util", "path": "util" }, { "id": "vm", "type": "class", "description": "\nIn Node.js, Javascript code can be compiled and run immediately or compiled,\nsaved, and run later. To do that, you can add `require('vm');` to your code.\n\n#### Example\n\n", "stability": "3 - Stable", "short_description": "\nIn Node.js, Javascript code can be compiled and run immediately or compiled,\nsaved, and run later. To do that, you can add `require('vm');` to your code.\n", "ellipsis_description": "\nIn Node.js, Javascript code can be compiled and run immediately or compiled,\nsaved, and run later. To do that, you ...", "line": 15, "aliases": [], "children": [ { "id": "vm.createContext", "type": "class method", "signatures": [ { "args": [ { "name": "initSandbox", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "Object" } ] } ], "arguments": [ { "name": "initSandbox", "types": [ "Object" ], "description": "An object that is shallow-copied to seed the initial contents of the global object used by the context", "optional": true } ], "description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to `vm.runInContext()`.\n\nA (V8) context comprises a global object together with a set of build-in objects\nand functions.", "short_description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to `vm.runInContext()`.\n", "ellipsis_description": "`vm.createContext()` creates a new context which is suitable for use as the\nsecond argument of a subsequent call to ...", "line": 125, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.createContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L125", "name": "createContext", "path": "vm.createContext" }, { "id": "vm.createScript", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "vm.Script" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScript` prints the syntax error to stderr and\nthrows an exception.\n\n\n`createScript()` compiles `code` as if it were loaded from `filename`, but does\nnot run it. Instead, it returns a `vm.Script` object representing this compiled\ncode. The returned script is not bound to any global object. It is bound before\neach run, just for that run. The `filename` is optional, and is only used in\nstack traces.", "short_description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScript` prints the syntax error to stderr and\nthrows an exception.\n", "ellipsis_description": "This script can be run later many times using the other `vm` methods. In case of\nsyntax error in `code`, `createScri...", "line": 145, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.createScript", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L145", "name": "createScript", "path": "vm.createScript" }, { "id": "vm.runInContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "context", "types": [ "Object" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "context", "types": [ "Object" ], "description": "The context to execute it in, coming from [[vm.createContext `vm.createContext()`]]" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n\nA (V8) context comprises a global object, together with a set of built-in\nobjects and functions. Running code does not have access to local scope and the\nglobal object held within `context` is used as the global object for `code`. The\n`filename` is optional, and is only used in stack traces.\n\nIn case of syntax error in `code`, `vm.runInContext()` emits the syntax error to\nstderr and throws an exception.\n\nNote: Running untrusted code is a tricky business requiring great care. To prevent accidental global variable leakage, `vm.runInContext()` is quite useful, but safely running untrusted code requires a separate process.\n\n#### Example\n\nCompiling and executing code in an existing context.\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n", "ellipsis_description": "`vm.runInContext()` compiles `code`, then runs it in `context` and returns the\nresult.\n ...", "line": 109, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L109", "name": "runInContext", "path": "vm.runInContext" }, { "id": "vm.runInNewContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "sandbox", "optional": true, "types": [ "Object" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "sandbox", "types": [ "Object" ], "description": "A global object with properties to pass into `code`", "optional": true }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have access to local scope. The object `sandbox`\nis used as the global object for `code`.\n`sandbox` and `filename` are optional, and `filename` is only used in stack\ntraces.\n\nWarning: Running untrusted code is a tricky business requiring great care. To\nprevent accidental global variable leakage, `vm.runInNewContext()` is quite\nuseful, but safely running untrusted code requires a separate process.\n\nIn case of syntax error in `code`, `vm.runInNewContext()` emits the syntax error\nto stderr and throws an exception.\n\n#### Example\n\nHere's an example to ompile and execute code that increments a global variable\nand sets a new one. These globals are contained in the sandbox.\n\n", "short_description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have access to local scope. The object `sandbox`\nis used as the global object for `code`.\n`sandbox` and `filename` are optional, and `filename` is only used in stack\ntraces.\n", "ellipsis_description": "`vm.runInNewContext()` compiles `code` then runs it in `sandbox` and returns the\nresult. Running code does not have ...", "line": 74, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInNewContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L74", "name": "runInNewContext", "path": "vm.runInNewContext" }, { "id": "vm.runInThisContext", "type": "class method", "signatures": [ { "args": [ { "name": "code", "types": [ "String" ] }, { "name": "filename", "optional": true, "types": [ "String" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "code", "types": [ "String" ], "description": "The code to run" }, { "name": "filename", "types": [ "String" ], "description": "A filename to emulate where the code is coming from", "optional": true } ], "description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Running code does not have access to local\nscope. The `filename` is optional, and is only used in stack traces.\n\nIn case of syntax error in `code`, `vm.runInThisContext()` emits the syntax\nerror to stderr and throws an exception.\n\n#### Example: Using `vm.runInThisContext` and `eval` to run the same code:\n\n\n\nSince `vm.runInThisContext()` doesn't have access to the local scope, `localVar`\nis unchanged. `eval` does have access to the local scope, so `localVar` is\nchanged.\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Running code does not have access to local\nscope. The `filename` is optional, and is only used in stack traces.\n", "ellipsis_description": "`vm.runInThisContext()` compiles `code` as if it were loaded from `filename`,\nruns it, and returns the result. Runni...", "line": 44, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.runInThisContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L44", "name": "runInThisContext", "path": "vm.runInThisContext" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm", "subclasses": [ "vm.Script" ], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L15", "name": "vm", "path": "vm" }, { "id": "vm.Script", "type": "class", "superclass": "vm", "description": "This object is created as a result of the [[vm.createScript\n`vm.createScript()`]] method. It represents some compiled code than can be run\nat a later moment.", "short_description": "This object is created as a result of the [[vm.createScript\n`vm.createScript()`]] method. It represents some compiled code than can be run\nat a later moment.", "ellipsis_description": "This object is created as a result of the [[vm.createScript\n`vm.createScript()`]] method. It represents some compile...", "line": 157, "aliases": [], "children": [ { "id": "vm.Script.runInNewContext", "type": "class method", "signatures": [ { "args": [ { "name": "sandbox", "optional": true, "types": [ "Object" ] } ], "returns": [ { "type": "String" } ] } ], "arguments": [ { "name": "sandbox", "types": [ "Object" ], "description": "A global object with properties to pass into the `Script` object", "optional": true } ], "description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n\n`script.runInNewContext()` runs the code of `script` with `sandbox` as the\nglobal object and returns the result. Running code does not have access to local\nscope.\n\nWarning: Running untrusted code is a tricky business requiring great care. To\nprevent accidental global variable leakage, `script.runInNewContext()` is quite\nuseful, but safely running untrusted code requires a separate process.\n\n#### Example\n\nCompiling code that increments a global variable and sets one, then execute the\ncode multiple times:\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n", "ellipsis_description": "Similar to `vm.runInNewContext()`, this is a method of a precompiled `Script`\nobject.\n ...", "line": 215, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script.runInNewContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L215", "name": "runInNewContext", "path": "vm.Script.runInNewContext" }, { "id": "vm.Script.runInThisContext", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "String" } ] } ], "description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n\n`script.runInThisContext()` runs the code of `script` and returns the result.\nRunning code doesn't have access to local scope, but does have access to the\n`global` object.\n\n#### Example\n\nUsing `script.runInThisContext()` to compile code once and run it multiple\ntimes:\n\n\n\n#### Returns\n\nA string representing the result of running `code`.", "short_description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n", "ellipsis_description": "Similar to `vm.runInThisContext()`, but a method of the precompiled `Script`\nobject.\n ...", "line": 183, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script.runInThisContext", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L183", "name": "runInThisContext", "path": "vm.Script.runInThisContext" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/vm.markdown", "fileName": "vm", "resultingFile": "vm.html#vm.Script", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/vm.markdown#L157", "name": "Script", "path": "vm.Script" }, { "id": "worker", "type": "class", "superclass": "cluster", "description": "A `Worker` object contains all public information and methods about a worker. In\nthe master, it can be obtained using `cluster.workers`. In a worker it can be\nobtained using `cluster.worker`.", "short_description": "A `Worker` object contains all public information and methods about a worker. In\nthe master, it can be obtained using `cluster.workers`. In a worker it can be\nobtained using `cluster.worker`.", "ellipsis_description": "A `Worker` object contains all public information and methods about a worker. In\nthe master, it can be obtained usin...", "line": 268, "aliases": [], "children": [ { "id": "worker.destroy", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Void" } ] } ], "description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suicide and accidentally death, a suicide boolean\nis set to `true`.\n\n cluster.on('death', function (worker) {\n if (worker.suicide === true) {\n console.log('Oh, it was just suicide\\' – no need to worry').\n }\n });\n\n // destroy worker\n worker.destroy();", "short_description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suicide and accidentally death, a suicide boolean\nis set to `true`.\n", "ellipsis_description": "This function kills the worker, and inform the master to not spawn a new worker.\nTo know the difference between suic...", "line": 339, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.destroy", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L339", "name": "destroy", "path": "worker.destroy" }, { "id": "worker.disconnect", "type": "class method", "signatures": [ { "args": [], "returns": [ { "type": "Void" } ] } ], "description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other listening worker. Existing connection will be\nallowed to exit as usual. When no more connections exist, the IPC channel to the\nworker will close allowing it to die graceful. When the IPC channel is closed\nthe `disconnect` event will emit, this is then followed by the `death` event,\nthere is emitted when the worker finally die.\n\nBecause there might be long living connections, it is useful to implement a\ntimeout. This example ask the worker to disconnect and after two seconds it will\ndestroy the server. An alternative wound be to execute `worker.destroy()` after\n2 seconds, but that would normally not allow the worker to do any cleanup if\nneeded.\n\n#### Example\n\n if (cluster.isMaster) {\n var worker = cluser.fork();\n var timeout;\n\n worker.on('listening', function () {\n worker.disconnect();\n timeout = setTimeout(function () {\n worker.send('force kill');\n }, 2000);\n });\n\n worker.on('disconnect', function () {\n clearTimeout(timeout);\n });\n\n } else if (cluster.isWorker) {\n var net = require('net');\n var server = net.createServer(function (socket) {\n // connection never end\n });\n\n server.listen(8000);\n\n server.on('close', function () {\n // cleanup\n });\n\n process.on('message', function (msg) {\n if (msg === 'force kill') {\n server.destroy();\n }\n });\n }", "short_description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other listening worker. Existing connection will be\nallowed to exit as usual. When no more connections exist, the IPC channel to the\nworker will close allowing it to die graceful. When the IPC channel is closed\nthe `disconnect` event will emit, this is then followed by the `death` event,\nthere is emitted when the worker finally die.\n", "ellipsis_description": "When calling this function the worker will no longer accept new connections, but\nthey will be handled by any other l...", "line": 393, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L393", "name": "disconnect", "path": "worker.disconnect" }, { "id": "worker.process", "type": "class property", "signatures": [ { "returns": [ { "type": "child_process" } ] } ], "description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that function is stored in\n`process`.\n\nFor more information, see the [[`child_process` module](child_process.html).", "short_description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that function is stored in\n`process`.\n", "ellipsis_description": "Since all workers are created using [[child_process.fork\n`child_process.fork()`]], the returned object from that fun...", "line": 288, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.process", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L288", "name": "process", "path": "worker.process" }, { "id": "worker.send", "type": "class method", "signatures": [ { "args": [ { "name": "message", "types": [ "Object" ] }, { "name": "sendHandle", "optional": true } ], "returns": [ { "type": "Void" } ] } ], "arguments": [ { "name": "message", "types": [ "Object" ], "description": "A message to send" } ], "description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this function to\nsend a message to a specific worker. However, in a worker you can also use\n`process.send(message)`, since this is the same function.\n\n#### Example: Echoing Back Messages from the Master\n\n if (cluster.isMaster) {\n var worker = cluster.fork();\n worker.send('hi there');\n\n } else if (cluster.isWorker) {\n process.on('message', function (msg) {\n process.send(msg);\n });\n }", "short_description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this function to\nsend a message to a specific worker. However, in a worker you can also use\n`process.send(message)`, since this is the same function.\n", "ellipsis_description": "This function is equal to the send methods provided by `child_process.fork()`.\nIn the master, you should use this fu...", "line": 320, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.send", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L320", "name": "send", "path": "worker.send" }, { "id": "worker.suicide", "type": "class property", "signatures": [ { "returns": [ { "type": "Boolean" } ] } ], "description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the `disconnect()` method. Until then,\nit is `undefined`.", "short_description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the `disconnect()` method. Until then,\nit is `undefined`.", "ellipsis_description": "This property is a boolean. It is set when a worker dies after calling\n`destroy()` or immediately after calling the ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.suicide", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L297", "name": "suicide", "path": "worker.suicide" }, { "id": "worker.uniqueID", "type": "class property", "signatures": [ { "returns": [ { "type": "String" } ] } ], "description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n\nWhile a worker is alive, this is the key that indexes it in `cluster.workers`.", "short_description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n", "ellipsis_description": "Each new worker is given its own unique id, stored in the `uniqueID`.\n ...", "line": 277, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker.uniqueID", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L277", "name": "uniqueID", "path": "worker.uniqueID" }, { "id": "worker@death", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The dead worker" } ], "description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n\n#### Example\n\n cluster.fork().on('death', function (worker) {\n // Worker has died\n };", "short_description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n", "ellipsis_description": "Same as the `cluster.on('death')` event, but emits only when the state change on\nthe specified worker.\n ...", "line": 500, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@death", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L500", "name": "death", "path": "worker.event.death" }, { "id": "worker@disconnect", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The disconnected worker" } ], "description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n\n cluster.fork().on('disconnect', function (worker) {\n // Worker has disconnected\n };", "short_description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n", "ellipsis_description": "Same as the `cluster.on('disconnect')` event, but emits only when the state\nchange\non the specified worker.\n ...", "line": 485, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@disconnect", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L485", "name": "disconnect", "path": "worker.event.disconnect" }, { "id": "worker@listening", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that's being listened" } ], "description": "#### Example\n\n cluster.fork().on('listening', function (worker, address) {\n // Worker is listening\n };", "short_description": "#### Example\n", "ellipsis_description": "#### Example\n ...", "line": 471, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@listening", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L471", "name": "listening", "path": "worker.event.listening" }, { "id": "worker@message", "type": "event", "signatures": [ { "args": [ { "name": "message", "types": [ "Object" ] } ] } ], "arguments": [ { "name": "message", "types": [ "Object" ], "description": "The message to send" } ], "description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, however in a worker you can also use\n`process.on('message')`\n\n#### Example\n\nHere is a cluster that keeps count of the number of requests in the master\nprocess using the message system:\n\n var cluster = require('cluster');\n var http = require('http');\n\n if (cluster.isMaster) {\n\n // Keep track of http requests\n var numReqs = 0;\n setInterval(function() {\n console.log(\"numReqs =\", numReqs);\n }, 1000);\n\n // Count requestes\n var messageHandler = function (msg) {\n if (msg.cmd && msg.cmd == 'notifyRequest') {\n numReqs += 1;\n }\n };\n\n // Start workers and listen for messages containing notifyRequest\n cluster.autoFork();\n Object.keys(cluster.workers).forEach(function (uniqueID) {\n cluster.workers[uniqueID].on('message', messageHandler);\n });\n\n } else {\n\n // Worker processes have a http server.\n http.Server(function(req, res) {\n res.writeHead(200);\n res.end(\"hello world\\n\");\n\n // notify master about the request\n process.send({ cmd: 'notifyRequest' });\n }).listen(8000);\n }", "short_description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, however in a worker you can also use\n`process.on('message')`\n", "ellipsis_description": "This event is the same as the one provided by `child_process.fork()`. In the\nmaster you should use this event, howev...", "line": 444, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@message", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L444", "name": "message", "path": "worker.event.message" }, { "id": "worker@online", "type": "event", "signatures": [ { "args": [ { "name": "worker", "types": [ "worker" ] } ] } ], "arguments": [ { "name": "worker", "types": [ "worker" ], "description": "The worker that came online" } ], "description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n\n#### Example\n\n cluster.fork().on('online', function (worker) {\n // Worker is online\n };", "short_description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n", "ellipsis_description": "Same as a cluster's [[cluster@online `'online'`]] event, but emits only when the\nstate changes on the specified worker.\n ...", "line": 459, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker@online", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L459", "name": "online", "path": "worker.event.online" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/cluster.markdown", "fileName": "cluster", "resultingFile": "cluster.html#worker", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/cluster.markdown#L268", "name": "worker", "path": "worker" }, { "id": "zlib", "type": "class", "description": "\nThis provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the same options, and is a\nreadable/writable Stream.\n\nYou can access this module by adding `var zlib = require('zlib');` to your code.\n\nAll of the constants defined in `zlib.h` are also defined in this module. They\nare described in more detail in the [zlib\ndocumentation](http://zlib.net/manual.html#Constants).", "stability": "3 - Stable", "short_description": "\nThis provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the same options, and is a\nreadable/writable Stream.\n", "ellipsis_description": "\nThis provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the sam...", "line": 17, "aliases": [], "children": [ { "id": "zlib.createDeflate", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for compressing using deflate.", "short_description": "Returns a new object for compressing using deflate.", "ellipsis_description": "Returns a new object for compressing using deflate. ...", "line": 186, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createDeflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L186", "name": "createDeflate", "path": "zlib.createDeflate" }, { "id": "zlib.createDeflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for compressing using deflate, without an appended zlib\nheader.", "short_description": "Returns a new object for compressing using deflate, without an appended zlib\nheader.", "ellipsis_description": "Returns a new object for compressing using deflate, without an appended zlib\nheader. ...", "line": 211, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createDeflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L211", "name": "createDeflateRaw", "path": "zlib.createDeflateRaw" }, { "id": "zlib.createGunzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object for Gunzip compression.", "short_description": "Returns a new object for Gunzip compression.", "ellipsis_description": "Returns a new object for Gunzip compression. ...", "line": 174, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createGunzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L174", "name": "createGunzip", "path": "zlib.createGunzip" }, { "id": "zlib.createGzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new Object for Gzip compression.", "short_description": "Returns a new Object for Gzip compression.", "ellipsis_description": "Returns a new Object for Gzip compression. ...", "line": 162, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createGzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L162", "name": "createGzip", "path": "zlib.createGzip" }, { "id": "zlib.createInflate", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object to decompress a deflate stream.", "short_description": "Returns a new object to decompress a deflate stream.", "ellipsis_description": "Returns a new object to decompress a deflate stream. ...", "line": 198, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createInflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L198", "name": "createInflate", "path": "zlib.createInflate" }, { "id": "zlib.createInflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header).", "short_description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header).", "ellipsis_description": "Returns a new object to decompress a raw deflate stream (one without an appended\nzlib header). ...", "line": 223, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createInflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L223", "name": "createInflateRaw", "path": "zlib.createInflateRaw" }, { "id": "zlib.createUnzip", "type": "class method", "signatures": [ { "args": [ { "name": "options", "optional": true, "types": [ "Object" ] } ] } ], "arguments": [ { "name": "options", "types": [ "Object" ], "description": "The standard [[zlib.options `options`]] object available to all the methods.", "optional": true } ], "description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header.", "short_description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header.", "ellipsis_description": "Returns a new unzip to decompress either a Gzip- or Deflate-compressed stream by\nauto-detecting the header. ...", "line": 236, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.createUnzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L236", "name": "createUnzip", "path": "zlib.createUnzip" }, { "id": "zlib.deflate", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using deflate.", "short_description": "Compresses a buffer using deflate.", "ellipsis_description": "Compresses a buffer using deflate. ...", "line": 251, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.deflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L251", "name": "deflate", "path": "zlib.deflate" }, { "id": "zlib.deflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader).", "short_description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader).", "ellipsis_description": "Compresses a buffer using a raw deflate stream (one without an appended zlib\nheader). ...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.deflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L267", "name": "deflateRaw", "path": "zlib.deflateRaw" }, { "id": "zlib.gunzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Gunzip.", "short_description": "Decompress a buffer with Gunzip.", "ellipsis_description": "Decompress a buffer with Gunzip. ...", "line": 297, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.gunzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L297", "name": "gunzip", "path": "zlib.gunzip" }, { "id": "zlib.gzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Compresses a buffer using Gzip.", "short_description": "Compresses a buffer using Gzip.", "ellipsis_description": "Compresses a buffer using Gzip. ...", "line": 282, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.gzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L282", "name": "gzip", "path": "zlib.gzip" }, { "id": "zlib.inflate", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Inflate.", "short_description": "Decompress a buffer with Inflate.", "ellipsis_description": "Decompress a buffer with Inflate. ...", "line": 312, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.inflate", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L312", "name": "inflate", "path": "zlib.inflate" }, { "id": "zlib.inflateRaw", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader)..", "short_description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader)..", "ellipsis_description": "Decompress a raw buffer with a raw deflate stream (one without an appended zlib\nheader).. ...", "line": 328, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.inflateRaw", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L328", "name": "inflateRaw", "path": "zlib.inflateRaw" }, { "id": "zlib.options", "type": "class property", "signatures": [ { "returns": [ { "type": "Object" } ] } ], "description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n\nNote that some options are only relevant when compressing, and are ignored by\nthe decompression classes.\n\nThe options are:\n\n* chunkSize (default: 16*1024)\n* windowBits\n* level (compression only)\n* memLevel (compression only)\n* strategy (compression only)\n\nSee the description of `deflateInit2` and `inflateInit2` at\n for more information on these.\n\n#### Memory Usage Tuning\n\nFrom `zlib/zconf.h`, modified to Node's usage:\n\nThe memory requirements for deflate are (in bytes):\n\n (1 << (windowBits+2)) + (1 << (memLevel+9))\n\nthat is: 128K for `windowBits=15` and 128K for `memLevel = 8`\n(default values) plus a few kilobytes for small objects.\n\nFor example, if you want to reduce the default memory requirements from 256K to\n128K, set the options to:\n\n { windowBits: 14, memLevel: 7 }\n\nOf course, this will generally degrade compression (there's no free lunch).\n\nThe memory requirements for inflate are (in bytes)\n\n 1 << windowBits\n\nthat is: 32K for `windowBits=15` (default value) plus a few kilobytes\nfor small objects.\n\nThis is in addition to a single internal output slab buffer of size `chunkSize`,\nwhich defaults to 16K.\n\nThe speed of zlib compression is affected most dramatically by the `level`\nsetting. A higher level will result in better compression, but takes longer to\ncomplete. A lower level will result in less compression, but will be much\nfaster.\n\nIn general, greater memory usage options will mean that node has to make fewer\ncalls to zlib, since it'll be able to process more data in a single `write`\noperation. This is another factor that affects the speed, at the cost of memory\nusage.\n\n#### Examples\n\nNote: These examples are drastically simplified to show the basic concept. Zlib encoding can be expensive, and the results ought to be cached. See [Memory Usage Tuning](#memory_Usage_Tuning) for more information on the speed/memory/compression tradeoffs involved in zlib usage.\n\nCompressing or decompressing a file can be done by piping an `fs.ReadStream`\ninto a zlib stream, then into an `fs.WriteStream`.\n\n\n\nCompressing or decompressing data in one step can be done by using the\nconvenience methods.\n\n\n\nTo use this module in an HTTP client or server, use the\n[accept-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n) on requests, and the\n[content-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.\n11) header on responses. Here's an example:\n\n // client request example\n var zlib = require('zlib');\n var http = require('http');\n var fs = require('fs');\n var request = http.get({ host: 'izs.me',\n path: '/',\n port: 80,\n headers: { 'accept-encoding': 'gzip,deflate' } });\n request.on('response', function(response) {\n var output = fs.createWriteStream('izs.me_index.html');\n\n switch (response.headers['content-encoding']) {\n // or, just use zlib.createUnzip() to handle both cases\n case 'gzip':\n response.pipe(zlib.createGunzip()).pipe(output);\n break;\n case 'deflate':\n response.pipe(zlib.createInflate()).pipe(output);\n break;\n default:\n response.pipe(output);\n break;\n }\n });\n\n // server example\n // Running a gzip operation on every request is quite expensive.\n // It would be much more efficient to cache the compressed buffer.\n var zlib = require('zlib');\n var http = require('http');\n var fs = require('fs');\n http.createServer(function(request, response) {\n var raw = fs.createReadStream('index.html');\n var acceptEncoding = request.headers['accept-encoding'];\n if (!acceptEncoding) {\n acceptEncoding = '';\n }\n\n // Note: this is not a conformant accept-encoding parser.\n // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n if (acceptEncoding.match(/\\bdeflate\\b/)) {\n response.writeHead(200, { 'content-encoding': 'deflate' });\n raw.pipe(zlib.createDeflate()).pipe(response);\n } else if (acceptEncoding.match(/\\bgzip\\b/)) {\n response.writeHead(200, { 'content-encoding': 'gzip' });\n raw.pipe(zlib.createGzip()).pipe(response);\n } else {\n response.writeHead(200, {});\n raw.pipe(response);\n }\n }).listen(1337);", "short_description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n", "ellipsis_description": "Each class takes an optional options object. All options are optional. (The\nconvenience methods use the default se...", "line": 151, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.options", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L151", "name": "options", "path": "zlib.options" }, { "id": "zlib.unzip", "type": "class method", "signatures": [ { "args": [ { "name": "buf", "types": [ "Buffer" ] }, { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } ], "callback": { "name": "callback", "args": [ { "name": "error", "type": [ "Error" ] }, { "name": "result", "type": [ "Object" ] } ], "callback": true, "types": [ "Function" ] } } ], "arguments": [ { "name": "buf", "types": [ "Buffer" ], "description": "The buffer to compress" }, { "name": "callback", "types": [ "Function" ], "description": "The function to execute once the method completes" }, { "name": "error", "types": [ "Error" ], "description": "The standard error object" }, { "name": "result", "types": [ "Object" ], "description": "The result of the method" } ], "description": "Decompress a buffer with Unzip.", "short_description": "Decompress a buffer with Unzip.", "ellipsis_description": "Decompress a buffer with Unzip. ...", "line": 342, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib.unzip", "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L342", "name": "unzip", "path": "zlib.unzip" } ], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/zlib.markdown", "fileName": "zlib", "resultingFile": "zlib.html#zlib", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/zlib.markdown#L17", "name": "zlib", "path": "zlib" }, { "id": "Addons", "type": "class", "description": "Addons are dynamically linked shared objects. They can provide glue to C and\nC++ libraries. The API (at the moment) is rather complex, involving\nknowledge of several libraries:\n\n - V8 Javascript, a C++ library. Used for interfacing with Javascript:\n creating objects, calling functions, etc. These are documented mostly in\n the `v8.h` header file (`deps/v8/include/v8.h` in the Node.js source tree),\n and also available [online](http://izs.me/v8-docs/main.html).\n\n - [libuv](https://github.com/joyent/libuv), a C event loop library. Anytime\n one needs to wait for a file descriptor to become readable, wait for a timer,\n or wait for a signal to received one needs to interface with libuv. That is,\n if you perform any I/O, libuv needs to be used.\n\n - Internal Node libraries. Most importantly is the `node::ObjectWrap` class\n which you will likely want to derive from.\n\n - Additional libraries are located the `deps/` folder.\n\nNode.js statically compiles all its dependencies into the executable. When\ncompiling your module, you don't need to worry about linking to any of these\nlibraries.\n\nFirst, let's make a small Addon which is the C++ equivalent of the following\nJavascript code:\n\n exports.hello = function() { return 'world'; };\n\nTo get started, we'll create a file `hello.cc`:\n\n #include \n #include \n\n using namespace v8;\n\n Handle Method(const Arguments& args) {\n HandleScope scope;\n return scope.Close(String::New(\"world\"));\n }\n\n void init(Handle target) {\n NODE_SET_METHOD(target, \"hello\", Method);\n }\n NODE_MODULE(hello, init)\n\nNote that all Node.js addons must export an initialization function:\n\n void Initialize (Handle target);\n NODE_MODULE(module_name, Initialize)\n\nThere is no semi-colon after `NODE_MODULE`, as it's not a function (for more\ninformation, see `node.h`).\n\nThe source code needs to be built into `hello.node`, the binary Addon. To do\nthis we create a file called `wscript` which is python code and looks like\nthis:\n\n srcdir = '.'\n blddir = 'build'\n VERSION = '0.0.1'\n\n def set_options(opt):\n opt.tool_options('compiler_cxx')\n\n def configure(conf):\n conf.check_tool('compiler_cxx')\n conf.check_tool('node_addon')\n\n def build(bld):\n obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')\n obj.target = 'hello'\n obj.source = 'hello.cc'\n\nRunning `node-waf configure build` will create a file\n`build/default/hello.node` which is our Addon.\n\n`node-waf` is just [WAF](http://code.google.com/p/waf), the Python-based\nbuild system. `node-waf` is provided for developers to easily access it.\n\nYou can now use the binary addon in a Node project `hello.js` by pointing\n`require` to the recently built module:\n\n var addon = require('./build/Release/hello');\n\n console.log(addon.hello()); // 'world'\n\nFor the moment, that is all the documentation on addons. Please see\n for a real example.", "short_description": "Addons are dynamically linked shared objects. They can provide glue to C and\nC++ libraries. The API (at the moment) is rather complex, involving\nknowledge of several libraries:\n", "ellipsis_description": "Addons are dynamically linked shared objects. They can provide glue to C and\nC++ libraries. The API (at the moment) ...", "line": 95, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/addons.markdown", "fileName": "addons", "resultingFile": "addons.html#Addons", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/addons.markdown#L95", "name": "Addons", "path": "Addons" }, { "id": "Debugger", "type": "class", "description": "\nV8 comes with an extensive debugger which is accessible out-of-process via a\nsimple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).\n\nNode.js has a built-in client for this debugger. To use this, start Node.js with\nthe `debug` argument; a prompt appears, ready to take your command:\n\n % node debug myscript.js\n < debugger listening on port 5858\n connecting... ok\n break in /home/indutny/Code/git/indutny/myscript.js:1\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n debug>\n\nNode's debugger client doesn't support the full range of commands, but simple\nstep and inspection is possible. By putting the statement `debugger;` into the\nsource code of your script, you will enable a breakpoint.\n\nFor example, suppose `myscript.js` looked like this:\n\n // myscript.js\n x = 5;\n setTimeout(function () {\n debugger;\n console.log(\"world\");\n }, 1000);\n console.log(\"hello\");\n\nThen once the debugger is run, it will break on line 4.\n\n % node debug myscript.js\n < debugger listening on port 5858\n connecting... ok\n break in /home/indutny/Code/git/indutny/myscript.js:1\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n debug> cont\n < hello\n break in /home/indutny/Code/git/indutny/myscript.js:3\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n 4 console.log(\"world\");\n 5 }, 1000);\n debug> next\n break in /home/indutny/Code/git/indutny/myscript.js:4\n 2 setTimeout(function () {\n 3 debugger;\n 4 console.log(\"world\");\n 5 }, 1000);\n 6 console.log(\"hello\");\n debug> repl\n Press Ctrl + C to leave debug repl\n > x\n 5\n > 2+2\n 4\n debug> next\n < world\n break in /home/indutny/Code/git/indutny/myscript.js:5\n 3 debugger;\n 4 console.log(\"world\");\n 5 }, 1000);\n 6 console.log(\"hello\");\n 7\n debug> quit\n %\n\n\nThe `repl` command allows you to evaluate code remotely. The `next` command\nsteps over to the next line. There are a few other commands available and more\nto come. Type `help` to see others.\n\nThere are some online JavaScript IDEs, like [Cloud9](http://www.c9.io),\nwhich provide the Node.js standard debugging mechanisms, as well as more.\n\n## Watchers\n\nYou can watch expressions and variable values while debugging your code.\n\nOn every breakpoint each expression from the watchers list will be evaluated in\nthe current context and displayed just before the breakpoint's source code\nlisting.\n\nTo start watching an expression, type `watch(\"my_expression\")`. `watchers`\nprints the active watchers. To remove a watcher, type\n`unwatch(\"my_expression\")`.\n\n## Commands Reference\n\n### Stepping\n\n* `cont`, `c`: Continue\n* `next`, `n`: Step next\n* `step`, `s`: Step in\n* `out`, `o`: Step out\n\n### Breakpoints\n\n* `setBreakpoint()`, `sb()`: Sets a breakpoint on the current line\n* `setBreakpoint('fn()')`, `sb(...)`: Sets a breakpoint on the first statement\nin the function's body\n* `setBreakpoint('script.js', 1)`, `sb(...)`: Sets a breakpoint on the first\nline of `script.js`\n* `clearBreakpoint`, `cb(...)`: Clears a breakpoint\n\n### Info\n\n* `backtrace`, `bt`: Prints a backtrace of the current execution frame\n* `list(c)`: Lists the script's source code with a five line context (five lines\nbefore and after)\n* `watch(expr)`: Adds an expression to the watch list\n* `unwatch(expr)`: Removes am expression from the watch list\n* `watchers`: Lists all the watchers and their values (automatically listed on\neach breakpoint)\n* `repl`: Open the debugger's REPL for evaluation in debugging a script's\ncontext\n\n### Execution control\n\n* `run`: Run a script (automatically runs on debugger's start)\n* `restart`: Restart a script\n* `kill`: Kill a script\n\n### Various\n\n* `scripts`: List all the loaded scripts\n* `version`: Display the V8 version\n\n## Advanced Usage\n\nThe V8 debugger can be enabled and accessed either by starting Node.js with the\n`--debug` command-line flag or by signaling an existing Node.js process with\n`SIGUSR1`.", "stability": "3 - Stable", "short_description": "\nV8 comes with an extensive debugger which is accessible out-of-process via a\nsimple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).\n", "ellipsis_description": "\nV8 comes with an extensive debugger which is accessible out-of-process via a\nsimple [TCP protocol](http://code.goog...", "line": 145, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/debugger.markdown", "fileName": "debugger", "resultingFile": "debugger.html#Debugger", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/debugger.markdown#L145", "name": "Debugger", "path": "Debugger" }, { "id": "Domain", "type": "class", "description": "\nDomains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters or callbacks registered to a\ndomain emit an `error` event, or throw an error, then the domain object\nwill be notified, rather than losing the context of the error in the\n`process.on('uncaughtException')` handler, or causing the program to\nexit with an error code.\n\nThis feature is new in Node version 0.8. It is a first pass, and is\nexpected to change significantly in future versions. Please use it and\nprovide feedback.\n\nDue to their experimental nature, the Domains features are disabled unless\nthe `domain` module is loaded at least once. No domains are created or\nregistered by default. This is by design, to prevent adverse effects on\ncurrent programs. It is expected to be enabled by default in future\nNode.js versions.\n\n## Additions to Error objects\n\n\n\nAny time an Error object is routed through a domain, a few extra fields\nare added to it.\n\n* `error.domain` The domain that first handled the error.\n* `error.domain_emitter` The event emitter that emitted an 'error' event\n with the error object.\n* `error.domain_bound` The callback function which was bound to the\n domain, and passed an error as its first argument.\n* `error.domain_thrown` A boolean indicating whether the error was\n thrown, emitted, or passed to a bound callback function.\n\n## Implicit Binding\n\n\n\nIf domains are in use, then all new EventEmitter objects (including\nStream objects, requests, responses, etc.) will be implicitly bound to\nthe active domain at the time of their creation.\n\nAdditionally, callbacks passed to lowlevel event loop requests (such as\nto fs.open, or other callback-taking methods) will automatically be\nbound to the active domain. If they throw, then the domain will catch\nthe error.\n\nIn order to prevent excessive memory usage, Domain objects themselves\nare not implicitly added as children of the active domain. If they\nwere, then it would be too easy to prevent request and response objects\nfrom being properly garbage collected.\n\nIf you *want* to nest Domain objects as children of a parent Domain,\nthen you must explicitly add them, and then dispose of them later.\n\nImplicit binding routes thrown errors and `'error'` events to the\nDomain's `error` event, but does not register the EventEmitter on the\nDomain, so `domain.dispose()` will not shut down the EventEmitter.\nImplicit binding only takes care of thrown errors and `'error'` events.\n\n## Explicit Binding\n\n\n\nSometimes, the domain in use is not the one that ought to be used for a\nspecific event emitter. Or, the event emitter could have been created\nin the context of one domain, but ought to instead be bound to some\nother domain.\n\nFor example, there could be one domain in use for an HTTP server, but\nperhaps we would like to have a separate domain to use for each request.\n\nThat is possible via explicit binding.\n\nFor example:\n\n```\n// create a top-level domain for the server\nvar serverDomain = domain.create();\n\nserverDomain.run(function() {\n // server is created in the scope of serverDomain\n http.createServer(function(req, res) {\n // req and res are also created in the scope of serverDomain\n // however, we'd prefer to have a separate domain for each request.\n // create it first thing, and add req and res to it.\n var reqd = domain.create();\n reqd.add(req);\n reqd.add(res);\n reqd.on('error', function(er) {\n console.error('Error', er, req.url);\n try {\n res.writeHead(500);\n res.end('Error occurred, sorry.');\n res.on('close', function() {\n // forcibly shut down any other things added to this domain\n reqd.dispose();\n });\n } catch (er) {\n console.error('Error sending 500', er, req.url);\n // tried our best. clean up anything remaining.\n reqd.dispose();\n }\n });\n }).listen(1337);\n});\n```\n\n## domain.create()\n\n* return: {Domain}\n\nReturns a new Domain object.\n\n## Class: Domain\n\nThe Domain class encapsulates the functionality of routing errors and\nuncaught exceptions to the active Domain object.\n\nDomain is a child class of EventEmitter. To handle the errors that it\ncatches, listen to its `error` event.\n\n### domain.run(fn)\n\n* `fn` {Function}\n\nRun the supplied function in the context of the domain, implicitly\nbinding all event emitters, timers, and lowlevel requests that are\ncreated in that context.\n\nThis is the most basic way to use a domain.\n\nExample:\n\n```\nvar d = domain.create();\nd.on('error', function(er) {\n console.error('Caught error!', er);\n});\nd.run(function() {\n process.nextTick(function() {\n setTimeout(function() { // simulating some various async stuff\n fs.open('non-existent file', 'r', function(er, fd) {\n if (er) throw er;\n // proceed...\n });\n }, 100);\n });\n});\n```\n\nIn this example, the `d.on('error')` handler will be triggered, rather\nthan crashing the program.\n\n### domain.members\n\n* {Array}\n\nAn array of timers and event emitters that have been explicitly added\nto the domain.\n\n### domain.add(emitter)\n\n* `emitter` {EventEmitter | Timer} emitter or timer to be added to the domain\n\nExplicitly adds an emitter to the domain. If any event handlers called by\nthe emitter throw an error, or if the emitter emits an `error` event, it\nwill be routed to the domain's `error` event, just like with implicit\nbinding.\n\nThis also works with timers that are returned from `setInterval` and\n`setTimeout`. If their callback function throws, it will be caught by\nthe domain 'error' handler.\n\nIf the Timer or EventEmitter was already bound to a domain, it is removed\nfrom that one, and bound to this one instead.\n\n### domain.remove(emitter)\n\n* `emitter` {EventEmitter | Timer} emitter or timer to be removed from the\ndomain\n\nThe opposite of `domain.add(emitter)`. Removes domain handling from the\nspecified emitter.\n\n### domain.bind(cb)\n\n* `cb` {Function} The callback function\n* return: {Function} The bound function\n\nThe returned function will be a wrapper around the supplied callback\nfunction. When the returned function is called, any errors that are\nthrown will be routed to the domain's `error` event.\n\n#### Example\n\n var d = domain.create();\n\n function readSomeFile(filename, cb) {\n fs.readFile(filename, d.bind(function(er, data) {\n // if this throws, it will also be passed to the domain\n return cb(er, JSON.parse(data));\n }));\n }\n\n d.on('error', function(er) {\n // an error occurred somewhere.\n // if we throw it now, it will crash the program\n // with the normal line number and stack message.\n });\n\n### domain.intercept(cb)\n\n* `cb` {Function} The callback function\n* return: {Function} The intercepted function\n\nThis method is almost identical to `domain.bind(cb)`. However, in\naddition to catching thrown errors, it will also intercept `Error`\nobjects sent as the first argument to the function.\n\nIn this way, the common `if (er) return cb(er);` pattern can be replaced\nwith a single error handler in a single place.\n\n#### Example\n\n var d = domain.create();\n\n function readSomeFile(filename, cb) {\n fs.readFile(filename, d.intercept(function(er, data) {\n // if this throws, it will also be passed to the domain\n // additionally, we know that 'er' will always be null,\n // so the error-handling logic can be moved to the 'error'\n // event on the domain instead of being repeated throughout\n // the program.\n return cb(er, JSON.parse(data));\n }));\n }\n\n d.on('error', function(er) {\n // an error occurred somewhere.\n // if we throw it now, it will crash the program\n // with the normal line number and stack message.\n });\n\n### domain.dispose()\n\nThe dispose method destroys a domain, and makes a best effort attempt to\nclean up any and all IO that is associated with the domain. Streams are\naborted, ended, closed, and/or destroyed. Timers are cleared.\nExplicitly bound callbacks are no longer called. Any error events that\nare raised as a result of this are ignored.\n\nThe intention of calling `dispose` is generally to prevent cascading\nerrors when a critical part of the Domain context is found to be in an\nerror state.\n\nNote that IO might still be performed. However, to the highest degree\npossible, once a domain is disposed, further errors from the emitters in\nthat set will be ignored. So, even if some remaining actions are still\nin flight, Node.js will not communicate further about them.", "stability": "1 - Experimental", "short_description": "\nDomains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters or callbacks registered to a\ndomain emit an `error` event, or throw an error, then the domain object\nwill be notified, rather than losing the context of the error in the\n`process.on('uncaughtException')` handler, or causing the program to\nexit with an error code.\n", "ellipsis_description": "\nDomains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters o...", "line": 267, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/domain.markdown", "fileName": "domain", "resultingFile": "domain.html#Domain", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/domain.markdown#L267", "name": "Domain", "path": "Domain" }, { "id": "Globals", "type": "class", "description": "These objects are available to all modules. Some of these objects aren't\nactually in the global scope, but in the module scope; they'll be noted as such\nbelow.\n\n
\n
__dirname
\n
The name of the directory that the currently executing script resides in.\n__dirname isn't actually on the global scope, but is local to each\nmodule.
\n
For example, if you're running node example.js from /Users/mjr:\n\n
\n    console.log(__dirname);\n    // prints /Users/mjr\n
\n
\n\n
__filename
\n
The filename of the code being executed. This is the resolved absolute path\nof this code file. For a main program this is not necessarily the same filename\nused in the command line. The value inside a module is the path to that module\nfile.
\n
__filename isn't actually on the global scope, but is local to each\nmodule.
\n
For example, if you're running node example.js from /Users/mjr:\n\n
\n    console.log(__filename);\n    // prints /Users/mjr/example.js\n
\n
\n\n
Buffer
\n
Used to handle binary data. See the [[Buffer Buffers]] section for more\ninformation.
\n\n
console
\n
Used to print to stdout and stderr. See the [[console STDIO]] section for\nmore information.
\n\n
exports
\n
An object which is shared between all instances of the current module and\nmade accessible through require().
\n
exports is the same as the module.exports object. See src/node.js for\nmore information.
\n
exports isn't actually on the global scope, but is local to each\nmodule.
\n\n
global
\n
The global namespace object.
\n
In browsers, the top-level scope is the global scope. That means that in\nbrowsers if you're in the global scope var something will define a global\nvariable. In Node.js this is different. The top-level scope is not the global\nscope; var something inside a Node.js module is local only to that\nmodule.
\n\n
module
\n
A reference to the current module. In particular module.exports is the\nsame as the exports object. See src/node.js for more information.
\n
module isn't actually on the global scope, but is local to each\nmodule.
\n\n
process
\n
The process object. See the [process object](process.html) section for more\ninformation.
\n\n
require()
\n
This is necessary to require modules. See the [Modules](modules.html)\nsection for more information.
\n
require isn't actually on the global scope, but is local to each\nmodule.
\n\n
require.cache
\n
Modules are cached in this object when they are required. By deleting a key\nvalue from this object, the next require will reload the module.
\n\n
require.resolve()
\n
Use the internal require() machinery to look up the location of a module,\nbut rather than loading the module, just return the resolved filename.
\n\n
setTimeout(cb, ms)
\nclearTimeout(t)
\nsetInterval(cb, ms)
\nclearInterval(t)
\n
These timer functions are all global variables. See the [[timer Timers]]\nsection for more information.
\n
", "short_description": "These objects are available to all modules. Some of these objects aren't\nactually in the global scope, but in the module scope; they'll be noted as such\nbelow.\n", "ellipsis_description": "These objects are available to all modules. Some of these objects aren't\nactually in the global scope, but in the mo...", "line": 94, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/globals.markdown", "fileName": "globals", "resultingFile": "globals.html#Globals", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/globals.markdown#L94", "name": "Globals", "path": "Globals" }, { "id": "Index", "type": "class", "description": "Node.js is a server-side Javascript environment. It's event-driven,\nasynchronous, and allows you to write a web server in a relatively quick amount\nof time.\n\nThis section is the Node.js Reference API in its entirety. You can change the\nversion of the Node.js documentation by using the dropdown in the toolbar.", "short_description": "Node.js is a server-side Javascript environment. It's event-driven,\nasynchronous, and allows you to write a web server in a relatively quick amount\nof time.\n", "ellipsis_description": "Node.js is a server-side Javascript environment. It's event-driven,\nasynchronous, and allows you to write a web serv...", "line": 13, "aliases": [], "children": [], "parentDir": "nodejs_ref_guide", "fullPath": "src/latest/nodejs_ref_guide/index.markdown", "fileName": "index", "resultingFile": "index.html#Index", "subclasses": [], "href": "https://github.com/c9/nodemanual.org/blob/master/src/latest/nodejs_ref_guide/index.markdown#L13", "name": "Index", "path": "Index" } ] }, "date": "Tue, 26 Jun 2012 02:14:15 GMT" }