Permalink
Browse files

removed git watch buttons

upgrade api version to 0.8.6
  • Loading branch information...
1 parent 02cd6f8 commit 7aed6bd050650235d48cddf331290cb4c7d6ee51 @lizhepro committed Aug 13, 2012
Showing with 9 additions and 50 deletions.
  1. +1 −1 config.js
  2. +1 −1 public/bootstrap/css/bootstrap.min.css
  3. +0 −1 public/json/0.8.1/addons.json
  4. +0 −1 public/json/0.8.1/appendix_1.json
  5. +0 −1 public/json/0.8.1/assert.json
  6. +0 −1 public/json/0.8.1/buffer.json
  7. +0 −1 public/json/0.8.1/child_process.json
  8. +0 −1 public/json/0.8.1/cluster.json
  9. +0 −1 public/json/0.8.1/crypto.json
  10. +0 −1 public/json/0.8.1/debugger.json
  11. +0 −1 public/json/0.8.1/dgram.json
  12. +0 −1 public/json/0.8.1/dns.json
  13. +0 −1 public/json/0.8.1/documentation.json
  14. +0 −1 public/json/0.8.1/events.json
  15. +0 −1 public/json/0.8.1/fs.json
  16. +0 −1 public/json/0.8.1/globals.json
  17. +0 −1 public/json/0.8.1/https.json
  18. +0 −1 public/json/0.8.1/modules.json
  19. +0 −1 public/json/0.8.1/mydata.json
  20. +0 −1 public/json/0.8.1/net.json
  21. +0 −1 public/json/0.8.1/os.json
  22. +0 −1 public/json/0.8.1/path.json
  23. +0 −1 public/json/0.8.1/process.json
  24. +0 −1 public/json/0.8.1/punycode.json
  25. +0 −1 public/json/0.8.1/querystring.json
  26. +0 −1 public/json/0.8.1/readline.json
  27. +0 −1 public/json/0.8.1/repl.json
  28. +0 −1 public/json/0.8.1/stdio.json
  29. +0 −1 public/json/0.8.1/stream.json
  30. +0 −1 public/json/0.8.1/string_decoder.json
  31. +0 −1 public/json/0.8.1/synopsis.json
  32. +0 −1 public/json/0.8.1/timers.json
  33. +0 −1 public/json/0.8.1/tls.json
  34. +0 −1 public/json/0.8.1/tty.json
  35. +0 −1 public/json/0.8.1/url.json
  36. +0 −1 public/json/0.8.1/util.json
  37. +0 −1 public/json/0.8.1/vm.json
  38. +0 −1 public/json/0.8.1/zlib.json
  39. +0 −1 public/json/0.8.3/child_process.json
  40. +0 −1 public/json/0.8.3/cluster.json
  41. +0 −1 public/json/0.8.3/domain.json
  42. +0 −1 public/json/0.8.3/http.json
  43. +0 −1 public/json/0.8.3/mydata.json
  44. 0 public/json/{0.8.3 → 0.8.6}/addons.json
  45. 0 public/json/{0.8.3 → 0.8.6}/appendix_1.json
  46. 0 public/json/{0.8.3 → 0.8.6}/assert.json
  47. 0 public/json/{0.8.3 → 0.8.6}/buffer.json
  48. +1 −0 public/json/0.8.6/child_process.json
  49. +1 −0 public/json/0.8.6/cluster.json
  50. 0 public/json/{0.8.3 → 0.8.6}/crypto.json
  51. 0 public/json/{0.8.3 → 0.8.6}/debugger.json
  52. 0 public/json/{0.8.3 → 0.8.6}/dgram.json
  53. 0 public/json/{0.8.3 → 0.8.6}/dns.json
  54. 0 public/json/{0.8.3 → 0.8.6}/documentation.json
  55. +1 −1 public/json/{0.8.1 → 0.8.6}/domain.json
  56. 0 public/json/{0.8.3 → 0.8.6}/events.json
  57. 0 public/json/{0.8.3 → 0.8.6}/fs.json
  58. 0 public/json/{0.8.3 → 0.8.6}/globals.json
  59. +1 −1 public/json/{0.8.1 → 0.8.6}/http.json
  60. 0 public/json/{0.8.3 → 0.8.6}/https.json
  61. 0 public/json/{0.8.3 → 0.8.6}/modules.json
  62. +1 −0 public/json/0.8.6/mydata.json
  63. 0 public/json/{0.8.3 → 0.8.6}/net.json
  64. 0 public/json/{0.8.3 → 0.8.6}/os.json
  65. 0 public/json/{0.8.3 → 0.8.6}/path.json
  66. 0 public/json/{0.8.3 → 0.8.6}/process.json
  67. 0 public/json/{0.8.3 → 0.8.6}/punycode.json
  68. 0 public/json/{0.8.3 → 0.8.6}/querystring.json
  69. 0 public/json/{0.8.3 → 0.8.6}/readline.json
  70. 0 public/json/{0.8.3 → 0.8.6}/repl.json
  71. 0 public/json/{0.8.3 → 0.8.6}/stdio.json
  72. 0 public/json/{0.8.3 → 0.8.6}/stream.json
  73. 0 public/json/{0.8.3 → 0.8.6}/string_decoder.json
  74. 0 public/json/{0.8.3 → 0.8.6}/synopsis.json
  75. 0 public/json/{0.8.3 → 0.8.6}/timers.json
  76. 0 public/json/{0.8.3 → 0.8.6}/tls.json
  77. 0 public/json/{0.8.3 → 0.8.6}/tty.json
  78. 0 public/json/{0.8.3 → 0.8.6}/url.json
  79. +1 −1 public/json/{0.8.3 → 0.8.6}/util.json
  80. 0 public/json/{0.8.3 → 0.8.6}/vm.json
  81. 0 public/json/{0.8.3 → 0.8.6}/zlib.json
  82. +1 −4 views/index.jade
View
2 config.js
@@ -1,5 +1,5 @@
exports.getDefaultConfig = function() {
return {
- API_VERSION: '0.8.3'
+ API_VERSION: '0.8.6'
};
};
View
2 public/bootstrap/css/bootstrap.min.css
1 addition, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 public/json/0.8.1/addons.json
@@ -1 +0,0 @@
-{"source":"doc/api/addons.markdown","modules":[{"textRaw":"Addons","name":"addons","desc":"<p>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</p>\n<ul>\n<li><p>V8 JavaScript, a C++ library. Used for interfacing with JavaScript:\ncreating objects, calling functions, etc. Documented mostly in the\n<code>v8.h</code> header file (<code>deps/v8/include/v8.h</code> in the Node source tree),\nwhich is also available <a href=\"http://izs.me/v8-docs/main.html\">online</a>.</p>\n</li>\n<li><p><a href=\"https://github.com/joyent/libuv\">libuv</a>, C event loop library. Anytime one\nneeds to wait for a file descriptor to become readable, wait for a timer, or\nwait for a signal to received one will need to interface with libuv. That is,\nif you perform any I/O, libuv will need to be used.</p>\n</li>\n<li><p>Internal Node libraries. Most importantly is the <code>node::ObjectWrap</code>\nclass which you will likely want to derive from.</p>\n</li>\n<li><p>Others. Look in <code>deps/</code> for what else is available.</p>\n</li>\n</ul>\n<p>Node statically compiles all its dependencies into the executable. When\ncompiling your module, you don&apos;t need to worry about linking to any of these\nlibraries.\n\n\n</p>\n","modules":[{"textRaw":"Hello world","name":"hello_world","desc":"<p>To get started let&apos;s make a small Addon which is the C++ equivalent of\nthe following JavaScript code:\n\n</p>\n<pre><code>exports.hello = function() { return &apos;world&apos;; };</code></pre>\n<p>First we create a file <code>hello.cc</code>:\n\n</p>\n<pre><code>#include &lt;node.h&gt;\n#include &lt;v8.h&gt;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; Method(const Arguments&amp; args) {\n HandleScope scope;\n return scope.Close(String::New(&quot;world&quot;));\n}\n\nvoid init(Handle&lt;Object&gt; target) {\n target-&gt;Set(String::NewSymbol(&quot;hello&quot;),\n FunctionTemplate::New(Method)-&gt;GetFunction());\n}\nNODE_MODULE(hello, init)</code></pre>\n<p>Note that all Node addons must export an initialization function:\n\n</p>\n<pre><code>void Initialize (Handle&lt;Object&gt; target);\nNODE_MODULE(module_name, Initialize)</code></pre>\n<p>There is no semi-colon after <code>NODE_MODULE</code> as it&apos;s not a function (see <code>node.h</code>).\n\n</p>\n<p>The <code>module_name</code> needs to match the filename of the final binary (minus the\n.node suffix).\n\n</p>\n<p>The source code needs to be built into <code>hello.node</code>, the binary Addon. To\ndo this we create a file called <code>binding.gyp</code> which describes the configuration\nto build your module in a JSON-like format. This file gets compiled by\n<a href=\"https://github.com/TooTallNate/node-gyp\">node-gyp</a>.\n\n</p>\n<pre><code>{\n &quot;targets&quot;: [\n {\n &quot;target_name&quot;: &quot;hello&quot;,\n &quot;sources&quot;: [ &quot;hello.cc&quot; ]\n }\n ]\n}</code></pre>\n<p>The next step is to generate the appropriate project build files for the\ncurrent platform. Use <code>node-gyp configure</code> for that.\n\n</p>\n<p>Now you will have either a <code>Makefile</code> (on Unix platforms) or a <code>vcxproj</code> file\n(on Windows) in the <code>build/</code> directory. Next invoke the <code>node-gyp build</code>\ncommand.\n\n</p>\n<p>Now you have your compiled <code>.node</code> bindings file! The compiled bindings end up\nin <code>build/Release/</code>.\n\n</p>\n<p>You can now use the binary addon in a Node project <code>hello.js</code> by pointing <code>require</code> to\nthe recently built <code>hello.node</code> module:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/hello&apos;);\n\nconsole.log(addon.hello()); // &apos;world&apos;</code></pre>\n<p>Please see patterns below for further information or\n</p>\n<p><a href=\"https://github.com/arturadib/node-qt\">https://github.com/arturadib/node-qt</a> for an example in production.\n\n\n</p>\n","type":"module","displayName":"Hello world"},{"textRaw":"Addon patterns","name":"addon_patterns","desc":"<p>Below are some addon patterns to help you get started. Consult the online\n<a href=\"http://izs.me/v8-docs/main.html\">v8 reference</a> for help with the various v8\ncalls, and v8&apos;s <a href=\"http://code.google.com/apis/v8/embed.html\">Embedder&apos;s Guide</a>\nfor an explanation of several concepts used such as handles, scopes,\nfunction templates, etc.\n\n</p>\n<p>In order to use these examples you need to compile them using <code>node-gyp</code>.\nCreate the following <code>binding.gyp</code> file:\n\n</p>\n<pre><code>{\n &quot;targets&quot;: [\n {\n &quot;target_name&quot;: &quot;addon&quot;,\n &quot;sources&quot;: [ &quot;addon.cc&quot; ]\n }\n ]\n}</code></pre>\n<p>In cases where there is more than one <code>.cc</code> file, simply add the file name to the\n<code>sources</code> array, e.g.:\n\n</p>\n<pre><code>&quot;sources&quot;: [&quot;addon.cc&quot;, &quot;myexample.cc&quot;]</code></pre>\n<p>Now that you have your <code>binding.gyp</code> ready, you can configure and build the\naddon:\n\n</p>\n<pre><code>$ node-gyp configure build</code></pre>\n","modules":[{"textRaw":"Function arguments","name":"function_arguments","desc":"<p>The following pattern illustrates how to read arguments from JavaScript\nfunction calls and return a result. This is the main and only needed source\n<code>addon.cc</code>:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; Add(const Arguments&amp; args) {\n HandleScope scope;\n\n if (args.Length() &lt; 2) {\n ThrowException(Exception::TypeError(String::New(&quot;Wrong number of arguments&quot;)));\n return scope.Close(Undefined());\n }\n\n if (!args[0]-&gt;IsNumber() || !args[1]-&gt;IsNumber()) {\n ThrowException(Exception::TypeError(String::New(&quot;Wrong arguments&quot;)));\n return scope.Close(Undefined());\n }\n\n Local&lt;Number&gt; num = Number::New(args[0]-&gt;NumberValue() +\n args[1]-&gt;NumberValue());\n return scope.Close(num);\n}\n\nvoid Init(Handle&lt;Object&gt; target) {\n target-&gt;Set(String::NewSymbol(&quot;add&quot;),\n FunctionTemplate::New(Add)-&gt;GetFunction());\n}\n\nNODE_MODULE(addon, Init)</code></pre>\n<p>You can test it with the following JavaScript snippet:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\nconsole.log( &apos;This should be eight:&apos;, addon.add(3,5) );</code></pre>\n","type":"module","displayName":"Function arguments"},{"textRaw":"Callbacks","name":"callbacks","desc":"<p>You can pass JavaScript functions to a C++ function and execute them from\nthere. Here&apos;s <code>addon.cc</code>:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; RunCallback(const Arguments&amp; args) {\n HandleScope scope;\n\n Local&lt;Function&gt; cb = Local&lt;Function&gt;::Cast(args[0]);\n const unsigned argc = 1;\n Local&lt;Value&gt; argv[argc] = { Local&lt;Value&gt;::New(String::New(&quot;hello world&quot;)) };\n cb-&gt;Call(Context::GetCurrent()-&gt;Global(), argc, argv);\n\n return scope.Close(Undefined());\n}\n\nvoid Init(Handle&lt;Object&gt; target) {\n target-&gt;Set(String::NewSymbol(&quot;runCallback&quot;),\n FunctionTemplate::New(RunCallback)-&gt;GetFunction());\n}\n\nNODE_MODULE(addon, Init)</code></pre>\n<p>To test it run the following JavaScript snippet:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\naddon.runCallback(function(msg){\n console.log(msg); // &apos;hello world&apos;\n});</code></pre>\n","type":"module","displayName":"Callbacks"},{"textRaw":"Object factory","name":"object_factory","desc":"<p>You can create and return new objects from within a C++ function with this\n<code>addon.cc</code> pattern, which returns an object with property <code>msg</code> that echoes\nthe string passed to <code>createObject()</code>:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; CreateObject(const Arguments&amp; args) {\n HandleScope scope;\n\n Local&lt;Object&gt; obj = Object::New();\n obj-&gt;Set(String::NewSymbol(&quot;msg&quot;), args[0]-&gt;ToString());\n\n return scope.Close(obj);\n}\n\nvoid Init(Handle&lt;Object&gt; target) {\n target-&gt;Set(String::NewSymbol(&quot;createObject&quot;),\n FunctionTemplate::New(CreateObject)-&gt;GetFunction());\n}\n\nNODE_MODULE(addon, Init)</code></pre>\n<p>To test it in JavaScript:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\nvar obj1 = addon.createObject(&apos;hello&apos;);\nvar obj2 = addon.createObject(&apos;world&apos;);\nconsole.log(obj1.msg+&apos; &apos;+obj2.msg); // &apos;hello world&apos;</code></pre>\n","type":"module","displayName":"Object factory"},{"textRaw":"Function factory","name":"function_factory","desc":"<p>This pattern illustrates how to create and return a JavaScript function that\nwraps a C++ function:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; MyFunction(const Arguments&amp; args) {\n HandleScope scope;\n return scope.Close(String::New(&quot;hello world&quot;));\n}\n\nHandle&lt;Value&gt; CreateFunction(const Arguments&amp; args) {\n HandleScope scope;\n\n Local&lt;FunctionTemplate&gt; tpl = FunctionTemplate::New(MyFunction);\n Local&lt;Function&gt; fn = tpl-&gt;GetFunction();\n fn-&gt;SetName(String::NewSymbol(&quot;theFunction&quot;)); // omit this to make it anonymous\n\n return scope.Close(fn);\n}\n\nvoid Init(Handle&lt;Object&gt; target) {\n target-&gt;Set(String::NewSymbol(&quot;createFunction&quot;),\n FunctionTemplate::New(CreateFunction)-&gt;GetFunction());\n}\n\nNODE_MODULE(addon, Init)</code></pre>\n<p>To test:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\nvar fn = addon.createFunction();\nconsole.log(fn()); // &apos;hello world&apos;</code></pre>\n","type":"module","displayName":"Function factory"},{"textRaw":"Wrapping C++ objects","name":"wrapping_c++_objects","desc":"<p>Here we will create a wrapper for a C++ object/class <code>MyObject</code> that can be\ninstantiated in JavaScript through the <code>new</code> operator. First prepare the main\nmodule <code>addon.cc</code>:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n#include &quot;myobject.h&quot;\n\nusing namespace v8;\n\nvoid InitAll(Handle&lt;Object&gt; target) {\n MyObject::Init(target);\n}\n\nNODE_MODULE(addon, InitAll)</code></pre>\n<p>Then in <code>myobject.h</code> make your wrapper inherit from <code>node::ObjectWrap</code>:\n\n</p>\n<pre><code>#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include &lt;node.h&gt;\n\nclass MyObject : public node::ObjectWrap {\n public:\n static void Init(v8::Handle&lt;v8::Object&gt; target);\n\n private:\n MyObject();\n ~MyObject();\n\n static v8::Handle&lt;v8::Value&gt; New(const v8::Arguments&amp; args);\n static v8::Handle&lt;v8::Value&gt; PlusOne(const v8::Arguments&amp; args);\n double counter_;\n};\n\n#endif</code></pre>\n<p>And in <code>myobject.cc</code> implement the various methods that you want to expose.\nHere we expose the method <code>plusOne</code> by adding it to the constructor&apos;s\nprototype:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n#include &quot;myobject.h&quot;\n\nusing namespace v8;\n\nMyObject::MyObject() {};\nMyObject::~MyObject() {};\n\nvoid MyObject::Init(Handle&lt;Object&gt; target) {\n // Prepare constructor template\n Local&lt;FunctionTemplate&gt; tpl = FunctionTemplate::New(New);\n tpl-&gt;SetClassName(String::NewSymbol(&quot;MyObject&quot;));\n tpl-&gt;InstanceTemplate()-&gt;SetInternalFieldCount(1);\n // Prototype\n tpl-&gt;PrototypeTemplate()-&gt;Set(String::NewSymbol(&quot;plusOne&quot;),\n FunctionTemplate::New(PlusOne)-&gt;GetFunction());\n\n Persistent&lt;Function&gt; constructor = Persistent&lt;Function&gt;::New(tpl-&gt;GetFunction());\n target-&gt;Set(String::NewSymbol(&quot;MyObject&quot;), constructor);\n}\n\nHandle&lt;Value&gt; MyObject::New(const Arguments&amp; args) {\n HandleScope scope;\n\n MyObject* obj = new MyObject();\n obj-&gt;counter_ = args[0]-&gt;IsUndefined() ? 0 : args[0]-&gt;NumberValue();\n obj-&gt;Wrap(args.This());\n\n return args.This();\n}\n\nHandle&lt;Value&gt; MyObject::PlusOne(const Arguments&amp; args) {\n HandleScope scope;\n\n MyObject* obj = ObjectWrap::Unwrap&lt;MyObject&gt;(args.This());\n obj-&gt;counter_ += 1;\n\n return scope.Close(Number::New(obj-&gt;counter_));\n}</code></pre>\n<p>Test it with:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\nvar obj = new addon.MyObject(10);\nconsole.log( obj.plusOne() ); // 11\nconsole.log( obj.plusOne() ); // 12\nconsole.log( obj.plusOne() ); // 13</code></pre>\n","type":"module","displayName":"Wrapping C++ objects"},{"textRaw":"Factory of wrapped objects","name":"factory_of_wrapped_objects","desc":"<p>This is useful when you want to be able to create native objects without\nexplicitly instantiating them with the <code>new</code> operator in JavaScript, e.g.\n\n</p>\n<pre><code>var obj = addon.createObject();\n// instead of:\n// var obj = new addon.Object();</code></pre>\n<p>Let&apos;s register our <code>createObject</code> method in <code>addon.cc</code>:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n#include &quot;myobject.h&quot;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; CreateObject(const Arguments&amp; args) {\n HandleScope scope;\n return scope.Close(MyObject::NewInstance(args));\n}\n\nvoid InitAll(Handle&lt;Object&gt; target) {\n MyObject::Init();\n\n target-&gt;Set(String::NewSymbol(&quot;createObject&quot;),\n FunctionTemplate::New(CreateObject)-&gt;GetFunction());\n}\n\nNODE_MODULE(addon, InitAll)</code></pre>\n<p>In <code>myobject.h</code> we now introduce the static method <code>NewInstance</code> that takes\ncare of instantiating the object (i.e. it does the job of <code>new</code> in JavaScript):\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include &lt;node.h&gt;\n\nclass MyObject : public node::ObjectWrap {\n public:\n static void Init();\n static v8::Handle&lt;v8::Value&gt; NewInstance(const v8::Arguments&amp; args);\n\n private:\n MyObject();\n ~MyObject();\n\n static v8::Persistent&lt;v8::Function&gt; constructor;\n static v8::Handle&lt;v8::Value&gt; New(const v8::Arguments&amp; args);\n static v8::Handle&lt;v8::Value&gt; PlusOne(const v8::Arguments&amp; args);\n double counter_;\n};\n\n#endif</code></pre>\n<p>The implementation is similar to the above in <code>myobject.cc</code>:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n#include &quot;myobject.h&quot;\n\nusing namespace v8;\n\nMyObject::MyObject() {};\nMyObject::~MyObject() {};\n\nPersistent&lt;Function&gt; MyObject::constructor;\n\nvoid MyObject::Init() {\n // Prepare constructor template\n Local&lt;FunctionTemplate&gt; tpl = FunctionTemplate::New(New);\n tpl-&gt;SetClassName(String::NewSymbol(&quot;MyObject&quot;));\n tpl-&gt;InstanceTemplate()-&gt;SetInternalFieldCount(1);\n // Prototype\n tpl-&gt;PrototypeTemplate()-&gt;Set(String::NewSymbol(&quot;plusOne&quot;),\n FunctionTemplate::New(PlusOne)-&gt;GetFunction());\n\n constructor = Persistent&lt;Function&gt;::New(tpl-&gt;GetFunction());\n}\n\nHandle&lt;Value&gt; MyObject::New(const Arguments&amp; args) {\n HandleScope scope;\n\n MyObject* obj = new MyObject();\n obj-&gt;counter_ = args[0]-&gt;IsUndefined() ? 0 : args[0]-&gt;NumberValue();\n obj-&gt;Wrap(args.This());\n\n return args.This();\n}\n\nHandle&lt;Value&gt; MyObject::NewInstance(const Arguments&amp; args) {\n HandleScope scope;\n\n const unsigned argc = 1;\n Handle&lt;Value&gt; argv[argc] = { args[0] };\n Local&lt;Object&gt; instance = constructor-&gt;NewInstance(argc, argv);\n\n return scope.Close(instance);\n}\n\nHandle&lt;Value&gt; MyObject::PlusOne(const Arguments&amp; args) {\n HandleScope scope;\n\n MyObject* obj = ObjectWrap::Unwrap&lt;MyObject&gt;(args.This());\n obj-&gt;counter_ += 1;\n\n return scope.Close(Number::New(obj-&gt;counter_));\n}</code></pre>\n<p>Test it with:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\nvar obj = addon.createObject(10);\nconsole.log( obj.plusOne() ); // 11\nconsole.log( obj.plusOne() ); // 12\nconsole.log( obj.plusOne() ); // 13\n\nvar obj2 = addon.createObject(20);\nconsole.log( obj2.plusOne() ); // 21\nconsole.log( obj2.plusOne() ); // 22\nconsole.log( obj2.plusOne() ); // 23</code></pre>\n","type":"module","displayName":"Factory of wrapped objects"},{"textRaw":"Passing wrapped objects around","name":"passing_wrapped_objects_around","desc":"<p>In addition to wrapping and returning C++ objects, you can pass them around\nby unwrapping them with Node&apos;s <code>node::ObjectWrap::Unwrap</code> helper function.\nIn the following <code>addon.cc</code> we introduce a function <code>add()</code> that can take on two\n<code>MyObject</code> objects:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n#include &quot;myobject.h&quot;\n\nusing namespace v8;\n\nHandle&lt;Value&gt; CreateObject(const Arguments&amp; args) {\n HandleScope scope;\n return scope.Close(MyObject::NewInstance(args));\n}\n\nHandle&lt;Value&gt; Add(const Arguments&amp; args) {\n HandleScope scope;\n\n MyObject* obj1 = node::ObjectWrap::Unwrap&lt;MyObject&gt;(\n args[0]-&gt;ToObject());\n MyObject* obj2 = node::ObjectWrap::Unwrap&lt;MyObject&gt;(\n args[1]-&gt;ToObject());\n\n double sum = obj1-&gt;Val() + obj2-&gt;Val();\n return scope.Close(Number::New(sum));\n}\n\nvoid InitAll(Handle&lt;Object&gt; target) {\n MyObject::Init();\n\n target-&gt;Set(String::NewSymbol(&quot;createObject&quot;),\n FunctionTemplate::New(CreateObject)-&gt;GetFunction());\n\n target-&gt;Set(String::NewSymbol(&quot;add&quot;),\n FunctionTemplate::New(Add)-&gt;GetFunction());\n}\n\nNODE_MODULE(addon, InitAll)</code></pre>\n<p>To make things interesting we introduce a public method in <code>myobject.h</code> so we\ncan probe private values after unwrapping the object:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include &lt;node.h&gt;\n\nclass MyObject : public node::ObjectWrap {\n public:\n static void Init();\n static v8::Handle&lt;v8::Value&gt; NewInstance(const v8::Arguments&amp; args);\n double Val() const { return val_; }\n\n private:\n MyObject();\n ~MyObject();\n\n static v8::Persistent&lt;v8::Function&gt; constructor;\n static v8::Handle&lt;v8::Value&gt; New(const v8::Arguments&amp; args);\n double val_;\n};\n\n#endif</code></pre>\n<p>The implementation of <code>myobject.cc</code> is similar as before:\n\n</p>\n<pre><code>#define BUILDING_NODE_EXTENSION\n#include &lt;node.h&gt;\n#include &quot;myobject.h&quot;\n\nusing namespace v8;\n\nMyObject::MyObject() {};\nMyObject::~MyObject() {};\n\nPersistent&lt;Function&gt; MyObject::constructor;\n\nvoid MyObject::Init() {\n // Prepare constructor template\n Local&lt;FunctionTemplate&gt; tpl = FunctionTemplate::New(New);\n tpl-&gt;SetClassName(String::NewSymbol(&quot;MyObject&quot;));\n tpl-&gt;InstanceTemplate()-&gt;SetInternalFieldCount(1);\n\n constructor = Persistent&lt;Function&gt;::New(tpl-&gt;GetFunction());\n}\n\nHandle&lt;Value&gt; MyObject::New(const Arguments&amp; args) {\n HandleScope scope;\n\n MyObject* obj = new MyObject();\n obj-&gt;val_ = args[0]-&gt;IsUndefined() ? 0 : args[0]-&gt;NumberValue();\n obj-&gt;Wrap(args.This());\n\n return args.This();\n}\n\nHandle&lt;Value&gt; MyObject::NewInstance(const Arguments&amp; args) {\n HandleScope scope;\n\n const unsigned argc = 1;\n Handle&lt;Value&gt; argv[argc] = { args[0] };\n Local&lt;Object&gt; instance = constructor-&gt;NewInstance(argc, argv);\n\n return scope.Close(instance);\n}</code></pre>\n<p>Test it with:\n\n</p>\n<pre><code>var addon = require(&apos;./build/Release/addon&apos;);\n\nvar obj1 = addon.createObject(10);\nvar obj2 = addon.createObject(20);\nvar result = addon.add(obj1, obj2);\n\nconsole.log(result); // 30</code></pre>\n","type":"module","displayName":"Passing wrapped objects around"}],"type":"module","displayName":"Addon patterns"}],"type":"module","displayName":"Addons"}]}
View
1 public/json/0.8.1/appendix_1.json
@@ -1 +0,0 @@
-{"source":"doc/api/appendix_1.markdown","modules":[{"textRaw":"Appendix 1 - Third Party Modules","name":"appendix_1_-_third_party_modules","desc":"<p>There are many third party modules for Node. At the time of writing, August\n2010, the master repository of modules is\n<a href=\"https://github.com/joyent/node/wiki/modules\">the wiki page</a>.\n\n</p>\n<p>You can also find third party modules via <a href=\"http://search.npmjs.org\">npm search</a>.\n\n</p>\n<p>This appendix is intended as a SMALL guide to new-comers to help them\nquickly find what are considered to be quality modules. It is not intended\nto be a complete list. There may be better more complete modules found\nelsewhere.\n\n</p>\n<ul>\n<li><p>Module Installer: <a href=\"https://github.com/isaacs/npm\">npm</a></p>\n</li>\n<li><p>HTTP Middleware: <a href=\"https://github.com/senchalabs/connect\">Connect</a></p>\n</li>\n<li><p>Web Framework: <a href=\"https://github.com/visionmedia/express\">Express</a></p>\n</li>\n<li><p>Web Sockets: <a href=\"https://github.com/learnboost/socket.io\">Socket.IO</a></p>\n</li>\n<li><p>HTML Parsing: <a href=\"https://github.com/aredridel/html5\">HTML5</a></p>\n</li>\n<li><p><a href=\"https://github.com/agnat/node_mdns\">mDNS/Zeroconf/Bonjour</a></p>\n</li>\n<li><p><a href=\"https://github.com/postwait/node-amqp\">RabbitMQ, AMQP</a></p>\n</li>\n<li><p><a href=\"https://github.com/felixge/node-mysql\">mysql</a></p>\n</li>\n<li><p>Serialization: <a href=\"https://github.com/pgriess/node-msgpack\">msgpack</a></p>\n</li>\n<li><p>Scraping: <a href=\"https://github.com/silentrob/Apricot\">Apricot</a></p>\n</li>\n<li><p>Debugger: <a href=\"https://github.com/smtlaissezfaire/ndb\">ndb</a> is a CLI debugger\n<a href=\"https://github.com/dannycoates/node-inspector\">inspector</a> is a web based\ntool.</p>\n</li>\n<li><p><a href=\"https://github.com/mranney/node_pcap\">pcap binding</a></p>\n</li>\n<li><p><a href=\"https://github.com/mscdex/node-ncurses\">ncurses</a></p>\n</li>\n<li><p>Testing/TDD/BDD: <a href=\"http://vowsjs.org/\">vows</a>,\n<a href=\"https://github.com/visionmedia/mocha\">mocha</a>,\n<a href=\"https://github.com/tmpvar/mjsunit.runner\">mjsunit.runner</a></p>\n</li>\n</ul>\n<p>Patches to this list are welcome.\n</p>\n","type":"module","displayName":"Appendix 1 - Third Party Modules"}]}
View
1 public/json/0.8.1/assert.json
@@ -1 +0,0 @@
-{"source":"doc/api/assert.markdown","modules":[{"textRaw":"Assert","name":"assert","stability":5,"stabilityText":"Locked","desc":"<p>This module is used for writing unit tests for your applications, you can\naccess it with <code>require(&apos;assert&apos;)</code>.\n\n</p>\n","methods":[{"textRaw":"assert.fail(actual, expected, message, operator)","type":"method","name":"fail","desc":"<p>Throws an exception that displays the values for <code>actual</code> and <code>expected</code> separated by the provided operator.\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message"},{"name":"operator"}]}]},{"textRaw":"assert(value, message), assert.ok(value, [message])","type":"method","name":"ok","desc":"<p>Tests if value is truthy, it is equivalent to <code>assert.equal(true, !!value, message);</code>\n\n</p>\n","signatures":[{"params":[{"name":"value"},{"name":"message)"},{"name":"assert.ok(value"},{"name":"message","optional":true}]}]},{"textRaw":"assert.equal(actual, expected, [message])","type":"method","name":"equal","desc":"<p>Tests shallow, coercive equality with the equal comparison operator ( <code>==</code> ).\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message","optional":true}]}]},{"textRaw":"assert.notEqual(actual, expected, [message])","type":"method","name":"notEqual","desc":"<p>Tests shallow, coercive non-equality with the not equal comparison operator ( <code>!=</code> ).\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message","optional":true}]}]},{"textRaw":"assert.deepEqual(actual, expected, [message])","type":"method","name":"deepEqual","desc":"<p>Tests for deep equality.\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message","optional":true}]}]},{"textRaw":"assert.notDeepEqual(actual, expected, [message])","type":"method","name":"notDeepEqual","desc":"<p>Tests for any deep inequality.\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message","optional":true}]}]},{"textRaw":"assert.strictEqual(actual, expected, [message])","type":"method","name":"strictEqual","desc":"<p>Tests strict equality, as determined by the strict equality operator ( <code>===</code> )\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message","optional":true}]}]},{"textRaw":"assert.notStrictEqual(actual, expected, [message])","type":"method","name":"notStrictEqual","desc":"<p>Tests strict non-equality, as determined by the strict not equal operator ( <code>!==</code> )\n\n</p>\n","signatures":[{"params":[{"name":"actual"},{"name":"expected"},{"name":"message","optional":true}]}]},{"textRaw":"assert.throws(block, [error], [message])","type":"method","name":"throws","desc":"<p>Expects <code>block</code> to throw an error. <code>error</code> can be constructor, regexp or \nvalidation function.\n\n</p>\n<p>Validate instanceof using constructor:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n Error\n);</code></pre>\n<p>Validate error message using RegExp:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n /value/\n);</code></pre>\n<p>Custom error validation:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n function(err) {\n if ( (err instanceof Error) &amp;&amp; /value/.test(err) ) {\n return true;\n }\n },\n &quot;unexpected error&quot;\n);</code></pre>\n","signatures":[{"params":[{"name":"block"},{"name":"error","optional":true},{"name":"message","optional":true}]}]},{"textRaw":"assert.doesNotThrow(block, [error], [message])","type":"method","name":"doesNotThrow","desc":"<p>Expects <code>block</code> not to throw an error, see assert.throws for details.\n\n</p>\n","signatures":[{"params":[{"name":"block"},{"name":"error","optional":true},{"name":"message","optional":true}]}]},{"textRaw":"assert.ifError(value)","type":"method","name":"ifError","desc":"<p>Tests if value is not a false value, throws if it is a true value. Useful when\ntesting the first argument, <code>error</code> in callbacks.\n</p>\n","signatures":[{"params":[{"name":"value"}]}]}],"type":"module","displayName":"Assert"}]}
View
1 public/json/0.8.1/buffer.json
@@ -1 +0,0 @@
-{"source":"doc/api/buffer.markdown","modules":[{"textRaw":"Buffer","name":"buffer","stability":3,"stabilityText":"Stable","desc":"<p>Pure JavaScript is Unicode friendly but not nice to binary data. When\ndealing with TCP streams or the file system, it&apos;s necessary to handle octet\nstreams. Node has several strategies for manipulating, creating, and\nconsuming octet streams.\n\n</p>\n<p>Raw data is stored in instances of the <code>Buffer</code> class. A <code>Buffer</code> is similar\nto an array of integers but corresponds to a raw memory allocation outside\nthe V8 heap. A <code>Buffer</code> cannot be resized.\n\n</p>\n<p>The <code>Buffer</code> class is a global, making it very rare that one would need\nto ever <code>require(&apos;buffer&apos;)</code>.\n\n</p>\n<p>Converting between Buffers and JavaScript string objects requires an explicit\nencoding method. Here are the different string encodings.\n\n</p>\n<ul>\n<li><p><code>&apos;ascii&apos;</code> - for 7 bit ASCII data only. This encoding method is very fast, and\nwill strip the high bit if set.\nNote that this encoding converts a null character (<code>&apos;\\0&apos;</code> or <code>&apos;\\u0000&apos;</code>) into\n<code>0x20</code> (character code of a space). If you want to convert a null character\ninto <code>0x00</code>, you should use <code>&apos;utf8&apos;</code>.</p>\n</li>\n<li><p><code>&apos;utf8&apos;</code> - Multibyte encoded Unicode characters. Many web pages and other\ndocument formats use UTF-8.</p>\n</li>\n<li><p><code>&apos;utf16le&apos;</code> - 2 or 4 bytes, little endian encoded Unicode characters.\nSurrogate pairs (U+10000 to U+10FFFF) are supported.</p>\n</li>\n<li><p><code>&apos;ucs2&apos;</code> - Alias of <code>&apos;utf16le&apos;</code>.</p>\n</li>\n<li><p><code>&apos;base64&apos;</code> - Base64 string encoding.</p>\n</li>\n<li><p><code>&apos;binary&apos;</code> - A way of encoding raw binary data into strings by using only\nthe first 8 bits of each character. This encoding method is deprecated and\nshould be avoided in favor of <code>Buffer</code> objects where possible. This encoding\nwill be removed in future versions of Node.</p>\n</li>\n<li><p><code>&apos;hex&apos;</code> - Encode each byte as two hexadecimal characters.</p>\n</li>\n</ul>\n","classes":[{"textRaw":"Class: Buffer","type":"class","name":"Buffer","desc":"<p>The Buffer class is a global type for dealing with binary data directly.\nIt can be constructed in a variety of ways.\n\n</p>\n","methods":[{"textRaw":"buf.write(string, [offset], [length], [encoding])","type":"method","name":"write","signatures":[{"params":[{"textRaw":"`string` String - data to be written to buffer ","name":"string","desc":"String - data to be written to buffer"},{"textRaw":"`offset` Number, Optional, Default: 0 ","name":"offset","desc":"Number, Optional, Default: 0","optional":true},{"textRaw":"`length` Number, Optional, Default: `buffer.length - offset` ","name":"length","desc":"Number, Optional, Default: `buffer.length - offset`","optional":true},{"textRaw":"`encoding` String, Optional, Default: 'utf8' ","name":"encoding","desc":"String, Optional, Default: 'utf8'","optional":true}]},{"params":[{"name":"string"},{"name":"offset","optional":true},{"name":"length","optional":true},{"name":"encoding","optional":true}]}],"desc":"<p>Writes <code>string</code> to the buffer at <code>offset</code> using the given encoding.\n<code>offset</code> defaults to <code>0</code>, <code>encoding</code> defaults to <code>&apos;utf8&apos;</code>. <code>length</code> is\nthe number of bytes to write. Returns number of octets written. If <code>buffer</code> did\nnot contain enough space to fit the entire string, it will write a partial\namount of the string. <code>length</code> defaults to <code>buffer.length - offset</code>.\nThe method will not write partial characters.\n\n</p>\n<pre><code>buf = new Buffer(256);\nlen = buf.write(&apos;\\u00bd + \\u00bc = \\u00be&apos;, 0);\nconsole.log(len + &quot; bytes: &quot; + buf.toString(&apos;utf8&apos;, 0, len));</code></pre>\n<p>The number of characters written (which may be different than the number of\nbytes written) is set in <code>Buffer._charsWritten</code> and will be overwritten the\nnext time <code>buf.write()</code> is called.\n\n\n</p>\n"},{"textRaw":"buf.toString([encoding], [start], [end])","type":"method","name":"toString","signatures":[{"params":[{"textRaw":"`encoding` String, Optional, Default: 'utf8' ","name":"encoding","desc":"String, Optional, Default: 'utf8'","optional":true},{"textRaw":"`start` Number, Optional, Default: 0 ","name":"start","desc":"Number, Optional, Default: 0","optional":true},{"textRaw":"`end` Number, Optional, Default: `buffer.length` ","name":"end","desc":"Number, Optional, Default: `buffer.length`","optional":true}]},{"params":[{"name":"encoding","optional":true},{"name":"start","optional":true},{"name":"end","optional":true}]}],"desc":"<p>Decodes and returns a string from buffer data encoded with <code>encoding</code>\n(defaults to <code>&apos;utf8&apos;</code>) beginning at <code>start</code> (defaults to <code>0</code>) and ending at\n<code>end</code> (defaults to <code>buffer.length</code>).\n\n</p>\n<p>See <code>buffer.write()</code> example, above.\n\n\n</p>\n"},{"textRaw":"buf.copy(targetBuffer, [targetStart], [sourceStart], [sourceEnd])","type":"method","name":"copy","signatures":[{"params":[{"textRaw":"`targetBuffer` Buffer object - Buffer to copy into ","name":"targetBuffer","desc":"Buffer object - Buffer to copy into"},{"textRaw":"`targetStart` Number, Optional, Default: 0 ","name":"targetStart","desc":"Number, Optional, Default: 0","optional":true},{"textRaw":"`sourceStart` Number, Optional, Default: 0 ","name":"sourceStart","desc":"Number, Optional, Default: 0","optional":true},{"textRaw":"`sourceEnd` Number, Optional, Default: `buffer.length` ","name":"sourceEnd","desc":"Number, Optional, Default: `buffer.length`","optional":true}]},{"params":[{"name":"targetBuffer"},{"name":"targetStart","optional":true},{"name":"sourceStart","optional":true},{"name":"sourceEnd","optional":true}]}],"desc":"<p>Does copy between buffers. The source and target regions can be overlapped.\n<code>targetStart</code> and <code>sourceStart</code> default to <code>0</code>.\n<code>sourceEnd</code> defaults to <code>buffer.length</code>.\n\n</p>\n<p>Example: build two Buffers, then copy <code>buf1</code> from byte 16 through byte 19\ninto <code>buf2</code>, starting at the 8th byte in <code>buf2</code>.\n\n</p>\n<pre><code>buf1 = new Buffer(26);\nbuf2 = new Buffer(26);\n\nfor (var i = 0 ; i &lt; 26 ; i++) {\n buf1[i] = i + 97; // 97 is ASCII a\n buf2[i] = 33; // ASCII !\n}\n\nbuf1.copy(buf2, 8, 16, 20);\nconsole.log(buf2.toString(&apos;ascii&apos;, 0, 25));\n\n// !!!!!!!!qrst!!!!!!!!!!!!!</code></pre>\n"},{"textRaw":"buf.slice([start], [end])","type":"method","name":"slice","signatures":[{"params":[{"textRaw":"`start` Number, Optional, Default: 0 ","name":"start","desc":"Number, Optional, Default: 0","optional":true},{"textRaw":"`end` Number, Optional, Default: `buffer.length` ","name":"end","desc":"Number, Optional, Default: `buffer.length`","optional":true}]},{"params":[{"name":"start","optional":true},{"name":"end","optional":true}]}],"desc":"<p>Returns a new buffer which references the same memory as the old, but offset\nand cropped by the <code>start</code> (defaults to <code>0</code>) and <code>end</code> (defaults to\n<code>buffer.length</code>) indexes.\n\n</p>\n<p><strong>Modifying the new buffer slice will modify memory in the original buffer!</strong>\n\n</p>\n<p>Example: build a Buffer with the ASCII alphabet, take a slice, then modify one\nbyte from the original Buffer.\n\n</p>\n<pre><code>var buf1 = new Buffer(26);\n\nfor (var i = 0 ; i &lt; 26 ; i++) {\n buf1[i] = i + 97; // 97 is ASCII a\n}\n\nvar buf2 = buf1.slice(0, 3);\nconsole.log(buf2.toString(&apos;ascii&apos;, 0, buf2.length));\nbuf1[0] = 33;\nconsole.log(buf2.toString(&apos;ascii&apos;, 0, buf2.length));\n\n// abc\n// !bc</code></pre>\n"},{"textRaw":"buf.readUInt8(offset, [noAssert])","type":"method","name":"readUInt8","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads an unsigned 8 bit integer from the buffer at the specified offset.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x3;\nbuf[1] = 0x4;\nbuf[2] = 0x23;\nbuf[3] = 0x42;\n\nfor (ii = 0; ii &lt; buf.length; ii++) {\n console.log(buf.readUInt8(ii));\n}\n\n// 0x3\n// 0x4\n// 0x23\n// 0x42</code></pre>\n"},{"textRaw":"buf.readUInt16LE(offset, [noAssert])","type":"method","name":"readUInt16LE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads an unsigned 16 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x3;\nbuf[1] = 0x4;\nbuf[2] = 0x23;\nbuf[3] = 0x42;\n\nconsole.log(buf.readUInt16BE(0));\nconsole.log(buf.readUInt16LE(0));\nconsole.log(buf.readUInt16BE(1));\nconsole.log(buf.readUInt16LE(1));\nconsole.log(buf.readUInt16BE(2));\nconsole.log(buf.readUInt16LE(2));\n\n// 0x0304\n// 0x0403\n// 0x0423\n// 0x2304\n// 0x2342\n// 0x4223</code></pre>\n"},{"textRaw":"buf.readUInt16BE(offset, [noAssert])","type":"method","name":"readUInt16BE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads an unsigned 16 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x3;\nbuf[1] = 0x4;\nbuf[2] = 0x23;\nbuf[3] = 0x42;\n\nconsole.log(buf.readUInt16BE(0));\nconsole.log(buf.readUInt16LE(0));\nconsole.log(buf.readUInt16BE(1));\nconsole.log(buf.readUInt16LE(1));\nconsole.log(buf.readUInt16BE(2));\nconsole.log(buf.readUInt16LE(2));\n\n// 0x0304\n// 0x0403\n// 0x0423\n// 0x2304\n// 0x2342\n// 0x4223</code></pre>\n"},{"textRaw":"buf.readUInt32LE(offset, [noAssert])","type":"method","name":"readUInt32LE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads an unsigned 32 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x3;\nbuf[1] = 0x4;\nbuf[2] = 0x23;\nbuf[3] = 0x42;\n\nconsole.log(buf.readUInt32BE(0));\nconsole.log(buf.readUInt32LE(0));\n\n// 0x03042342\n// 0x42230403</code></pre>\n"},{"textRaw":"buf.readUInt32BE(offset, [noAssert])","type":"method","name":"readUInt32BE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads an unsigned 32 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x3;\nbuf[1] = 0x4;\nbuf[2] = 0x23;\nbuf[3] = 0x42;\n\nconsole.log(buf.readUInt32BE(0));\nconsole.log(buf.readUInt32LE(0));\n\n// 0x03042342\n// 0x42230403</code></pre>\n"},{"textRaw":"buf.readInt8(offset, [noAssert])","type":"method","name":"readInt8","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a signed 8 bit integer from the buffer at the specified offset.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.readUInt8</code>, except buffer contents are treated as two&apos;s\ncomplement signed values.\n\n</p>\n"},{"textRaw":"buf.readInt16LE(offset, [noAssert])","type":"method","name":"readInt16LE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a signed 16 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.readUInt16*</code>, except buffer contents are treated as two&apos;s\ncomplement signed values.\n\n</p>\n"},{"textRaw":"buf.readInt16BE(offset, [noAssert])","type":"method","name":"readInt16BE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a signed 16 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.readUInt16*</code>, except buffer contents are treated as two&apos;s\ncomplement signed values.\n\n</p>\n"},{"textRaw":"buf.readInt32LE(offset, [noAssert])","type":"method","name":"readInt32LE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a signed 32 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.readUInt32*</code>, except buffer contents are treated as two&apos;s\ncomplement signed values.\n\n</p>\n"},{"textRaw":"buf.readInt32BE(offset, [noAssert])","type":"method","name":"readInt32BE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a signed 32 bit integer from the buffer at the specified offset with\nspecified endian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.readUInt32*</code>, except buffer contents are treated as two&apos;s\ncomplement signed values.\n\n</p>\n"},{"textRaw":"buf.readFloatLE(offset, [noAssert])","type":"method","name":"readFloatLE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a 32 bit float from the buffer at the specified offset with specified\nendian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x00;\nbuf[1] = 0x00;\nbuf[2] = 0x80;\nbuf[3] = 0x3f;\n\nconsole.log(buf.readFloatLE(0));\n\n// 0x01</code></pre>\n"},{"textRaw":"buf.readFloatBE(offset, [noAssert])","type":"method","name":"readFloatBE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a 32 bit float from the buffer at the specified offset with specified\nendian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\n\nbuf[0] = 0x00;\nbuf[1] = 0x00;\nbuf[2] = 0x80;\nbuf[3] = 0x3f;\n\nconsole.log(buf.readFloatLE(0));\n\n// 0x01</code></pre>\n"},{"textRaw":"buf.readDoubleLE(offset, [noAssert])","type":"method","name":"readDoubleLE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a 64 bit double from the buffer at the specified offset with specified\nendian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(8);\n\nbuf[0] = 0x55;\nbuf[1] = 0x55;\nbuf[2] = 0x55;\nbuf[3] = 0x55;\nbuf[4] = 0x55;\nbuf[5] = 0x55;\nbuf[6] = 0xd5;\nbuf[7] = 0x3f;\n\nconsole.log(buf.readDoubleLE(0));\n\n// 0.3333333333333333</code></pre>\n"},{"textRaw":"buf.readDoubleBE(offset, [noAssert])","type":"method","name":"readDoubleBE","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Reads a 64 bit double from the buffer at the specified offset with specified\nendian format.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>offset</code>. This means that <code>offset</code>\nmay be beyond the end of the buffer. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(8);\n\nbuf[0] = 0x55;\nbuf[1] = 0x55;\nbuf[2] = 0x55;\nbuf[3] = 0x55;\nbuf[4] = 0x55;\nbuf[5] = 0x55;\nbuf[6] = 0xd5;\nbuf[7] = 0x3f;\n\nconsole.log(buf.readDoubleLE(0));\n\n// 0.3333333333333333</code></pre>\n"},{"textRaw":"buf.writeUInt8(value, offset, [noAssert])","type":"method","name":"writeUInt8","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset. Note, <code>value</code> must be a\nvalid unsigned 8 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeUInt8(0x3, 0);\nbuf.writeUInt8(0x4, 1);\nbuf.writeUInt8(0x23, 2);\nbuf.writeUInt8(0x42, 3);\n\nconsole.log(buf);\n\n// &lt;Buffer 03 04 23 42&gt;</code></pre>\n"},{"textRaw":"buf.writeUInt16LE(value, offset, [noAssert])","type":"method","name":"writeUInt16LE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid unsigned 16 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeUInt16BE(0xdead, 0);\nbuf.writeUInt16BE(0xbeef, 2);\n\nconsole.log(buf);\n\nbuf.writeUInt16LE(0xdead, 0);\nbuf.writeUInt16LE(0xbeef, 2);\n\nconsole.log(buf);\n\n// &lt;Buffer de ad be ef&gt;\n// &lt;Buffer ad de ef be&gt;</code></pre>\n"},{"textRaw":"buf.writeUInt16BE(value, offset, [noAssert])","type":"method","name":"writeUInt16BE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid unsigned 16 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeUInt16BE(0xdead, 0);\nbuf.writeUInt16BE(0xbeef, 2);\n\nconsole.log(buf);\n\nbuf.writeUInt16LE(0xdead, 0);\nbuf.writeUInt16LE(0xbeef, 2);\n\nconsole.log(buf);\n\n// &lt;Buffer de ad be ef&gt;\n// &lt;Buffer ad de ef be&gt;</code></pre>\n"},{"textRaw":"buf.writeUInt32LE(value, offset, [noAssert])","type":"method","name":"writeUInt32LE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid unsigned 32 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeUInt32BE(0xfeedface, 0);\n\nconsole.log(buf);\n\nbuf.writeUInt32LE(0xfeedface, 0);\n\nconsole.log(buf);\n\n// &lt;Buffer fe ed fa ce&gt;\n// &lt;Buffer ce fa ed fe&gt;</code></pre>\n"},{"textRaw":"buf.writeUInt32BE(value, offset, [noAssert])","type":"method","name":"writeUInt32BE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid unsigned 32 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeUInt32BE(0xfeedface, 0);\n\nconsole.log(buf);\n\nbuf.writeUInt32LE(0xfeedface, 0);\n\nconsole.log(buf);\n\n// &lt;Buffer fe ed fa ce&gt;\n// &lt;Buffer ce fa ed fe&gt;</code></pre>\n"},{"textRaw":"buf.writeInt8(value, offset, [noAssert])","type":"method","name":"writeInt8","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset. Note, <code>value</code> must be a\nvalid signed 8 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.writeUInt8</code>, except value is written out as a two&apos;s complement\nsigned integer into <code>buffer</code>.\n\n</p>\n"},{"textRaw":"buf.writeInt16LE(value, offset, [noAssert])","type":"method","name":"writeInt16LE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid signed 16 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.writeUInt16*</code>, except value is written out as a two&apos;s\ncomplement signed integer into <code>buffer</code>.\n\n</p>\n"},{"textRaw":"buf.writeInt16BE(value, offset, [noAssert])","type":"method","name":"writeInt16BE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid signed 16 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.writeUInt16*</code>, except value is written out as a two&apos;s\ncomplement signed integer into <code>buffer</code>.\n\n</p>\n"},{"textRaw":"buf.writeInt32LE(value, offset, [noAssert])","type":"method","name":"writeInt32LE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid signed 32 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.writeUInt32*</code>, except value is written out as a two&apos;s\ncomplement signed integer into <code>buffer</code>.\n\n</p>\n"},{"textRaw":"buf.writeInt32BE(value, offset, [noAssert])","type":"method","name":"writeInt32BE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid signed 32 bit integer.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Works as <code>buffer.writeUInt32*</code>, except value is written out as a two&apos;s\ncomplement signed integer into <code>buffer</code>.\n\n</p>\n"},{"textRaw":"buf.writeFloatLE(value, offset, [noAssert])","type":"method","name":"writeFloatLE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid 32 bit float.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeFloatBE(0xcafebabe, 0);\n\nconsole.log(buf);\n\nbuf.writeFloatLE(0xcafebabe, 0);\n\nconsole.log(buf);\n\n// &lt;Buffer 4f 4a fe bb&gt;\n// &lt;Buffer bb fe 4a 4f&gt;</code></pre>\n"},{"textRaw":"buf.writeFloatBE(value, offset, [noAssert])","type":"method","name":"writeFloatBE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid 32 bit float.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(4);\nbuf.writeFloatBE(0xcafebabe, 0);\n\nconsole.log(buf);\n\nbuf.writeFloatLE(0xcafebabe, 0);\n\nconsole.log(buf);\n\n// &lt;Buffer 4f 4a fe bb&gt;\n// &lt;Buffer bb fe 4a 4f&gt;</code></pre>\n"},{"textRaw":"buf.writeDoubleLE(value, offset, [noAssert])","type":"method","name":"writeDoubleLE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid 64 bit double.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(8);\nbuf.writeDoubleBE(0xdeadbeefcafebabe, 0);\n\nconsole.log(buf);\n\nbuf.writeDoubleLE(0xdeadbeefcafebabe, 0);\n\nconsole.log(buf);\n\n// &lt;Buffer 43 eb d5 b7 dd f9 5f d7&gt;\n// &lt;Buffer d7 5f f9 dd b7 d5 eb 43&gt;</code></pre>\n"},{"textRaw":"buf.writeDoubleBE(value, offset, [noAssert])","type":"method","name":"writeDoubleBE","signatures":[{"params":[{"textRaw":"`value` Number ","name":"value","desc":"Number"},{"textRaw":"`offset` Number ","name":"offset","desc":"Number"},{"textRaw":"`noAssert` Boolean, Optional, Default: false ","name":"noAssert","desc":"Boolean, Optional, Default: false","optional":true}]},{"params":[{"name":"value"},{"name":"offset"},{"name":"noAssert","optional":true}]}],"desc":"<p>Writes <code>value</code> to the buffer at the specified offset with specified endian\nformat. Note, <code>value</code> must be a valid 64 bit double.\n\n</p>\n<p>Set <code>noAssert</code> to true to skip validation of <code>value</code> and <code>offset</code>. This means\nthat <code>value</code> may be too large for the specific function and <code>offset</code> may be\nbeyond the end of the buffer leading to the values being silently dropped. This\nshould not be used unless you are certain of correctness. Defaults to <code>false</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var buf = new Buffer(8);\nbuf.writeDoubleBE(0xdeadbeefcafebabe, 0);\n\nconsole.log(buf);\n\nbuf.writeDoubleLE(0xdeadbeefcafebabe, 0);\n\nconsole.log(buf);\n\n// &lt;Buffer 43 eb d5 b7 dd f9 5f d7&gt;\n// &lt;Buffer d7 5f f9 dd b7 d5 eb 43&gt;</code></pre>\n"},{"textRaw":"buf.fill(value, [offset], [end])","type":"method","name":"fill","signatures":[{"params":[{"textRaw":"`value` ","name":"value"},{"textRaw":"`offset` Number, Optional ","name":"offset","optional":true,"desc":"Number"},{"textRaw":"`end` Number, Optional ","name":"end","optional":true,"desc":"Number"}]},{"params":[{"name":"value"},{"name":"offset","optional":true},{"name":"end","optional":true}]}],"desc":"<p>Fills the buffer with the specified value. If the <code>offset</code> (defaults to <code>0</code>)\nand <code>end</code> (defaults to <code>buffer.length</code>) are not given it will fill the entire\nbuffer.\n\n</p>\n<pre><code>var b = new Buffer(50);\nb.fill(&quot;h&quot;);</code></pre>\n"}],"properties":[{"textRaw":"buf[index]","name":"[index]","desc":"<p>Get and set the octet at <code>index</code>. The values refer to individual bytes,\nso the legal range is between <code>0x00</code> and <code>0xFF</code> hex or <code>0</code> and <code>255</code>.\n\n</p>\n<p>Example: copy an ASCII string into a buffer, one byte at a time:\n\n</p>\n<pre><code>str = &quot;node.js&quot;;\nbuf = new Buffer(str.length);\n\nfor (var i = 0; i &lt; str.length ; i++) {\n buf[i] = str.charCodeAt(i);\n}\n\nconsole.log(buf);\n\n// node.js</code></pre>\n"},{"textRaw":"`length` Number ","name":"length","desc":"<p>The size of the buffer in bytes. Note that this is not necessarily the size\nof the contents. <code>length</code> refers to the amount of memory allocated for the\nbuffer object. It does not change when the contents of the buffer are changed.\n\n</p>\n<pre><code>buf = new Buffer(1234);\n\nconsole.log(buf.length);\nbuf.write(&quot;some string&quot;, 0, &quot;ascii&quot;);\nconsole.log(buf.length);\n\n// 1234\n// 1234</code></pre>\n","shortDesc":"Number"}],"classMethods":[{"textRaw":"Class Method: Buffer.isBuffer(obj)","type":"classMethod","name":"isBuffer","signatures":[{"return":{"textRaw":"Return: Boolean ","name":"return","desc":"Boolean"},"params":[{"textRaw":"`obj` Object ","name":"obj","desc":"Object"}]},{"params":[{"name":"obj"}]}],"desc":"<p>Tests if <code>obj</code> is a <code>Buffer</code>.\n\n</p>\n"},{"textRaw":"Class Method: Buffer.byteLength(string, [encoding])","type":"classMethod","name":"byteLength","signatures":[{"return":{"textRaw":"Return: Number ","name":"return","desc":"Number"},"params":[{"textRaw":"`string` String ","name":"string","desc":"String"},{"textRaw":"`encoding` String, Optional, Default: 'utf8' ","name":"encoding","desc":"String, Optional, Default: 'utf8'","optional":true}]},{"params":[{"name":"string"},{"name":"encoding","optional":true}]}],"desc":"<p>Gives the actual byte length of a string. <code>encoding</code> defaults to <code>&apos;utf8&apos;</code>.\nThis is not the same as <code>String.prototype.length</code> since that returns the\nnumber of <em>characters</em> in a string.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>str = &apos;\\u00bd + \\u00bc = \\u00be&apos;;\n\nconsole.log(str + &quot;: &quot; + str.length + &quot; characters, &quot; +\n Buffer.byteLength(str, &apos;utf8&apos;) + &quot; bytes&quot;);\n\n// ½ + ¼ = ¾: 9 characters, 12 bytes</code></pre>\n"},{"textRaw":"Class Method: Buffer.concat(list, [totalLength])","type":"classMethod","name":"concat","signatures":[{"params":[{"textRaw":"`list` {Array} List of Buffer objects to concat ","name":"list","type":"Array","desc":"List of Buffer objects to concat"},{"textRaw":"`totalLength` {Number} Total length of the buffers when concatenated ","name":"totalLength","type":"Number","desc":"Total length of the buffers when concatenated","optional":true}]},{"params":[{"name":"list"},{"name":"totalLength","optional":true}]}],"desc":"<p>Returns a buffer which is the result of concatenating all the buffers in\nthe list together.\n\n</p>\n<p>If the list has no items, or if the totalLength is 0, then it returns a\nzero-length buffer.\n\n</p>\n<p>If the list has exactly one item, then the first item of the list is\nreturned.\n\n</p>\n<p>If the list has more than one item, then a new Buffer is created.\n\n</p>\n<p>If totalLength is not provided, it is read from the buffers in the list.\nHowever, this adds an additional loop to the function, so it is faster\nto provide the length explicitly.\n\n</p>\n"}],"signatures":[{"params":[{"textRaw":"`size` Number ","name":"size","desc":"Number"}],"desc":"<p>Allocates a new buffer of <code>size</code> octets.\n\n</p>\n"},{"params":[{"name":"size"}],"desc":"<p>Allocates a new buffer of <code>size</code> octets.\n\n</p>\n"},{"params":[{"textRaw":"`array` Array ","name":"array","desc":"Array"}],"desc":"<p>Allocates a new buffer using an <code>array</code> of octets.\n\n</p>\n"},{"params":[{"name":"array"}],"desc":"<p>Allocates a new buffer using an <code>array</code> of octets.\n\n</p>\n"},{"params":[{"textRaw":"`str` String - string to encode. ","name":"str","desc":"String - string to encode."},{"textRaw":"`encoding` String - encoding to use, Optional. ","name":"encoding","desc":"String - encoding to use, Optional.","optional":true}],"desc":"<p>Allocates a new buffer containing the given <code>str</code>.\n<code>encoding</code> defaults to <code>&apos;utf8&apos;</code>.\n\n</p>\n"},{"params":[{"name":"str"},{"name":"encoding","optional":true}],"desc":"<p>Allocates a new buffer containing the given <code>str</code>.\n<code>encoding</code> defaults to <code>&apos;utf8&apos;</code>.\n\n</p>\n"}]},{"textRaw":"Class: SlowBuffer","type":"class","name":"SlowBuffer","desc":"<p>This class is primarily for internal use. JavaScript programs should\nuse Buffer instead of using SlowBuffer.\n\n</p>\n<p>In order to avoid the overhead of allocating many C++ Buffer objects for\nsmall blocks of memory in the lifetime of a server, Node allocates memory\nin 8Kb (8192 byte) chunks. If a buffer is smaller than this size, then it\nwill be backed by a parent SlowBuffer object. If it is larger than this,\nthen Node will allocate a SlowBuffer slab for it directly.\n</p>\n"}],"properties":[{"textRaw":"`INSPECT_MAX_BYTES` Number, Default: 50 ","name":"INSPECT_MAX_BYTES","desc":"<p>How many bytes will be returned when <code>buffer.inspect()</code> is called. This can\nbe overridden by user modules.\n\n</p>\n<p>Note that this is a property on the buffer module returned by\n<code>require(&apos;buffer&apos;)</code>, not on the Buffer global, or a buffer instance.\n\n</p>\n","shortDesc":"Number, Default: 50"}],"type":"module","displayName":"Buffer"}]}
View
1 public/json/0.8.1/child_process.json
@@ -1 +0,0 @@
-{"source":"doc/api/child_process.markdown","modules":[{"textRaw":"Child Process","name":"child_process","stability":3,"stabilityText":"Stable","desc":"<p>Node provides a tri-directional <code>popen(3)</code> facility through the\n<code>child_process</code> module.\n\n</p>\n<p>It is possible to stream data through a child&apos;s <code>stdin</code>, <code>stdout</code>, and\n<code>stderr</code> in a fully non-blocking way.\n\n</p>\n<p>To create a child process use <code>require(&apos;child_process&apos;).spawn()</code> or\n<code>require(&apos;child_process&apos;).fork()</code>. The semantics of each are slightly\ndifferent, and explained below.\n\n</p>\n","classes":[{"textRaw":"Class: ChildProcess","type":"class","name":"ChildProcess","desc":"<p><code>ChildProcess</code> is an [EventEmitter][].\n\n</p>\n<p>Child processes always have three streams associated with them. <code>child.stdin</code>,\n<code>child.stdout</code>, and <code>child.stderr</code>. These may be shared with the stdio\nstreams of the parent process, or they may be separate stream objects\nwhich can be piped to and from.\n\n</p>\n<p>The ChildProcess class is not intended to be used directly. Use the\n<code>spawn()</code> or <code>fork()</code> methods to create a Child Process instance.\n\n</p>\n","events":[{"textRaw":"Event: 'exit'","type":"event","name":"exit","params":[],"desc":"<p>This event is emitted after the child process ends. If the process terminated\nnormally, <code>code</code> is the final exit code of the process, otherwise <code>null</code>. If\nthe process terminated due to receipt of a signal, <code>signal</code> is the string name\nof the signal, otherwise <code>null</code>.\n\n</p>\n<p>Note that the child process stdio streams might still be open.\n\n</p>\n<p>See <code>waitpid(2)</code>.\n\n</p>\n"},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p>This event is emitted when the stdio streams of a child process have all\nterminated. This is distinct from &apos;exit&apos;, since multiple processes\nmight share the same stdio streams.\n\n</p>\n","params":[]},{"textRaw":"Event: 'disconnect'","type":"event","name":"disconnect","desc":"<p>This event is emitted after using the <code>.disconnect()</code> method in the parent or\nin the child. After disconnecting it is no longer possible to send messages.\nAn alternative way to check if you can send messages is to see if the\n<code>child.connected</code> property is <code>true</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'message'","type":"event","name":"message","params":[],"desc":"<p>Messages send by <code>.send(message, [sendHandle])</code> are obtained using the\n<code>message</code> event.\n\n</p>\n"}],"properties":[{"textRaw":"`stdin` {Stream object} ","name":"stdin","desc":"<p>A <code>Writable Stream</code> that represents the child process&apos;s <code>stdin</code>.\nClosing this stream via <code>end()</code> often causes the child process to terminate.\n\n</p>\n<p>If the child stdio streams are shared with the parent, then this will\nnot be set.\n\n</p>\n"},{"textRaw":"`stdout` {Stream object} ","name":"stdout","desc":"<p>A <code>Readable Stream</code> that represents the child process&apos;s <code>stdout</code>.\n\n</p>\n<p>If the child stdio streams are shared with the parent, then this will\nnot be set.\n\n</p>\n"},{"textRaw":"`stderr` {Stream object} ","name":"stderr","desc":"<p>A <code>Readable Stream</code> that represents the child process&apos;s <code>stderr</code>.\n\n</p>\n<p>If the child stdio streams are shared with the parent, then this will\nnot be set.\n\n</p>\n"},{"textRaw":"`pid` {Integer} ","name":"pid","desc":"<p>The PID of the child process.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn,\n grep = spawn(&apos;grep&apos;, [&apos;ssh&apos;]);\n\nconsole.log(&apos;Spawned child pid: &apos; + grep.pid);\ngrep.stdin.end();</code></pre>\n"}],"methods":[{"textRaw":"child.kill([signal])","type":"method","name":"kill","signatures":[{"params":[{"textRaw":"`signal` {String} ","name":"signal","type":"String","optional":true}]},{"params":[{"name":"signal","optional":true}]}],"desc":"<p>Send a signal to the child process. If no argument is given, the process will\nbe sent <code>&apos;SIGTERM&apos;</code>. See <code>signal(7)</code> for a list of available signals.\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn,\n grep = spawn(&apos;grep&apos;, [&apos;ssh&apos;]);\n\ngrep.on(&apos;exit&apos;, function (code, signal) {\n console.log(&apos;child process terminated due to receipt of signal &apos;+signal);\n});\n\n// send SIGHUP to process\ngrep.kill(&apos;SIGHUP&apos;);</code></pre>\n<p>Note that while the function is called <code>kill</code>, the signal delivered to the child\nprocess may not actually kill it. <code>kill</code> really just sends a signal to a process.\n\n</p>\n<p>See <code>kill(2)</code>\n\n</p>\n"},{"textRaw":"child.send(message, [sendHandle])","type":"method","name":"send","signatures":[{"params":[{"textRaw":"`message` {Object} ","name":"message","type":"Object"},{"textRaw":"`sendHandle` {Handle object} ","name":"sendHandle","type":"Handle object","optional":true}]},{"params":[{"name":"message"},{"name":"sendHandle","optional":true}]}],"desc":"<p>When using <code>child_process.fork()</code> you can write to the child using\n<code>child.send(message, [sendHandle])</code> and messages are received by\na <code>&apos;message&apos;</code> event on the child.\n\n</p>\n<p>For example:\n\n</p>\n<pre><code>var cp = require(&apos;child_process&apos;);\n\nvar n = cp.fork(__dirname + &apos;/sub.js&apos;);\n\nn.on(&apos;message&apos;, function(m) {\n console.log(&apos;PARENT got message:&apos;, m);\n});\n\nn.send({ hello: &apos;world&apos; });</code></pre>\n<p>And then the child script, <code>&apos;sub.js&apos;</code> might look like this:\n\n</p>\n<pre><code>process.on(&apos;message&apos;, function(m) {\n console.log(&apos;CHILD got message:&apos;, m);\n});\n\nprocess.send({ foo: &apos;bar&apos; });</code></pre>\n<p>In the child the <code>process</code> object will have a <code>send()</code> method, and <code>process</code>\nwill emit objects each time it receives a message on its channel.\n\n</p>\n<p>There is a special case when sending a <code>{cmd: &apos;NODE_foo&apos;}</code> message. All messages\ncontaining a <code>NODE_</code> prefix in its <code>cmd</code> property will not be emitted in\nthe <code>message</code> event, since they are internal messages used by node core.\nMessages containing the prefix are emitted in the <code>internalMessage</code> event, you\nshould by all means avoid using this feature, it is subject to change without notice.\n\n</p>\n<p>The <code>sendHandle</code> option to <code>child.send()</code> is for sending a TCP server or\nsocket object to another process. The child will receive the object as its\nsecond argument to the <code>message</code> event.\n\n</p>\n<p><strong>send server object</strong>\n\n</p>\n<p>Here is an example of sending a server:\n\n</p>\n<pre><code>var child = require(&apos;child_process&apos;).fork(&apos;child.js&apos;);\n\n// Open up the server object and send the handle.\nvar server = require(&apos;net&apos;).createServer();\nserver.on(&apos;connection&apos;, function (socket) {\n socket.end(&apos;handled by parent&apos;);\n});\nserver.listen(1337, function() {\n child.send(&apos;server&apos;, server);\n});</code></pre>\n<p>And the child would the recive the server object as:\n\n</p>\n<pre><code>process.on(&apos;message&apos;, function(m, server) {\n if (m === &apos;server&apos;) {\n server.on(&apos;connection&apos;, function (socket) {\n socket.end(&apos;handled by child&apos;);\n });\n }\n});</code></pre>\n<p>Note that the server is now shared between the parent and child, this means\nthat some connections will be handled by the parent and some by the child.\n\n</p>\n<p><strong>send socket object</strong>\n\n</p>\n<p>Here is an example of sending a socket. It will spawn two childs and handle\nconnections with the remote address <code>74.125.127.100</code> as VIP by sending the\nsocket to a &quot;special&quot; child process. Other sockets will go to a &quot;normal&quot; process.\n\n</p>\n<pre><code>var normal = require(&apos;child_process&apos;).fork(&apos;child.js&apos;, [&apos;normal&apos;]);\nvar special = require(&apos;child_process&apos;).fork(&apos;child.js&apos;, [&apos;special&apos;]);\n\n// Open up the server and send sockets to child\nvar server = require(&apos;net&apos;).createServer();\nserver.on(&apos;connection&apos;, function (socket) {\n\n // if this is a VIP\n if (socket.remoteAddress === &apos;74.125.127.100&apos;) {\n special.send(&apos;socket&apos;, socket);\n return;\n }\n // just the usual dudes\n normal.send(&apos;socket&apos;, socket);\n});\nserver.listen(1337);</code></pre>\n<p>The <code>child.js</code> could look like this:\n\n</p>\n<pre><code>process.on(&apos;message&apos;, function(m, socket) {\n if (m === &apos;socket&apos;) {\n socket.end(&apos;You where handled as a &apos; + process.argv[2] + &apos; person&apos;);\n }\n});</code></pre>\n<p>Note that once a single socket has been sent to a child the parent can no\nlonger keep track of when the socket is destroyed. To indicate this condition\nthe <code>.connections</code> property becomes <code>null</code>.\nIt is also recomended not to use <code>.maxConnections</code> in this condition.\n\n</p>\n"},{"textRaw":"child.disconnect()","type":"method","name":"disconnect","desc":"<p>To close the IPC connection between parent and child use the\n<code>child.disconnect()</code> method. This allows the child to exit gracefully since\nthere is no IPC channel keeping it alive. When calling this method the\n<code>disconnect</code> event will be emitted in both parent and child, and the\n<code>connected</code> flag will be set to <code>false</code>. Please note that you can also call\n<code>process.disconnect()</code> in the child process.\n\n</p>\n","signatures":[{"params":[]}]}]}],"methods":[{"textRaw":"child_process.spawn(command, [args], [options])","type":"method","name":"spawn","signatures":[{"return":{"textRaw":"return: {ChildProcess object} ","name":"return","type":"ChildProcess object"},"params":[{"textRaw":"`command` {String} The command to run ","name":"command","type":"String","desc":"The command to run"},{"textRaw":"`args` {Array} List of string arguments ","name":"args","type":"Array","desc":"List of string arguments","optional":true},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`stdio` {Array|String} Child's stdio configuration. (See below) ","name":"stdio","type":"Array|String","desc":"Child's stdio configuration. (See below)"},{"textRaw":"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See below) ","name":"customFds","type":"Array","desc":"**Deprecated** File descriptors for the child to use for stdio. (See below)"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`detached` {Boolean} The child will be a process group leader. (See below) ","name":"detached","type":"Boolean","desc":"The child will be a process group leader. (See below)"}],"name":"options","type":"Object","optional":true}]},{"params":[{"name":"command"},{"name":"args","optional":true},{"name":"options","optional":true}]}],"desc":"<p>Launches a new process with the given <code>command</code>, with command line arguments in <code>args</code>.\nIf omitted, <code>args</code> defaults to an empty Array.\n\n</p>\n<p>The third argument is used to specify additional options, which defaults to:\n\n</p>\n<pre><code>{ cwd: undefined,\n env: process.env\n}</code></pre>\n<p><code>cwd</code> allows you to specify the working directory from which the process is spawned.\nUse <code>env</code> to specify environment variables that will be visible to the new process.\n\n</p>\n<p>Example of running <code>ls -lh /usr</code>, capturing <code>stdout</code>, <code>stderr</code>, and the exit code:\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n spawn = require(&apos;child_process&apos;).spawn,\n ls = spawn(&apos;ls&apos;, [&apos;-lh&apos;, &apos;/usr&apos;]);\n\nls.stdout.on(&apos;data&apos;, function (data) {\n console.log(&apos;stdout: &apos; + data);\n});\n\nls.stderr.on(&apos;data&apos;, function (data) {\n console.log(&apos;stderr: &apos; + data);\n});\n\nls.on(&apos;exit&apos;, function (code) {\n console.log(&apos;child process exited with code &apos; + code);\n});</code></pre>\n<p>Example: A very elaborate way to run &apos;ps ax | grep ssh&apos;\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n spawn = require(&apos;child_process&apos;).spawn,\n ps = spawn(&apos;ps&apos;, [&apos;ax&apos;]),\n grep = spawn(&apos;grep&apos;, [&apos;ssh&apos;]);\n\nps.stdout.on(&apos;data&apos;, function (data) {\n grep.stdin.write(data);\n});\n\nps.stderr.on(&apos;data&apos;, function (data) {\n console.log(&apos;ps stderr: &apos; + data);\n});\n\nps.on(&apos;exit&apos;, function (code) {\n if (code !== 0) {\n console.log(&apos;ps process exited with code &apos; + code);\n }\n grep.stdin.end();\n});\n\ngrep.stdout.on(&apos;data&apos;, function (data) {\n console.log(data);\n});\n\ngrep.stderr.on(&apos;data&apos;, function (data) {\n console.log(&apos;grep stderr: &apos; + data);\n});\n\ngrep.on(&apos;exit&apos;, function (code) {\n if (code !== 0) {\n console.log(&apos;grep process exited with code &apos; + code);\n }\n});</code></pre>\n<p>Example of checking for failed exec:\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn,\n child = spawn(&apos;bad_command&apos;);\n\nchild.stderr.setEncoding(&apos;utf8&apos;);\nchild.stderr.on(&apos;data&apos;, function (data) {\n if (/^execvp\\(\\)/.test(data)) {\n console.log(&apos;Failed to start child process.&apos;);\n }\n});</code></pre>\n<p>Note that if spawn receives an empty options object, it will result in\nspawning the process with an empty environment rather than using\n<code>process.env</code>. This due to backwards compatibility issues with a deprecated\nAPI.\n\n</p>\n<p>The &apos;stdio&apos; option to <code>child_process.spawn()</code> is an array where each\nindex corresponds to a fd in the child. The value is one of the following:\n\n</p>\n<ol>\n<li><code>&apos;pipe&apos;</code> - Create a pipe between the child process and the parent process.\nThe parent end of the pipe is exposed to the parent as a property on the\n<code>child_process</code> object as <code>ChildProcess.stdio[fd]</code>. Pipes created for\nfds 0 - 2 are also available as ChildProcess.stdin, ChildProcess.stdout\nand ChildProcess.stderr, respectively.</li>\n<li><code>&apos;ipc&apos;</code> - Create an IPC channel for passing messages/file descriptors\nbetween parent and child. A ChildProcess may have at most <em>one</em> IPC stdio\nfile descriptor. Setting this option enables the ChildProcess.send() method.\nIf the child writes JSON messages to this file descriptor, then this will\ntrigger ChildProcess.on(&apos;message&apos;). If the child is a Node.js program, then\nthe presence of an IPC channel will enable process.send() and\nprocess.on(&apos;message&apos;).</li>\n<li><code>&apos;ignore&apos;</code> - Do not set this file descriptor in the child. Note that Node\nwill always open fd 0 - 2 for the processes it spawns. When any of these is\nignored node will open <code>/dev/null</code> and attach it to the child&apos;s fd.</li>\n<li><code>Stream</code> object - Share a readable or writable stream that refers to a tty,\nfile, socket, or a pipe with the child process. The stream&apos;s underlying\nfile descriptor is duplicated in the child process to the fd that \ncorresponds to the index in the <code>stdio</code> array.</li>\n<li>Positive integer - The integer value is interpreted as a file descriptor \nthat is is currently open in the parent process. It is shared with the child\nprocess, similar to how <code>Stream</code> objects can be shared.</li>\n<li><code>null</code>, <code>undefined</code> - Use default value. For stdio fds 0, 1 and 2 (in other\nwords, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the\ndefault is <code>&apos;ignore&apos;</code>.</li>\n</ol>\n<p>As a shorthand, the <code>stdio</code> argument may also be one of the following\nstrings, rather than an array:\n\n</p>\n<ul>\n<li><code>ignore</code> - <code>[&apos;ignore&apos;, &apos;ignore&apos;, &apos;ignore&apos;]</code></li>\n<li><code>pipe</code> - <code>[&apos;pipe&apos;, &apos;pipe&apos;, &apos;pipe&apos;]</code></li>\n<li><code>inherit</code> - <code>[process.stdin, process.stdout, process.stderr]</code> or <code>[0,1,2]</code></li>\n</ul>\n<p>Example:\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn;\n\n// Child will use parent&apos;s stdios\nspawn(&apos;prg&apos;, [], { stdio: &apos;inherit&apos; });\n\n// Spawn child sharing only stderr\nspawn(&apos;prg&apos;, [], { stdio: [&apos;pipe&apos;, &apos;pipe&apos;, process.stderr] });\n\n// Open an extra fd=4, to interact with programs present a\n// startd-style interface.\nspawn(&apos;prg&apos;, [], { stdio: [&apos;pipe&apos;, null, null, null, &apos;pipe&apos;] });</code></pre>\n<p>If the <code>detached</code> option is set, the child process will be made the leader of a\nnew process group. This makes it possible for the child to continue running \nafter the parent exits.\n\n</p>\n<p>By default, the parent will wait for the detached child to exit. To prevent\nthe parent from waiting for a given <code>child</code>, use the <code>child.unref()</code> method,\nand the parent&apos;s event loop will not include the child in its reference count.\n\n</p>\n<p>Example of detaching a long-running process and redirecting its output to a\nfile:\n\n</p>\n<pre><code> var fs = require(&apos;fs&apos;),\n spawn = require(&apos;child_process&apos;).spawn,\n out = fs.openSync(&apos;./out.log&apos;, &apos;a&apos;),\n err = fs.openSync(&apos;./out.log&apos;, &apos;a&apos;);\n\n var child = spawn(&apos;prg&apos;, [], {\n detached: true,\n stdio: [ &apos;ignore&apos;, out, err ]\n });\n\n child.unref();</code></pre>\n<p>When using the <code>detached</code> option to start a long-running process, the process\nwill not stay running in the background unless it is provided with a <code>stdio</code>\nconfiguration that is not connected to the parent. If the parent&apos;s <code>stdio</code> is\ninherited, the child will remain attached to the controlling terminal.\n\n</p>\n<p>There is a deprecated option called <code>customFds</code> which allows one to specify\nspecific file descriptors for the stdio of the child process. This API was\nnot portable to all platforms and therefore removed.\nWith <code>customFds</code> it was possible to hook up the new process&apos; <code>[stdin, stdout,\nstderr]</code> to existing streams; <code>-1</code> meant that a new stream should be created.\nUse at your own risk.\n\n</p>\n<p>There are several internal options. In particular <code>stdinStream</code>,\n<code>stdoutStream</code>, <code>stderrStream</code>. They are for INTERNAL USE ONLY. As with all\nundocumented APIs in Node, they should not be used.\n\n</p>\n<p>See also: <code>child_process.exec()</code> and <code>child_process.fork()</code>\n\n</p>\n"},{"textRaw":"child_process.exec(command, [options], callback)","type":"method","name":"exec","signatures":[{"return":{"textRaw":"Return: ChildProcess object ","name":"return","desc":"ChildProcess object"},"params":[{"textRaw":"`command` {String} The command to run, with space-separated arguments ","name":"command","type":"String","desc":"The command to run, with space-separated arguments"},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`stdio` {Array|String} Child's stdio configuration. (See above) ","name":"stdio","type":"Array|String","desc":"Child's stdio configuration. (See above)"},{"textRaw":"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See above) ","name":"customFds","type":"Array","desc":"**Deprecated** File descriptors for the child to use for stdio. (See above)"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`encoding` {String} (Default: 'utf8') ","name":"encoding","default":"utf8","type":"String"},{"textRaw":"`timeout` {Number} (Default: 0) ","name":"timeout","default":"0","type":"Number"},{"textRaw":"`maxBuffer` {Number} (Default: 200*1024) ","name":"maxBuffer","default":"200*1024","type":"Number"},{"textRaw":"`killSignal` {String} (Default: 'SIGTERM') ","name":"killSignal","default":"SIGTERM","type":"String"}],"name":"options","type":"Object","optional":true},{"textRaw":"`callback` {Function} called with the output when process terminates ","options":[{"textRaw":"`error` {Error} ","name":"error","type":"Error"},{"textRaw":"`stdout` {Buffer} ","name":"stdout","type":"Buffer"},{"textRaw":"`stderr` {Buffer} ","name":"stderr","type":"Buffer"}],"name":"callback","type":"Function","desc":"called with the output when process terminates"}]},{"params":[{"name":"command"},{"name":"options","optional":true},{"name":"callback"}]}],"desc":"<p>Runs a command in a shell and buffers the output.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n exec = require(&apos;child_process&apos;).exec,\n child;\n\nchild = exec(&apos;cat *.js bad_file | wc -l&apos;,\n function (error, stdout, stderr) {\n console.log(&apos;stdout: &apos; + stdout);\n console.log(&apos;stderr: &apos; + stderr);\n if (error !== null) {\n console.log(&apos;exec error: &apos; + error);\n }\n});</code></pre>\n<p>The callback gets the arguments <code>(error, stdout, stderr)</code>. On success, <code>error</code>\nwill be <code>null</code>. On error, <code>error</code> will be an instance of <code>Error</code> and <code>err.code</code>\nwill be the exit code of the child process, and <code>err.signal</code> will be set to the\nsignal that terminated the process.\n\n</p>\n<p>There is a second optional argument to specify several options. The\ndefault options are\n\n</p>\n<pre><code>{ encoding: &apos;utf8&apos;,\n timeout: 0,\n maxBuffer: 200*1024,\n killSignal: &apos;SIGTERM&apos;,\n cwd: null,\n env: null }</code></pre>\n<p>If <code>timeout</code> is greater than 0, then it will kill the child process\nif it runs longer than <code>timeout</code> milliseconds. The child process is killed with\n<code>killSignal</code> (default: <code>&apos;SIGTERM&apos;</code>). <code>maxBuffer</code> specifies the largest\namount of data allowed on stdout or stderr - if this value is exceeded then\nthe child process is killed.\n\n\n</p>\n"},{"textRaw":"child_process.execFile(file, args, options, callback)","type":"method","name":"execFile","signatures":[{"return":{"textRaw":"Return: ChildProcess object ","name":"return","desc":"ChildProcess object"},"params":[{"textRaw":"`file` {String} The filename of the program to run ","name":"file","type":"String","desc":"The filename of the program to run"},{"textRaw":"`args` {Array} List of string arguments ","name":"args","type":"Array","desc":"List of string arguments"},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`stdio` {Array|String} Child's stdio configuration. (See above) ","name":"stdio","type":"Array|String","desc":"Child's stdio configuration. (See above)"},{"textRaw":"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See above) ","name":"customFds","type":"Array","desc":"**Deprecated** File descriptors for the child to use for stdio. (See above)"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`encoding` {String} (Default: 'utf8') ","name":"encoding","default":"utf8","type":"String"},{"textRaw":"`timeout` {Number} (Default: 0) ","name":"timeout","default":"0","type":"Number"},{"textRaw":"`maxBuffer` {Number} (Default: 200\\*1024) ","name":"maxBuffer","default":"200\\*1024","type":"Number"},{"textRaw":"`killSignal` {String} (Default: 'SIGTERM') ","name":"killSignal","default":"SIGTERM","type":"String"}],"name":"options","type":"Object"},{"textRaw":"`callback` {Function} called with the output when process terminates ","options":[{"textRaw":"`error` {Error} ","name":"error","type":"Error"},{"textRaw":"`stdout` {Buffer} ","name":"stdout","type":"Buffer"},{"textRaw":"`stderr` {Buffer} ","name":"stderr","type":"Buffer"}],"name":"callback","type":"Function","desc":"called with the output when process terminates"}]},{"params":[{"name":"file"},{"name":"args"},{"name":"options"},{"name":"callback"}]}],"desc":"<p>This is similar to <code>child_process.exec()</code> except it does not execute a\nsubshell but rather the specified file directly. This makes it slightly\nleaner than <code>child_process.exec</code>. It has the same options.\n\n\n</p>\n"},{"textRaw":"child\\_process.fork(modulePath, [args], [options])","type":"method","name":"fork","signatures":[{"return":{"textRaw":"Return: ChildProcess object ","name":"return","desc":"ChildProcess object"},"params":[{"textRaw":"`modulePath` {String} The module to run in the child ","name":"modulePath","type":"String","desc":"The module to run in the child"},{"textRaw":"`args` {Array} List of string arguments ","name":"args","type":"Array","desc":"List of string arguments","optional":true},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`encoding` {String} (Default: 'utf8') ","name":"encoding","default":"utf8","type":"String"},{"textRaw":"`timeout` {Number} (Default: 0) ","name":"timeout","default":"0","type":"Number"}],"name":"options","type":"Object","optional":true}]},{"params":[{"name":"modulePath"},{"name":"args","optional":true},{"name":"options","optional":true}]}],"desc":"<p>This is a special case of the <code>spawn()</code> functionality for spawning Node\nprocesses. In addition to having all the methods in a normal ChildProcess\ninstance, the returned object has a communication channel built-in. See\n<code>child.send(message, [sendHandle])</code> for details.\n\n</p>\n<p>By default the spawned Node process will have the stdout, stderr associated\nwith the parent&apos;s. To change this behavior set the <code>silent</code> property in the\n<code>options</code> object to <code>true</code>.\n\n</p>\n<p>These child Nodes are still whole new instances of V8. Assume at least 30ms\nstartup and 10mb memory for each new Node. That is, you cannot create many\nthousands of them.\n\n</p>\n"}],"type":"module","displayName":"Child Process"}]}
View
1 public/json/0.8.1/cluster.json
@@ -1 +0,0 @@
-{"source":"doc/api/cluster.markdown","modules":[{"textRaw":"Cluster","name":"cluster","stability":1,"stabilityText":"Experimental","desc":"<p>A 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\n</p>\n<p>The cluster module allows you to easily create a network of processes that\nall share server ports.\n\n</p>\n<pre><code>var cluster = require(&apos;cluster&apos;);\nvar http = require(&apos;http&apos;);\nvar numCPUs = require(&apos;os&apos;).cpus().length;\n\nif (cluster.isMaster) {\n // Fork workers.\n for (var i = 0; i &lt; numCPUs; i++) {\n cluster.fork();\n }\n\n cluster.on(&apos;exit&apos;, function(worker, code, signal) {\n console.log(&apos;worker &apos; + worker.pid + &apos; died&apos;);\n });\n} else {\n // Workers can share any TCP connection\n // In this case its a HTTP server\n http.createServer(function(req, res) {\n res.writeHead(200);\n res.end(&quot;hello world\\n&quot;);\n }).listen(8000);\n}</code></pre>\n<p>Running node will now share port 8000 between the workers:\n\n</p>\n<pre><code>% node server.js\nWorker 2438 online\nWorker 2437 online</code></pre>\n<p>This feature was introduced recently, and may change in future versions.\nPlease try it out and provide feedback.\n\n</p>\n<p>Also note that, on Windows, it is not yet possible to set up a named pipe\nserver in a worker.\n\n</p>\n","miscs":[{"textRaw":"How It Works","name":"How It Works","type":"misc","desc":"<p>The worker processes are spawned using the <code>child_process.fork</code> method,\nso that they can communicate with the parent via IPC and pass server\nhandles back and forth.\n\n</p>\n<p>When you call <code>server.listen(...)</code> in a worker, it serializes the\narguments and passes the request to the master process. If the master\nprocess already has a listening server matching the worker&apos;s\nrequirements, then it passes the handle to the worker. If it does not\nalready have a listening server matching that requirement, then it will\ncreate one, and pass the handle to the child.\n\n</p>\n<p>This causes potentially surprising behavior in three edge cases:\n\n</p>\n<ol>\n<li><code>server.listen({fd: 7})</code> Because the message is passed to the master,\nfile descriptor 7 <strong>in the parent</strong> will be listened on, and the\nhandle passed to the worker, rather than listening to the worker&apos;s\nidea of what the number 7 file descriptor references.</li>\n<li><code>server.listen(handle)</code> Listening on handles explicitly will cause\nthe worker to use the supplied handle, rather than talk to the master\nprocess. If the worker already has the handle, then it&apos;s presumed\nthat you know what you are doing.</li>\n<li><code>server.listen(0)</code> Normally, this will case servers to listen on a\nrandom port. However, in a cluster, each worker will receive the\nsame &quot;random&quot; port each time they do <code>listen(0)</code>. In essence, the\nport is random the first time, but predictable thereafter. If you\nwant to listen on a unique port, generate a port number based on the\ncluster worker ID.</li>\n</ol>\n<p>When multiple processes are all <code>accept()</code>ing on the same underlying\nresource, the operating system load-balances across them very\nefficiently. There is no routing logic in Node.js, or in your program,\nand no shared state between the workers. Therefore, it is important to\ndesign your program such that it does not rely too heavily on in-memory\ndata objects for things like sessions and login.\n\n</p>\n<p>Because workers are all separate processes, they can be killed or\nre-spawned depending on your program&apos;s needs, without affecting other\nworkers. As long as there are some workers still alive, the server will\ncontinue to accept connections. Node does not automatically manage the\nnumber of workers for you, however. It is your responsibility to manage\nthe worker pool for your application&apos;s needs.\n\n</p>\n"}],"properties":[{"textRaw":"`settings` {Object} ","name":"settings","options":[{"textRaw":"`exec` {String} file path to worker file. (Default=`__filename`) ","name":"exec","default":"__filename","type":"String","desc":"file path to worker file."},{"textRaw":"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ","name":"args","default":"process.argv.slice(2)","type":"Array","desc":"string arguments passed to worker."},{"textRaw":"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ","name":"silent","default":"false","type":"Boolean","desc":"whether or not to send output to parent's stdio."}],"desc":"<p>All settings set by the <code>.setupMaster</code> is stored in this settings object.\nThis object is not supposed to be change or set manually, by you.\n\n</p>\n"},{"textRaw":"`isMaster` {Boolean} ","name":"isMaster","desc":"<p>True if the process is a master. This is determined\nby the <code>process.env.NODE_UNIQUE_ID</code>. If <code>process.env.NODE_UNIQUE_ID</code> is\nundefined, then <code>isMaster</code> is <code>true</code>.\n\n</p>\n"},{"textRaw":"`isWorker` {Boolean} ","name":"isWorker","desc":"<p>This boolean flag is true if the process is a worker forked from a master.\nIf the <code>process.env.NODE_UNIQUE_ID</code> is set to a value, then\n<code>isWorker</code> is <code>true</code>.\n\n</p>\n"},{"textRaw":"`settings` {Object} ","name":"settings","options":[{"textRaw":"`exec` {String} file path to worker file. Default: `__filename` ","name":"exec","type":"String","desc":"file path to worker file. Default: `__filename`"},{"textRaw":"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ","name":"args","default":"process.argv.slice(2)","type":"Array","desc":"string arguments passed to worker."},{"textRaw":"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ","name":"silent","default":"false","type":"Boolean","desc":"whether or not to send output to parent's stdio."}],"desc":"<p>All settings set by the <code>.setupMaster</code> is stored in this settings object.\nThis object is not supposed to be change or set manually.\n\n</p>\n"},{"textRaw":"`workers` {Object} ","name":"workers","desc":"<p>In the cluster all living worker objects are stored in this object by there\n<code>id</code> as the key. This makes it easy to loop through all living workers.\n\n</p>\n<pre><code>// Go through all workers\nfunction eachWorker(callback) {\n for (var id in cluster.workers) {\n callback(cluster.workers[id]);\n }\n}\neachWorker(function(worker) {\n worker.send(&apos;big announcement to all workers&apos;);\n});</code></pre>\n<p>Should you wish to reference a worker over a communication channel, using\nthe worker&apos;s unique id is the easiest way to find the worker.\n\n</p>\n<pre><code>socket.on(&apos;data&apos;, function(id) {\n var worker = cluster.workers[id];\n});</code></pre>\n"}],"events":[{"textRaw":"Event: 'fork'","type":"event","name":"fork","params":[],"desc":"<p>When a new worker is forked the cluster module will emit a &apos;fork&apos; event.\nThis can be used to log worker activity, and create you own timeout.\n\n</p>\n<pre><code>var timeouts = [];\nfunction errorMsg() {\n console.error(&quot;Something must be wrong with the connection ...&quot;);\n}\n\ncluster.on(&apos;fork&apos;, function(worker) {\n timeouts[worker.id] = setTimeout(errorMsg, 2000);\n});\ncluster.on(&apos;listening&apos;, function(worker, address) {\n clearTimeout(timeouts[worker.id]);\n});\ncluster.on(&apos;exit&apos;, function(worker, code, signal) {\n clearTimeout(timeouts[worker.id]);\n errorMsg();\n});</code></pre>\n"},{"textRaw":"Event: 'online'","type":"event","name":"online","params":[],"desc":"<p>After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it will emit such event.\nThe difference between &apos;fork&apos; and &apos;online&apos; is that fork is emitted when the\nmaster tries to fork a worker, and &apos;online&apos; is emitted when the worker is\nbeing executed.\n\n</p>\n<pre><code>cluster.on(&apos;online&apos;, function(worker) {\n console.log(&quot;Yay, the worker responded after it was forked&quot;);\n});</code></pre>\n"},{"textRaw":"Event: 'listening'","type":"event","name":"listening","params":[],"desc":"<p>When calling <code>listen()</code> from a worker, a &apos;listening&apos; event is automatically assigned\nto the server instance. When the server is listening a message is send to the master\nwhere the &apos;listening&apos; event is emitted.\n\n</p>\n<p>The event handler is executed with two arguments, the <code>worker</code> contains the worker\nobject and the <code>address</code> object contains the following connection properties:\n<code>address</code>, <code>port</code> and <code>addressType</code>. This is very useful if the worker is listening\non more than one address.\n\n</p>\n<pre><code>cluster.on(&apos;listening&apos;, function(worker, address) {\n console.log(&quot;A worker is now connected to &quot; + address.address + &quot;:&quot; + address.port);\n});</code></pre>\n"},{"textRaw":"Event: 'disconnect'","type":"event","name":"disconnect","params":[],"desc":"<p>When a workers IPC channel has disconnected this event is emitted. This will happen\nwhen the worker dies, usually after calling <code>.destroy()</code>.\n\n</p>\n<p>When calling <code>.disconnect()</code>, there may be a delay between the\n<code>disconnect</code> and <code>exit</code> events. This event can be used to detect if\nthe process is stuck in a cleanup or if there are long-living\nconnections.\n\n</p>\n<pre><code>cluster.on(&apos;disconnect&apos;, function(worker) {\n console.log(&apos;The worker #&apos; + worker.id + &apos; has disconnected&apos;);\n});</code></pre>\n"},{"textRaw":"Event: 'exit'","type":"event","name":"exit","params":[],"desc":"<p>When any of the workers die the cluster module will emit the &apos;exit&apos; event.\nThis can be used to restart the worker by calling <code>fork()</code> again.\n\n</p>\n<pre><code>cluster.on(&apos;exit&apos;, function(worker, code, signal) {\n var exitCode = worker.process.exitCode;\n console.log(&apos;worker &apos; + worker.pid + &apos; died (&apos;+exitCode+&apos;). restarting...&apos;);\n cluster.fork();\n});</code></pre>\n"},{"textRaw":"Event: 'setup'","type":"event","name":"setup","params":[],"desc":"<p>When the <code>.setupMaster()</code> function has been executed this event emits.\nIf <code>.setupMaster()</code> was not executed before <code>fork()</code> this function will\ncall <code>.setupMaster()</code> with no arguments.\n\n</p>\n"}],"methods":[{"textRaw":"cluster.setupMaster([settings])","type":"method","name":"setupMaster","signatures":[{"params":[{"textRaw":"`settings` {Object} ","options":[{"textRaw":"`exec` {String} file path to worker file. (Default=`__filename`) ","name":"exec","default":"__filename","type":"String","desc":"file path to worker file."},{"textRaw":"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ","name":"args","default":"process.argv.slice(2)","type":"Array","desc":"string arguments passed to worker."},{"textRaw":"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ","name":"silent","default":"false","type":"Boolean","desc":"whether or not to send output to parent's stdio."}],"name":"settings","type":"Object","optional":true}]},{"params":[{"name":"settings","optional":true}]}],"desc":"<p>The <code>setupMaster</code> is used to change the default &apos;fork&apos; behavior. It takes\none option object argument.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var cluster = require(&quot;cluster&quot;);\ncluster.setupMaster({\n exec : &quot;worker.js&quot;,\n args : [&quot;--use&quot;, &quot;https&quot;],\n silent : true\n});\ncluster.fork();</code></pre>\n"},{"textRaw":"cluster.fork([env])","type":"method","name":"fork","signatures":[{"return":{"textRaw":"return {Worker object} ","name":"return","type":"Worker object"},"params":[{"textRaw":"`env` {Object} Key/value pairs to add to child process environment. ","name":"env","type":"Object","desc":"Key/value pairs to add to child process environment.","optional":true}]},{"params":[{"name":"env","optional":true}]}],"desc":"<p>Spawn a new worker process. This can only be called from the master process.\n\n</p>\n"},{"textRaw":"cluster.disconnect([callback])","type":"method","name":"disconnect","signatures":[{"params":[{"textRaw":"`callback` {Function} called when all workers are disconnected and handlers are closed ","name":"callback","type":"Function","desc":"called when all workers are disconnected and handlers are closed","optional":true}]},{"params":[{"name":"callback","optional":true}]}],"desc":"<p>When calling this method, all workers will commit a graceful suicide. When they are\ndisconnected all internal handlers will be closed, allowing the master process to\ndie graceful if no other event is waiting.\n\n</p>\n<p>The method takes an optional callback argument which will be called when finished.\n\n</p>\n"}],"classes":[{"textRaw":"Class: Worker","type":"class","name":"Worker","desc":"<p>A Worker object contains all public information and method about a worker.\nIn the master it can be obtained using <code>cluster.workers</code>. In a worker\nit can be obtained using <code>cluster.worker</code>.\n\n</p>\n","properties":[{"textRaw":"`id` {String} ","name":"id","desc":"<p>Each new worker is given its own unique id, this id is stored in the\n<code>id</code>.\n\n</p>\n<p>While a worker is alive, this is the key that indexes it in\ncluster.workers\n\n</p>\n"},{"textRaw":"`process` {ChildProcess object} ","name":"process","desc":"<p>All workers are created using <code>child_process.fork()</code>, the returned object\nfrom this function is stored in process.\n\n</p>\n<p>See: <a href=\"child_process.html\">Child Process module</a>\n\n</p>\n"},{"textRaw":"`suicide` {Boolean} ","name":"suicide","desc":"<p>This property is a boolean. It is set when a worker dies after calling <code>.destroy()</code>\nor immediately after calling the <code>.disconnect()</code> method. Until then it is <code>undefined</code>.\n\n</p>\n"}],"methods":[{"textRaw":"worker.send(message, [sendHandle])","type":"method","name":"send","signatures":[{"params":[{"textRaw":"`message` {Object} ","name":"message","type":"Object"},{"textRaw":"`sendHandle` {Handle object} ","name":"sendHandle","type":"Handle object","optional":true}]},{"params":[{"name":"message"},{"name":"sendHandle","optional":true}]}],"desc":"<p>This function is equal to the send methods provided by\n<code>child_process.fork()</code>. In the master you should use this function to\nsend a message to a specific worker. However in a worker you can also use\n<code>process.send(message)</code>, since this is the same function.\n\n</p>\n<p>This example will echo back all messages from the master:\n\n</p>\n<pre><code>if (cluster.isMaster) {\n var worker = cluster.fork();\n worker.send(&apos;hi there&apos;);\n\n} else if (cluster.isWorker) {\n process.on(&apos;message&apos;, function(msg) {\n process.send(msg);\n });\n}</code></pre>\n"},{"textRaw":"worker.destroy()","type":"method","name":"destroy","desc":"<p>This function will kill the worker, and inform the master to not spawn a\nnew worker. The boolean <code>suicide</code> lets you distinguish between voluntary\nand accidental exit.\n\n</p>\n<pre><code>cluster.on(&apos;exit&apos;, function(worker, code, signal) {\n if (worker.suicide === true) {\n console.log(&apos;Oh, it was just suicide\\&apos; – no need to worry&apos;).\n }\n});\n\n// destroy worker\nworker.destroy();</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"worker.disconnect()","type":"method","name":"disconnect","desc":"<p>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 worker\nwill close allowing it to die graceful. When the IPC channel is closed the <code>disconnect</code>\nevent will emit, this is then followed by the <code>exit</code> event, there is emitted when\nthe worker finally die.\n\n</p>\n<p>Because there might be long living connections, it is useful to implement a timeout.\nThis example ask the worker to disconnect and after 2 seconds it will destroy the\nserver. An alternative wound be to execute <code>worker.destroy()</code> after 2 seconds, but\nthat would normally not allow the worker to do any cleanup if needed.\n\n</p>\n<pre><code>if (cluster.isMaster) {\n var worker = cluser.fork();\n var timeout;\n\n worker.on(&apos;listening&apos;, function(address) {\n worker.disconnect();\n timeout = setTimeout(function() {\n worker.send(&apos;force kill&apos;);\n }, 2000);\n });\n\n worker.on(&apos;disconnect&apos;, function() {\n clearTimeout(timeout);\n });\n\n} else if (cluster.isWorker) {\n var net = require(&apos;net&apos;);\n var server = net.createServer(function(socket) {\n // connection never end\n });\n\n server.listen(8000);\n\n server.on(&apos;close&apos;, function() {\n // cleanup\n });\n\n process.on(&apos;message&apos;, function(msg) {\n if (msg === &apos;force kill&apos;) {\n server.destroy();\n }\n });\n}</code></pre>\n","signatures":[{"params":[]}]}],"events":[{"textRaw":"Event: 'message'","type":"event","name":"message","params":[],"desc":"<p>This event is the same as the one provided by <code>child_process.fork()</code>.\nIn the master you should use this event, however in a worker you can also use\n<code>process.on(&apos;message&apos;)</code>\n\n</p>\n<p>As an example, here is a cluster that keeps count of the number of requests\nin the master process using the message system:\n\n</p>\n<pre><code>var cluster = require(&apos;cluster&apos;);\nvar http = require(&apos;http&apos;);\n\nif (cluster.isMaster) {\n\n // Keep track of http requests\n var numReqs = 0;\n setInterval(function() {\n console.log(&quot;numReqs =&quot;, numReqs);\n }, 1000);\n\n // Count requestes\n function messageHandler(msg) {\n if (msg.cmd &amp;&amp; msg.cmd == &apos;notifyRequest&apos;) {\n numReqs += 1;\n }\n }\n\n // Start workers and listen for messages containing notifyRequest\n var numCPUs = require(&apos;os&apos;).cpus().length;\n for (var i = 0; i &lt; numCPUs; i++) {\n cluster.fork();\n }\n\n Object.keys(cluster.workers).forEach(function(id) {\n cluster.workers[id].on(&apos;message&apos;, 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(&quot;hello world\\n&quot;);\n\n // notify master about the request\n process.send({ cmd: &apos;notifyRequest&apos; });\n }).listen(8000);\n}</code></pre>\n"},{"textRaw":"Event: 'online'","type":"event","name":"online","desc":"<p>Same as the <code>cluster.on(&apos;online&apos;)</code> event, but emits only when the state change\non the specified worker.\n\n</p>\n<pre><code>cluster.fork().on(&apos;online&apos;, function() {\n // Worker is online\n};</code></pre>\n","params":[]},{"textRaw":"Event: 'listening'","type":"event","name":"listening","params":[],"desc":"<p>Same as the <code>cluster.on(&apos;listening&apos;)</code> event, but emits only when the state change\non the specified worker.\n\n</p>\n<pre><code>cluster.fork().on(&apos;listening&apos;, function(address) {\n // Worker is listening\n};</code></pre>\n"},{"textRaw":"Event: 'disconnect'","type":"event","name":"disconnect","desc":"<p>Same as the <code>cluster.on(&apos;disconnect&apos;)</code> event, but emits only when the state change\non the specified worker.\n\n</p>\n<pre><code>cluster.fork().on(&apos;disconnect&apos;, function() {\n // Worker has disconnected\n};</code></pre>\n","params":[]},{"textRaw":"Event: 'exit'","type":"event","name":"exit","params":[],"desc":"<p>Emitted by the individual worker instance, when the underlying child process\nis terminated. See <a href=\"child_process.html#child_process_event_exit\">child_process event: &apos;exit&apos;</a>.\n\n</p>\n<pre><code>var worker = cluster.fork();\nworker.on(&apos;exit&apos;, function(code, signal) {\n if( signal ) {\n console.log(&quot;worker was killed by signal: &quot;+signal);\n } else if( code !== 0 ) {\n console.log(&quot;worker exited with error code: &quot;+code);\n } else {\n console.log(&quot;worker success!&quot;);\n }\n};</code></pre>\n"}]}],"type":"module","displayName":"Cluster"}]}
View
1 public/json/0.8.1/crypto.json
@@ -1 +0,0 @@
-{"source":"doc/api/crypto.markdown","modules":[{"textRaw":"Crypto","name":"crypto","stability":3,"stabilityText":"Stable","desc":"<p>Use <code>require(&apos;crypto&apos;)</code> to access this module.\n\n</p>\n<p>The crypto module requires OpenSSL to be available on the underlying platform.\nIt offers a way of encapsulating secure credentials to be used as part\nof a secure HTTPS net or http connection.\n\n</p>\n<p>It also offers a set of wrappers for OpenSSL&apos;s hash, hmac, cipher, decipher, sign and verify methods.\n\n</p>\n","methods":[{"textRaw":"crypto.createCredentials(details)","type":"method","name":"createCredentials","desc":"<p>Creates a credentials object, with the optional details being a dictionary with keys:\n\n</p>\n<ul>\n<li><code>pfx</code> : A string or buffer holding the PFX or PKCS12 encoded private key, certificate and CA certificates</li>\n<li><code>key</code> : A string holding the PEM encoded private key</li>\n<li><code>passphrase</code> : A string of passphrase for the private key or pfx</li>\n<li><code>cert</code> : A string holding the PEM encoded certificate</li>\n<li><code>ca</code> : Either a string or list of strings of PEM encoded CA certificates to trust.</li>\n<li><code>crl</code> : Either a string or list of strings of PEM encoded CRLs (Certificate Revocation List)</li>\n<li><code>ciphers</code>: A string describing the ciphers to use or exclude. Consult\n<a href=\"http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT\">http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT</a> for details\non the format.</li>\n</ul>\n<p>If no &apos;ca&apos; details are given, then node.js will use the default publicly trusted list of CAs as given in\n</p>\n<p><a href=\"http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt\">http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt</a>.\n\n\n</p>\n","signatures":[{"params":[{"name":"details"}]}]},{"textRaw":"crypto.createHash(algorithm)","type":"method","name":"createHash","desc":"<p>Creates and returns a hash object, a cryptographic hash with the given algorithm\nwhich can be used to generate hash digests.\n\n</p>\n<p><code>algorithm</code> is dependent on the available algorithms supported by the version\nof OpenSSL on the platform. Examples are <code>&apos;sha1&apos;</code>, <code>&apos;md5&apos;</code>, <code>&apos;sha256&apos;</code>, <code>&apos;sha512&apos;</code>, etc.\nOn recent releases, <code>openssl list-message-digest-algorithms</code> will display the available digest algorithms.\n\n</p>\n<p>Example: this program that takes the sha1 sum of a file\n\n</p>\n<pre><code>var filename = process.argv[2];\nvar crypto = require(&apos;crypto&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar shasum = crypto.createHash(&apos;sha1&apos;);\n\nvar s = fs.ReadStream(filename);\ns.on(&apos;data&apos;, function(d) {\n shasum.update(d);\n});\n\ns.on(&apos;end&apos;, function() {\n var d = shasum.digest(&apos;hex&apos;);\n console.log(d + &apos; &apos; + filename);\n});</code></pre>\n","signatures":[{"params":[{"name":"algorithm"}]}]},{"textRaw":"crypto.createHmac(algorithm, key)","type":"method","name":"createHmac","desc":"<p>Creates and returns a hmac object, a cryptographic hmac with the given algorithm and key.\n\n</p>\n<p><code>algorithm</code> is dependent on the available algorithms supported by OpenSSL - see createHash above.\n<code>key</code> is the hmac key to be used.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"},{"name":"key"}]}]},{"textRaw":"crypto.createCipher(algorithm, password)","type":"method","name":"createCipher","desc":"<p>Creates and returns a cipher object, with the given algorithm and password.\n\n</p>\n<p><code>algorithm</code> is dependent on OpenSSL, examples are <code>&apos;aes192&apos;</code>, etc.\nOn recent releases, <code>openssl list-cipher-algorithms</code> will display the\navailable cipher algorithms.\n<code>password</code> is used to derive key and IV, which must be a <code>&apos;binary&apos;</code> encoded\nstring or a <a href=\"buffer.html\">buffer</a>.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"},{"name":"password"}]}]},{"textRaw":"crypto.createCipheriv(algorithm, key, iv)","type":"method","name":"createCipheriv","desc":"<p>Creates and returns a cipher object, with the given algorithm, key and iv.\n\n</p>\n<p><code>algorithm</code> is the same as the argument to <code>createCipher()</code>.\n<code>key</code> is the raw key used by the algorithm.\n<code>iv</code> is an <a href=\"http://en.wikipedia.org/wiki/Initialization_vector\">initialization\nvector</a>.\n\n</p>\n<p><code>key</code> and <code>iv</code> must be <code>&apos;binary&apos;</code> encoded strings or <a href=\"buffer.html\">buffers</a>.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"},{"name":"key"},{"name":"iv"}]}]},{"textRaw":"crypto.createDecipher(algorithm, password)","type":"method","name":"createDecipher","desc":"<p>Creates and returns a decipher object, with the given algorithm and key.\nThis is the mirror of the [createCipher()][] above.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"},{"name":"password"}]}]},{"textRaw":"crypto.createDecipheriv(algorithm, key, iv)","type":"method","name":"createDecipheriv","desc":"<p>Creates and returns a decipher object, with the given algorithm, key and iv.\nThis is the mirror of the [createCipheriv()][] above.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"},{"name":"key"},{"name":"iv"}]}]},{"textRaw":"crypto.createSign(algorithm)","type":"method","name":"createSign","desc":"<p>Creates and returns a signing object, with the given algorithm.\nOn recent OpenSSL releases, <code>openssl list-public-key-algorithms</code> will display\nthe available signing algorithms. Examples are <code>&apos;RSA-SHA256&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"}]}]},{"textRaw":"crypto.createVerify(algorithm)","type":"method","name":"createVerify","desc":"<p>Creates and returns a verification object, with the given algorithm.\nThis is the mirror of the signing object above.\n\n</p>\n","signatures":[{"params":[{"name":"algorithm"}]}]},{"textRaw":"crypto.createDiffieHellman(prime_length)","type":"method","name":"createDiffieHellman","desc":"<p>Creates a Diffie-Hellman key exchange object and generates a prime of the\ngiven bit length. The generator used is <code>2</code>.\n\n</p>\n","signatures":[{"params":[{"name":"prime_length"}]}]},{"textRaw":"crypto.createDiffieHellman(prime, [encoding])","type":"method","name":"createDiffieHellman","desc":"<p>Creates a Diffie-Hellman key exchange object using the supplied prime. The\ngenerator used is <code>2</code>. Encoding can be <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or <code>&apos;base64&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"prime"},{"name":"encoding","optional":true}]}]},{"textRaw":"crypto.getDiffieHellman(group_name)","type":"method","name":"getDiffieHellman","desc":"<p>Creates a predefined Diffie-Hellman key exchange object.\nThe supported groups are: <code>&apos;modp1&apos;</code>, <code>&apos;modp2&apos;</code>, <code>&apos;modp5&apos;</code>\n(defined in [RFC 2412][])\nand <code>&apos;modp14&apos;</code>, <code>&apos;modp15&apos;</code>, <code>&apos;modp16&apos;</code>, <code>&apos;modp17&apos;</code>, <code>&apos;modp18&apos;</code>\n(defined in [RFC 3526][]).\nThe returned object mimics the interface of objects created by\n[crypto.createDiffieHellman()][] above, but\nwill not allow to change the keys (with\n[diffieHellman.setPublicKey()][] for example).\nThe advantage of using this routine is that the parties don&apos;t have to\ngenerate nor exchange group modulus beforehand, saving both processor and\ncommunication time.\n\n</p>\n<p>Example (obtaining a shared secret):\n\n</p>\n<pre><code>var crypto = require(&apos;crypto&apos;);\nvar alice = crypto.getDiffieHellman(&apos;modp5&apos;);\nvar bob = crypto.getDiffieHellman(&apos;modp5&apos;);\n\nalice.generateKeys();\nbob.generateKeys();\n\nvar alice_secret = alice.computeSecret(bob.getPublicKey(), &apos;binary&apos;, &apos;hex&apos;);\nvar bob_secret = bob.computeSecret(alice.getPublicKey(), &apos;binary&apos;, &apos;hex&apos;);\n\n/* alice_secret and bob_secret should be the same */\nconsole.log(alice_secret == bob_secret);</code></pre>\n","signatures":[{"params":[{"name":"group_name"}]}]},{"textRaw":"crypto.pbkdf2(password, salt, iterations, keylen, callback)","type":"method","name":"pbkdf2","desc":"<p>Asynchronous PBKDF2 applies pseudorandom function HMAC-SHA1 to derive\na key of given length from the given password, salt and iterations.\nThe callback gets two arguments <code>(err, derivedKey)</code>.\n\n</p>\n","signatures":[{"params":[{"name":"password"},{"name":"salt"},{"name":"iterations"},{"name":"keylen"},{"name":"callback"}]}]},{"textRaw":"crypto.randomBytes(size, [callback])","type":"method","name":"randomBytes","desc":"<p>Generates cryptographically strong pseudo-random data. Usage:\n\n</p>\n<pre><code>// async\ncrypto.randomBytes(256, function(ex, buf) {\n if (ex) throw ex;\n console.log(&apos;Have %d bytes of random data: %s&apos;, buf.length, buf);\n});\n\n// sync\ntry {\n var buf = crypto.randomBytes(256);\n console.log(&apos;Have %d bytes of random data: %s&apos;, buf.length, buf);\n} catch (ex) {\n // handle error\n}</code></pre>\n","signatures":[{"params":[{"name":"size"},{"name":"callback","optional":true}]}]}],"classes":[{"textRaw":"Class: Hash","type":"class","name":"Hash","desc":"<p>The class for creating hash digests of data.\n\n</p>\n<p>Returned by <code>crypto.createHash</code>.\n\n</p>\n","methods":[{"textRaw":"hash.update(data, [input_encoding])","type":"method","name":"update","desc":"<p>Updates the hash content with the given <code>data</code>, the encoding of which is given\nin <code>input_encoding</code> and can be <code>&apos;utf8&apos;</code>, <code>&apos;ascii&apos;</code> or <code>&apos;binary&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\nThis can be called many times with new data as it is streamed.\n\n</p>\n","signatures":[{"params":[{"name":"data"},{"name":"input_encoding","optional":true}]}]},{"textRaw":"hash.digest([encoding])","type":"method","name":"digest","desc":"<p>Calculates the digest of all of the passed data to be hashed.\nThe <code>encoding</code> can be <code>&apos;hex&apos;</code>, <code>&apos;binary&apos;</code> or <code>&apos;base64&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Note: <code>hash</code> object can not be used after <code>digest()</code> method been called.\n\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]}]},{"textRaw":"Class: Hmac","type":"class","name":"Hmac","desc":"<p>Class for creating cryptographic hmac content.\n\n</p>\n<p>Returned by <code>crypto.createHmac</code>.\n\n</p>\n","methods":[{"textRaw":"hmac.update(data)","type":"method","name":"update","desc":"<p>Update the hmac content with the given <code>data</code>.\nThis can be called many times with new data as it is streamed.\n\n</p>\n","signatures":[{"params":[{"name":"data"}]}]},{"textRaw":"hmac.digest([encoding])","type":"method","name":"digest","desc":"<p>Calculates the digest of all of the passed data to the hmac.\nThe <code>encoding</code> can be <code>&apos;hex&apos;</code>, <code>&apos;binary&apos;</code> or <code>&apos;base64&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Note: <code>hmac</code> object can not be used after <code>digest()</code> method been called.\n\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]}]},{"textRaw":"Class: Cipher","type":"class","name":"Cipher","desc":"<p>Class for encrypting data.\n\n</p>\n<p>Returned by <code>crypto.createCipher</code> and <code>crypto.createCipheriv</code>.\n\n</p>\n","methods":[{"textRaw":"cipher.update(data, [input_encoding], [output_encoding])","type":"method","name":"update","desc":"<p>Updates the cipher with <code>data</code>, the encoding of which is given in\n<code>input_encoding</code> and can be <code>&apos;utf8&apos;</code>, <code>&apos;ascii&apos;</code> or <code>&apos;binary&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>The <code>output_encoding</code> specifies the output format of the enciphered data,\nand can be <code>&apos;binary&apos;</code>, <code>&apos;base64&apos;</code> or <code>&apos;hex&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Returns the enciphered contents, and can be called many times with new data as it is streamed.\n\n</p>\n","signatures":[{"params":[{"name":"data"},{"name":"input_encoding","optional":true},{"name":"output_encoding","optional":true}]}]},{"textRaw":"cipher.final([output_encoding])","type":"method","name":"final","desc":"<p>Returns any remaining enciphered contents, with <code>output_encoding</code> being one of:\n<code>&apos;binary&apos;</code>, <code>&apos;base64&apos;</code> or <code>&apos;hex&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Note: <code>cipher</code> object can not be used after <code>final()</code> method been called.\n\n</p>\n","signatures":[{"params":[{"name":"output_encoding","optional":true}]}]},{"textRaw":"cipher.setAutoPadding(auto_padding=true)","type":"method","name":"setAutoPadding","desc":"<p>You can disable automatic padding of the input data to block size. If <code>auto_padding</code> is false,\nthe length of the entire input data must be a multiple of the cipher&apos;s block size or <code>final</code> will fail.\nUseful for non-standard padding, e.g. using <code>0x0</code> instead of PKCS padding. You must call this before <code>cipher.final</code>.\n\n\n</p>\n","signatures":[{"params":[{"name":"auto_padding","default":"true"}]}]}]},{"textRaw":"Class: Decipher","type":"class","name":"Decipher","desc":"<p>Class for decrypting data.\n\n</p>\n<p>Returned by <code>crypto.createDecipher</code> and <code>crypto.createDecipheriv</code>.\n\n</p>\n","methods":[{"textRaw":"decipher.update(data, [input_encoding], [output_encoding])","type":"method","name":"update","desc":"<p>Updates the decipher with <code>data</code>, which is encoded in <code>&apos;binary&apos;</code>, <code>&apos;base64&apos;</code>\nor <code>&apos;hex&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>The <code>output_decoding</code> specifies in what format to return the deciphered\nplaintext: <code>&apos;binary&apos;</code>, <code>&apos;ascii&apos;</code> or <code>&apos;utf8&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"data"},{"name":"input_encoding","optional":true},{"name":"output_encoding","optional":true}]}]},{"textRaw":"decipher.final([output_encoding])","type":"method","name":"final","desc":"<p>Returns any remaining plaintext which is deciphered,\nwith <code>output_encoding</code> being one of: <code>&apos;binary&apos;</code>, <code>&apos;ascii&apos;</code> or <code>&apos;utf8&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Note: <code>decipher</code> object can not be used after <code>final()</code> method been called.\n\n</p>\n","signatures":[{"params":[{"name":"output_encoding","optional":true}]}]},{"textRaw":"decipher.setAutoPadding(auto_padding=true)","type":"method","name":"setAutoPadding","desc":"<p>You can disable auto padding if the data has been encrypted without standard block padding to prevent\n<code>decipher.final</code> from checking and removing it. Can only work if the input data&apos;s length is a multiple of the\nciphers block size. You must call this before streaming data to <code>decipher.update</code>.\n\n</p>\n","signatures":[{"params":[{"name":"auto_padding","default":"true"}]}]}]},{"textRaw":"Class: Signer","type":"class","name":"Signer","desc":"<p>Class for generating signatures.\n\n</p>\n<p>Returned by <code>crypto.createSign</code>.\n\n</p>\n","methods":[{"textRaw":"signer.update(data)","type":"method","name":"update","desc":"<p>Updates the signer object with data.\nThis can be called many times with new data as it is streamed.\n\n</p>\n","signatures":[{"params":[{"name":"data"}]}]},{"textRaw":"signer.sign(private_key, [output_format])","type":"method","name":"sign","desc":"<p>Calculates the signature on all the updated data passed through the signer.\n<code>private_key</code> is a string containing the PEM encoded private key for signing.\n\n</p>\n<p>Returns the signature in <code>output_format</code> which can be <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code> or\n<code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Note: <code>signer</code> object can not be used after <code>sign()</code> method been called.\n\n</p>\n","signatures":[{"params":[{"name":"private_key"},{"name":"output_format","optional":true}]}]}]},{"textRaw":"Class: Verify","type":"class","name":"Verify","desc":"<p>Class for verifying signatures.\n\n</p>\n<p>Returned by <code>crypto.createVerify</code>.\n\n</p>\n","methods":[{"textRaw":"verifier.update(data)","type":"method","name":"update","desc":"<p>Updates the verifier object with data.\nThis can be called many times with new data as it is streamed.\n\n</p>\n","signatures":[{"params":[{"name":"data"}]}]},{"textRaw":"verifier.verify(object, signature, [signature_format])","type":"method","name":"verify","desc":"<p>Verifies the signed data by using the <code>object</code> and <code>signature</code>. <code>object</code> is a\nstring containing a PEM encoded object, which can be one of RSA public key,\nDSA public key, or X.509 certificate. <code>signature</code> is the previously calculated\nsignature for the data, in the <code>signature_format</code> which can be <code>&apos;binary&apos;</code>,\n<code>&apos;hex&apos;</code> or <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n<p>Returns true or false depending on the validity of the signature for the data and public key.\n\n</p>\n<p>Note: <code>verifier</code> object can not be used after <code>verify()</code> method been called.\n\n</p>\n","signatures":[{"params":[{"name":"object"},{"name":"signature"},{"name":"signature_format","optional":true}]}]}]},{"textRaw":"Class: DiffieHellman","type":"class","name":"DiffieHellman","desc":"<p>The class for creating Diffie-Hellman key exchanges.\n\n</p>\n<p>Returned by <code>crypto.createDiffieHellman</code>.\n\n</p>\n","methods":[{"textRaw":"diffieHellman.generateKeys([encoding])","type":"method","name":"generateKeys","desc":"<p>Generates private and public Diffie-Hellman key values, and returns the\npublic key in the specified encoding. This key should be transferred to the\nother party. Encoding can be <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or <code>&apos;base64&apos;</code>.\nDefaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"diffieHellman.computeSecret(other_public_key, [input_encoding], [output_encoding])","type":"method","name":"computeSecret","desc":"<p>Computes the shared secret using <code>other_public_key</code> as the other party&apos;s\npublic key and returns the computed shared secret. Supplied key is\ninterpreted using specified <code>input_encoding</code>, and secret is encoded using\nspecified <code>output_encoding</code>. Encodings can be <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or\n<code>&apos;base64&apos;</code>. The input encoding defaults to <code>&apos;binary&apos;</code>.\nIf no output encoding is given, the input encoding is used as output encoding.\n\n</p>\n","signatures":[{"params":[{"name":"other_public_key"},{"name":"input_encoding","optional":true},{"name":"output_encoding","optional":true}]}]},{"textRaw":"diffieHellman.getPrime([encoding])","type":"method","name":"getPrime","desc":"<p>Returns the Diffie-Hellman prime in the specified encoding, which can be\n<code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"diffieHellman.getGenerator([encoding])","type":"method","name":"getGenerator","desc":"<p>Returns the Diffie-Hellman prime in the specified encoding, which can be\n<code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"diffieHellman.getPublicKey([encoding])","type":"method","name":"getPublicKey","desc":"<p>Returns the Diffie-Hellman public key in the specified encoding, which can\nbe <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"diffieHellman.getPrivateKey([encoding])","type":"method","name":"getPrivateKey","desc":"<p>Returns the Diffie-Hellman private key in the specified encoding, which can\nbe <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>, or <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"diffieHellman.setPublicKey(public_key, [encoding])","type":"method","name":"setPublicKey","desc":"<p>Sets the Diffie-Hellman public key. Key encoding can be <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>,\nor <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"public_key"},{"name":"encoding","optional":true}]}]},{"textRaw":"diffieHellman.setPrivateKey(public_key, [encoding])","type":"method","name":"setPrivateKey","desc":"<p>Sets the Diffie-Hellman private key. Key encoding can be <code>&apos;binary&apos;</code>, <code>&apos;hex&apos;</code>,\nor <code>&apos;base64&apos;</code>. Defaults to <code>&apos;binary&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"public_key"},{"name":"encoding","optional":true}]}]}]}],"type":"module","displayName":"Crypto"}]}
View
1 public/json/0.8.1/debugger.json
@@ -1 +0,0 @@
-{"source":"doc/api/debugger.markdown","stability":3,"stabilityText":"Stable","miscs":[{"textRaw":"Debugger","name":"Debugger","stability":3,"stabilityText":"Stable","type":"misc","desc":"<p>V8 comes with an extensive debugger which is accessible out-of-process via a\nsimple <a href=\"http://code.google.com/p/v8/wiki/DebuggerProtocol\">TCP protocol</a>.\nNode has a built-in client for this debugger. To use this, start Node with the\n<code>debug</code> argument; a prompt will appear:\n\n</p>\n<pre><code>% node debug myscript.js\n&lt; debugger listening on port 5858\nconnecting... ok\nbreak in /home/indutny/Code/git/indutny/myscript.js:1\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\ndebug&gt;</code></pre>\n<p>Node&apos;s debugger client doesn&apos;t support the full range of commands, but\nsimple step and inspection is possible. By putting the statement <code>debugger;</code>\ninto the source code of your script, you will enable a breakpoint.\n\n</p>\n<p>For example, suppose <code>myscript.js</code> looked like this:\n\n</p>\n<pre><code>// myscript.js\nx = 5;\nsetTimeout(function () {\n debugger;\n console.log(&quot;world&quot;);\n}, 1000);\nconsole.log(&quot;hello&quot;);</code></pre>\n<p>Then once the debugger is run, it will break on line 4.\n\n</p>\n<pre><code>% node debug myscript.js\n&lt; debugger listening on port 5858\nconnecting... ok\nbreak in /home/indutny/Code/git/indutny/myscript.js:1\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\ndebug&gt; cont\n&lt; hello\nbreak in /home/indutny/Code/git/indutny/myscript.js:3\n 1 x = 5;\n 2 setTimeout(function () {\n 3 debugger;\n 4 console.log(&quot;world&quot;);\n 5 }, 1000);\ndebug&gt; next\nbreak in /home/indutny/Code/git/indutny/myscript.js:4\n 2 setTimeout(function () {\n 3 debugger;\n 4 console.log(&quot;world&quot;);\n 5 }, 1000);\n 6 console.log(&quot;hello&quot;);\ndebug&gt; repl\nPress Ctrl + C to leave debug repl\n&gt; x\n5\n&gt; 2+2\n4\ndebug&gt; next\n&lt; world\nbreak in /home/indutny/Code/git/indutny/myscript.js:5\n 3 debugger;\n 4 console.log(&quot;world&quot;);\n 5 }, 1000);\n 6 console.log(&quot;hello&quot;);\n 7\ndebug&gt; quit\n%</code></pre>\n<p>The <code>repl</code> command allows you to evaluate code remotely. The <code>next</code> command\nsteps over to the next line. There are a few other commands available and more\nto come. Type <code>help</code> to see others.\n\n</p>\n","miscs":[{"textRaw":"Watchers","name":"watchers","desc":"<p>You can watch expression and variable values while debugging your code.\nOn every breakpoint each expression from the watchers list will be evaluated\nin the current context and displayed just before the breakpoint&apos;s source code\nlisting.\n\n</p>\n<p>To start watching an expression, type <code>watch(&quot;my_expression&quot;)</code>. <code>watchers</code>\nprints the active watchers. To remove a watcher, type\n<code>unwatch(&quot;my_expression&quot;)</code>.\n\n</p>\n","type":"misc","displayName":"Watchers"},{"textRaw":"Commands reference","name":"commands_reference","modules":[{"textRaw":"Execution control","name":"Execution control","type":"module","displayName":"Various"},{"textRaw":"Various","name":"various","type":"module","displayName":"Various"}],"type":"misc","displayName":"Commands reference"},{"textRaw":"Advanced Usage","name":"advanced_usage","desc":"<p>The V8 debugger can be enabled and accessed either by starting Node with\nthe <code>--debug</code> command-line flag or by signaling an existing Node process\nwith <code>SIGUSR1</code>.\n</p>\n","type":"misc","displayName":"Advanced Usage"}]}]}
View
1 public/json/0.8.1/dgram.json
@@ -1 +0,0 @@
-{"source":"doc/api/dgram.markdown","modules":[{"textRaw":"UDP / Datagram Sockets","name":"dgram","stability":3,"stabilityText":"Stable","desc":"<p>Datagram sockets are available through <code>require(&apos;dgram&apos;)</code>.\n\n</p>\n","methods":[{"textRaw":"dgram.createSocket(type, [callback])","type":"method","name":"createSocket","signatures":[{"return":{"textRaw":"Returns: Socket object ","name":"return","desc":"Socket object"},"params":[{"textRaw":"`type` String. Either 'udp4' or 'udp6' ","name":"type","desc":"String. Either 'udp4' or 'udp6'"},{"textRaw":"`callback` Function. Attached as a listener to `message` events. Optional ","name":"callback","optional":true,"desc":"Function. Attached as a listener to `message` events."}]},{"params":[{"name":"type"},{"name":"callback","optional":true}]}],"desc":"<p>Creates a datagram Socket of the specified types. Valid types are <code>udp4</code>\nand <code>udp6</code>.\n\n</p>\n<p>Takes an optional callback which is added as a listener for <code>message</code> events.\n\n</p>\n<p>Call <code>socket.bind</code> if you want to receive datagrams. <code>socket.bind()</code> will bind\nto the &quot;all interfaces&quot; address on a random port (it does the right thing for\nboth <code>udp4</code> and <code>udp6</code> sockets). You can then retrieve the address and port\nwith <code>socket.address().address</code> and <code>socket.address().port</code>.\n\n</p>\n"}],"classes":[{"textRaw":"Class: Socket","type":"class","name":"Socket","desc":"<p>The dgram Socket class encapsulates the datagram functionality. It\nshould be created via <code>dgram.createSocket(type, [callback])</code>.\n\n</p>\n","events":[{"textRaw":"Event: 'message'","type":"event","name":"message","params":[],"desc":"<p>Emitted when a new datagram is available on a socket. <code>msg</code> is a <code>Buffer</code> and <code>rinfo</code> is\nan object with the sender&apos;s address information and the number of bytes in the datagram.\n\n</p>\n"},{"textRaw":"Event: 'listening'","type":"event","name":"listening","desc":"<p>Emitted when a socket starts listening for datagrams. This happens as soon as UDP sockets\nare created.\n\n</p>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p>Emitted when a socket is closed with <code>close()</code>. No new <code>message</code> events will be emitted\non this socket.\n\n</p>\n","params":[]},{"textRaw":"Event: 'error'","type":"event","name":"error","params":[],"desc":"<p>Emitted when an error occurs.\n\n</p>\n"}],"methods":[{"textRaw":"dgram.send(buf, offset, length, port, address, [callback])","type":"method","name":"send","signatures":[{"params":[{"textRaw":"`buf` Buffer object. Message to be sent ","name":"buf","desc":"Buffer object. Message to be sent"},{"textRaw":"`offset` Integer. Offset in the buffer where the message starts. ","name":"offset","desc":"Integer. Offset in the buffer where the message starts."},{"textRaw":"`length` Integer. Number of bytes in the message. ","name":"length","desc":"Integer. Number of bytes in the message."},{"textRaw":"`port` Integer. destination port ","name":"port","desc":"Integer. destination port"},{"textRaw":"`address` String. destination IP ","name":"address","desc":"String. destination IP"},{"textRaw":"`callback` Function. Callback when message is done being delivered. Optional. ","name":"callback","desc":"Function. Callback when message is done being delivered. Optional.","optional":true}]},{"params":[{"name":"buf"},{"name":"offset"},{"name":"length"},{"name":"port"},{"name":"address"},{"name":"callback","optional":true}]}],"desc":"<p>For UDP sockets, the destination port and IP address must be specified. A string\nmay be supplied for the <code>address</code> parameter, and it will be resolved with DNS. An\noptional callback may be specified to detect any DNS errors and when <code>buf</code> may be\nre-used. Note that DNS lookups will delay the time that a send takes place, at\nleast until the next tick. The only way to know for sure that a send has taken place\nis to use the callback.\n\n</p>\n<p>If the socket has not been previously bound with a call to <code>bind</code>, it&apos;s\nassigned a random port number and bound to the &quot;all interfaces&quot; address\n(0.0.0.0 for <code>udp4</code> sockets, ::0 for <code>udp6</code> sockets).\n\n</p>\n<p>Example of sending a UDP packet to a random port on <code>localhost</code>;\n\n</p>\n<pre><code>var dgram = require(&apos;dgram&apos;);\nvar message = new Buffer(&quot;Some bytes&quot;);\nvar client = dgram.createSocket(&quot;udp4&quot;);\nclient.send(message, 0, message.length, 41234, &quot;localhost&quot;, function(err, bytes) {\n client.close();\n});</code></pre>\n<p><strong>A Note about UDP datagram size</strong>\n\n</p>\n<p>The maximum size of an <code>IPv4/v6</code> datagram depends on the <code>MTU</code> (<em>Maximum Transmission Unit</em>)\nand on the <code>Payload Length</code> field size.\n\n</p>\n<ul>\n<li><p>The <code>Payload Length</code> field is <code>16 bits</code> wide, which means that a normal payload\ncannot be larger than 64K octets including internet header and data\n(65,507 bytes = 65,535 − 8 bytes UDP header − 20 bytes IP header);\nthis is generally true for loopback interfaces, but such long datagrams\nare impractical for most hosts and networks.</p>\n</li>\n<li><p>The <code>MTU</code> is the largest size a given link layer technology can support for datagrams.\nFor any link, <code>IPv4</code> mandates a minimum <code>MTU</code> of <code>68</code> octets, while the recommended <code>MTU</code>\nfor IPv4 is <code>576</code> (typically recommended as the <code>MTU</code> for dial-up type applications),\nwhether they arrive whole or in fragments.</p>\n<p>For <code>IPv6</code>, the minimum <code>MTU</code> is <code>1280</code> octets, however, the mandatory minimum\nfragment reassembly buffer size is <code>1500</code> octets.\nThe value of <code>68</code> octets is very small, since most current link layer technologies have\na minimum <code>MTU</code> of <code>1500</code> (like Ethernet).</p>\n</li>\n</ul>\n<p>Note that it&apos;s impossible to know in advance the MTU of each link through which\na packet might travel, and that generally sending a datagram greater than\nthe (receiver) <code>MTU</code> won&apos;t work (the packet gets silently dropped, without\ninforming the source that the data did not reach its intended recipient).\n\n</p>\n"},{"textRaw":"dgram.bind(port, [address])","type":"method","name":"bind","signatures":[{"params":[{"textRaw":"`port` Integer ","name":"port","desc":"Integer"},{"textRaw":"`address` String, Optional ","name":"address","optional":true,"desc":"String"}]},{"params":[{"name":"port"},{"name":"address","optional":true}]}],"desc":"<p>For UDP sockets, listen for datagrams on a named <code>port</code> and optional <code>address</code>. If\n<code>address</code> is not specified, the OS will try to listen on all addresses.\n\n</p>\n<p>Example of a UDP server listening on port 41234:\n\n</p>\n<pre><code>var dgram = require(&quot;dgram&quot;);\n\nvar server = dgram.createSocket(&quot;udp4&quot;);\n\nserver.on(&quot;message&quot;, function (msg, rinfo) {\n console.log(&quot;server got: &quot; + msg + &quot; from &quot; +\n rinfo.address + &quot;:&quot; + rinfo.port);\n});\n\nserver.on(&quot;listening&quot;, function () {\n var address = server.address();\n console.log(&quot;server listening &quot; +\n address.address + &quot;:&quot; + address.port);\n});\n\nserver.bind(41234);\n// server listening 0.0.0.0:41234</code></pre>\n"},{"textRaw":"dgram.close()","type":"method","name":"close","desc":"<p>Close the underlying socket and stop listening for data on it.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"dgram.address()","type":"method","name":"address","desc":"<p>Returns an object containing the address information for a socket. For UDP sockets,\nthis object will contain <code>address</code> , <code>family</code> and <code>port</code>.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"dgram.setBroadcast(flag)","type":"method","name":"setBroadcast","signatures":[{"params":[{"textRaw":"`flag` Boolean ","name":"flag","desc":"Boolean"}]},{"params":[{"name":"flag"}]}],"desc":"<p>Sets or clears the <code>SO_BROADCAST</code> socket option. When this option is set, UDP packets\nmay be sent to a local interface&apos;s broadcast address.\n\n</p>\n"},{"textRaw":"dgram.setTTL(ttl)","type":"method","name":"setTTL","signatures":[{"params":[{"textRaw":"`ttl` Integer ","name":"ttl","desc":"Integer"}]},{"params":[{"name":"ttl"}]}],"desc":"<p>Sets the <code>IP_TTL</code> socket option. TTL stands for &quot;Time to Live,&quot; but in this context it\nspecifies the number of IP hops that a packet is allowed to go through. Each router or\ngateway that forwards a packet decrements the TTL. If the TTL is decremented to 0 by a\nrouter, it will not be forwarded. Changing TTL values is typically done for network\nprobes or when multicasting.\n\n</p>\n<p>The argument to <code>setTTL()</code> is a number of hops between 1 and 255. The default on most\nsystems is 64.\n\n</p>\n"},{"textRaw":"dgram.setMulticastTTL(ttl)","type":"method","name":"setMulticastTTL","signatures":[{"params":[{"textRaw":"`ttl` Integer ","name":"ttl","desc":"Integer"}]},{"params":[{"name":"ttl"}]}],"desc":"<p>Sets the <code>IP_MULTICAST_TTL</code> socket option. TTL stands for &quot;Time to Live,&quot; but in this\ncontext it specifies the number of IP hops that a packet is allowed to go through,\nspecifically for multicast traffic. Each router or gateway that forwards a packet\ndecrements the TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.\n\n</p>\n<p>The argument to <code>setMulticastTTL()</code> is a number of hops between 0 and 255. The default on most\nsystems is 1.\n\n</p>\n"},{"textRaw":"dgram.setMulticastLoopback(flag)","type":"method","name":"setMulticastLoopback","signatures":[{"params":[{"textRaw":"`flag` Boolean ","name":"flag","desc":"Boolean"}]},{"params":[{"name":"flag"}]}],"desc":"<p>Sets or clears the <code>IP_MULTICAST_LOOP</code> socket option. When this option is set, multicast\npackets will also be received on the local interface.\n\n</p>\n"},{"textRaw":"dgram.addMembership(multicastAddress, [multicastInterface])","type":"method","name":"addMembership","signatures":[{"params":[{"textRaw":"`multicastAddress` String ","name":"multicastAddress","desc":"String"},{"textRaw":"`multicastInterface` String, Optional ","name":"multicastInterface","optional":true,"desc":"String"}]},{"params":[{"name":"multicastAddress"},{"name":"multicastInterface","optional":true}]}],"desc":"<p>Tells the kernel to join a multicast group with <code>IP_ADD_MEMBERSHIP</code> socket option.\n\n</p>\n<p>If <code>multicastInterface</code> is not specified, the OS will try to add membership to all valid\ninterfaces.\n\n</p>\n"},{"textRaw":"dgram.dropMembership(multicastAddress, [multicastInterface])","type":"method","name":"dropMembership","signatures":[{"params":[{"textRaw":"`multicastAddress` String ","name":"multicastAddress","desc":"String"},{"textRaw":"`multicastInterface` String, Optional ","name":"multicastInterface","optional":true,"desc":"String"}]},{"params":[{"name":"multicastAddress"},{"name":"multicastInterface","optional":true}]}],"desc":"<p>Opposite of <code>addMembership</code> - tells the kernel to leave a multicast group with\n<code>IP_DROP_MEMBERSHIP</code> socket option. This is automatically called by the kernel\nwhen the socket is closed or process terminates, so most apps will never need to call\nthis.\n\n</p>\n<p>If <code>multicastInterface</code> is not specified, the OS will try to drop membership to all valid\ninterfaces.\n</p>\n"}]}],"type":"module","displayName":"dgram"}]}
View
1 public/json/0.8.1/dns.json
@@ -1 +0,0 @@
-{"source":"doc/api/dns.markdown","modules":[{"textRaw":"DNS","name":"dns","stability":3,"stabilityText":"Stable","desc":"<p>Use <code>require(&apos;dns&apos;)</code> to access this module. All methods in the dns module\nuse C-Ares except for <code>dns.lookup</code> which uses <code>getaddrinfo(3)</code> in a thread\npool. C-Ares is much faster than <code>getaddrinfo</code> but the system resolver is\nmore constant with how other programs operate. When a user does\n<code>net.connect(80, &apos;google.com&apos;)</code> or <code>http.get({ host: &apos;google.com&apos; })</code> the\n<code>dns.lookup</code> method is used. Users who need to do a large number of look ups\nquickly should use the methods that go through C-Ares.\n\n</p>\n<p>Here is an example which resolves <code>&apos;www.google.com&apos;</code> then reverse\nresolves the IP addresses which are returned.\n\n</p>\n<pre><code>var dns = require(&apos;dns&apos;);\n\ndns.resolve4(&apos;www.google.com&apos;, function (err, addresses) {\n if (err) throw err;\n\n console.log(&apos;addresses: &apos; + JSON.stringify(addresses));\n\n addresses.forEach(function (a) {\n dns.reverse(a, function (err, domains) {\n if (err) {\n throw err;\n }\n\n console.log(&apos;reverse for &apos; + a + &apos;: &apos; + JSON.stringify(domains));\n });\n });\n});</code></pre>\n","methods":[{"textRaw":"dns.lookup(domain, [family], callback)","type":"method","name":"lookup","desc":"<p>Resolves a domain (e.g. <code>&apos;google.com&apos;</code>) into the first found A (IPv4) or\nAAAA (IPv6) record.\nThe <code>family</code> can be the integer <code>4</code> or <code>6</code>. Defaults to <code>null</code> that indicates\nboth Ip v4 and v6 address family.\n\n</p>\n<p>The callback has arguments <code>(err, address, family)</code>. The <code>address</code> argument\nis a string representation of a IP v4 or v6 address. The <code>family</code> argument\nis either the integer 4 or 6 and denotes the family of <code>address</code> (not\nnecessarily the value initially passed to <code>lookup</code>).\n\n</p>\n<p>On error, <code>err</code> is an <code>Error</code> object, where <code>err.code</code> is the error code.\nKeep in mind that <code>err.code</code> will be set to <code>&apos;ENOENT&apos;</code> not only when\nthe domain does not exist but also when the lookup fails in other ways\nsuch as no available file descriptors.\n\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"family","optional":true},{"name":"callback"}]}]},{"textRaw":"dns.resolve(domain, [rrtype], callback)","type":"method","name":"resolve","desc":"<p>Resolves a domain (e.g. <code>&apos;google.com&apos;</code>) into an array of the record types\nspecified by rrtype. Valid rrtypes are <code>&apos;A&apos;</code> (IPV4 addresses, default),\n<code>&apos;AAAA&apos;</code> (IPV6 addresses), <code>&apos;MX&apos;</code> (mail exchange records), <code>&apos;TXT&apos;</code> (text\nrecords), <code>&apos;SRV&apos;</code> (SRV records), <code>&apos;PTR&apos;</code> (used for reverse IP lookups),\n<code>&apos;NS&apos;</code> (name server records) and <code>&apos;CNAME&apos;</code> (canonical name records).\n\n</p>\n<p>The callback has arguments <code>(err, addresses)</code>. The type of each item\nin <code>addresses</code> is determined by the record type, and described in the\ndocumentation for the corresponding lookup methods below.\n\n</p>\n<p>On error, <code>err</code> is an <code>Error</code> object, where <code>err.code</code> is\none of the error codes listed below.\n\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"rrtype","optional":true},{"name":"callback"}]}]},{"textRaw":"dns.resolve4(domain, callback)","type":"method","name":"resolve4","desc":"<p>The same as <code>dns.resolve()</code>, but only for IPv4 queries (<code>A</code> records).\n<code>addresses</code> is an array of IPv4 addresses (e.g.\n<code>[&apos;74.125.79.104&apos;, &apos;74.125.79.105&apos;, &apos;74.125.79.106&apos;]</code>).\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.resolve6(domain, callback)","type":"method","name":"resolve6","desc":"<p>The same as <code>dns.resolve4()</code> except for IPv6 queries (an <code>AAAA</code> query).\n\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.resolveMx(domain, callback)","type":"method","name":"resolveMx","desc":"<p>The same as <code>dns.resolve()</code>, but only for mail exchange queries (<code>MX</code> records).\n\n</p>\n<p><code>addresses</code> is an array of MX records, each with a priority and an exchange\nattribute (e.g. <code>[{&apos;priority&apos;: 10, &apos;exchange&apos;: &apos;mx.example.com&apos;},...]</code>).\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.resolveTxt(domain, callback)","type":"method","name":"resolveTxt","desc":"<p>The same as <code>dns.resolve()</code>, but only for text queries (<code>TXT</code> records).\n<code>addresses</code> is an array of the text records available for <code>domain</code> (e.g.,\n<code>[&apos;v=spf1 ip4:0.0.0.0 ~all&apos;]</code>).\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.resolveSrv(domain, callback)","type":"method","name":"resolveSrv","desc":"<p>The same as <code>dns.resolve()</code>, but only for service records (<code>SRV</code> records).\n<code>addresses</code> is an array of the SRV records available for <code>domain</code>. Properties\nof SRV records are priority, weight, port, and name (e.g.,\n<code>[{&apos;priority&apos;: 10, {&apos;weight&apos;: 5, &apos;port&apos;: 21223, &apos;name&apos;: &apos;service.example.com&apos;}, ...]</code>).\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.resolveNs(domain, callback)","type":"method","name":"resolveNs","desc":"<p>The same as <code>dns.resolve()</code>, but only for name server records (<code>NS</code> records).\n<code>addresses</code> is an array of the name server records available for <code>domain</code>\n(e.g., <code>[&apos;ns1.example.com&apos;, &apos;ns2.example.com&apos;]</code>).\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.resolveCname(domain, callback)","type":"method","name":"resolveCname","desc":"<p>The same as <code>dns.resolve()</code>, but only for canonical name records (<code>CNAME</code>\nrecords). <code>addresses</code> is an array of the canonical name records available for\n<code>domain</code> (e.g., <code>[&apos;bar.example.com&apos;]</code>).\n\n</p>\n","signatures":[{"params":[{"name":"domain"},{"name":"callback"}]}]},{"textRaw":"dns.reverse(ip, callback)","type":"method","name":"reverse","desc":"<p>Reverse resolves an ip address to an array of domain names.\n\n</p>\n<p>The callback has arguments <code>(err, domains)</code>.\n\n</p>\n<p>On error, <code>err</code> is an <code>Error</code> object, where <code>err.code</code> is\none of the error codes listed below.\n\n</p>\n","signatures":[{"params":[{"name":"ip"},{"name":"callback"}]}]}],"modules":[{"textRaw":"Error codes","name":"error_codes","desc":"<p>Each DNS query can return one of the following error codes:\n\n</p>\n<ul>\n<li><code>dns.NODATA</code>: DNS server returned answer with no data.</li>\n<li><code>dns.FORMERR</code>: DNS server claims query was misformatted.</li>\n<li><code>dns.SERVFAIL</code>: DNS server returned general failure.</li>\n<li><code>dns.NOTFOUND</code>: Domain name not found.</li>\n<li><code>dns.NOTIMP</code>: DNS server does not implement requested operation.</li>\n<li><code>dns.REFUSED</code>: DNS server refused query.</li>\n<li><code>dns.BADQUERY</code>: Misformatted DNS query.</li>\n<li><code>dns.BADNAME</code>: Misformatted domain name.</li>\n<li><code>dns.BADFAMILY</code>: Unsupported address family.</li>\n<li><code>dns.BADRESP</code>: Misformatted DNS reply.</li>\n<li><code>dns.CONNREFUSED</code>: Could not contact DNS servers.</li>\n<li><code>dns.TIMEOUT</code>: Timeout while contacting DNS servers.</li>\n<li><code>dns.EOF</code>: End of file.</li>\n<li><code>dns.FILE</code>: Error reading file.</li>\n<li><code>dns.NOMEM</code>: Out of memory.</li>\n<li><code>dns.DESTRUCTION</code>: Channel is being destroyed.</li>\n<li><code>dns.BADSTR</code>: Misformatted string.</li>\n<li><code>dns.BADFLAGS</code>: Illegal flags specified.</li>\n<li><code>dns.NONAME</code>: Given hostname is not numeric.</li>\n<li><code>dns.BADHINTS</code>: Illegal hints flags specified.</li>\n<li><code>dns.NOTINITIALIZED</code>: c-ares library initialization not yet performed.</li>\n<li><code>dns.LOADIPHLPAPI</code>: Error loading iphlpapi.dll.</li>\n<li><code>dns.ADDRGETNETWORKPARAMS</code>: Could not find GetNetworkParams function.</li>\n<li><code>dns.CANCELLED</code>: DNS query cancelled.</li>\n</ul>\n","type":"module","displayName":"Error codes"}],"type":"module","displayName":"DNS"}]}
View
1 public/json/0.8.1/documentation.json
@@ -1 +0,0 @@
-{"source":"doc/api/documentation.markdown","miscs":[{"textRaw":"About this Documentation","name":"About this Documentation","type":"misc","desc":"<p>The goal of this documentation is to comprehensively explain the Node.js\nAPI, both from a reference as well as a conceptual point of view. Each\nsection describes a built-in module or high-level concept.\n\n</p>\n<p>Where appropriate, property types, method arguments, and the arguments\nprovided to event handlers are detailed in a list underneath the topic\nheading.\n\n</p>\n<p>Every <code>.html</code> document has a corresponding <code>.json</code> document presenting\nthe same information in a structured manner. This feature is\nexperimental, and added for the benefit of IDEs and other utilities that\nwish to do programmatic things with the documentation.\n\n</p>\n<p>Every <code>.html</code> and <code>.json</code> file is generated based on the corresponding\n<code>.markdown</code> file in the <code>doc/api/</code> folder in node&apos;s source tree. The\ndocumentation is generated using the <code>tools/doc/generate.js</code> program.\nThe HTML template is located at <code>doc/template.html</code>.\n\n</p>\n","miscs":[{"textRaw":"Stability Index","name":"Stability Index","type":"misc","desc":"<p>Throughout the documentation, you will see indications of a section&apos;s\nstability. The Node.js API is still somewhat changing, and as it\nmatures, certain parts are more reliable than others. Some are so\nproven, and so relied upon, that they are unlikely to ever change at\nall. Others are brand new and experimental, or known to be hazardous\nand in the process of being redesigned.\n\n</p>\n<p>The notices look like this:\n\n</p>\n<pre><code>Stability: 1 Experimental</code></pre>\n<p>The stability indices are as follows:\n\n</p>\n<ul>\n<li><strong>0 - Deprecated</strong> This feature is known to be problematic, and changes are\nplanned. Do not rely on it. Use of the feature may cause warnings. Backwards\ncompatibility should not be expected.</li>\n</ul>\n<ul>\n<li><strong>1 - Experimental</strong> This feature was introduced recently, and may change\nor be removed in future versions. Please try it out and provide feedback.\nIf it addresses a use-case that is important to you, tell the node core team.</li>\n</ul>\n<ul>\n<li><strong>2 - Unstable</strong> The API is in the process of settling, but has not yet had\nsufficient real-world testing to be considered stable. Backwards-compatibility\nwill be maintained if reasonable.</li>\n</ul>\n<ul>\n<li><strong>3 - Stable</strong> The API has proven satisfactory, but cleanup in the underlying\ncode may cause minor changes. Backwards-compatibility is guaranteed.</li>\n</ul>\n<ul>\n<li><strong>4 - API Frozen</strong> This API has been tested extensively in production and is\nunlikely to ever have to change.</li>\n</ul>\n<ul>\n<li><strong>5 - Locked</strong> Unless serious bugs are found, this code will not ever\nchange. Please do not suggest changes in this area; they will be refused.</li>\n</ul>\n"},{"textRaw":"JSON Output","name":"json_output","stability":1,"stabilityText":"Experimental","desc":"<p>Every HTML file in the markdown has a corresponding JSON file with the\nsame data.\n\n</p>\n<p>This feature is new as of node v0.6.12. It is experimental.\n</p>\n","type":"misc","displayName":"JSON Output"}]}]}
View
1 public/json/0.8.1/events.json
@@ -1 +0,0 @@
-{"source":"doc/api/events.markdown","modules":[{"textRaw":"Events","name":"Events","stability":4,"stabilityText":"API Frozen","type":"module","desc":"<p>Many objects in Node emit events: a <code>net.Server</code> emits an event each time\na peer connects to it, a <code>fs.readStream</code> emits an event when the file is\nopened. All objects which emit events are instances of <code>events.EventEmitter</code>.\nYou can access this module by doing: <code>require(&quot;events&quot;);</code>\n\n</p>\n<p>Typically, event names are represented by a camel-cased string, however,\nthere aren&apos;t any strict restrictions on that, as any string will be accepted.\n\n</p>\n<p>Functions can then be attached to objects, to be executed when an event\nis emitted. These functions are called <em>listeners</em>.\n\n\n</p>\n","classes":[{"textRaw":"Class: events.EventEmitter","type":"class","name":"events.EventEmitter","desc":"<p>To access the EventEmitter class, <code>require(&apos;events&apos;).EventEmitter</code>.\n\n</p>\n<p>When an <code>EventEmitter</code> instance experiences an error, the typical action is\nto emit an <code>&apos;error&apos;</code> event. Error events are treated as a special case in node.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\n</p>\n<p>All EventEmitters emit the event <code>&apos;newListener&apos;</code> when new listeners are\nadded.\n\n</p>\n","methods":[{"textRaw":"emitter.addListener(event, listener)","type":"method","name":"addListener","desc":"<p>Adds a listener to the end of the listeners array for the specified event.\n\n</p>\n<pre><code>server.on(&apos;connection&apos;, function (stream) {\n console.log(&apos;someone connected!&apos;);\n});</code></pre>\n","signatures":[{"params":[{"name":"event"},{"name":"listener"}]},{"params":[{"name":"event"},{"name":"listener"}]}]},{"textRaw":"emitter.on(event, listener)","type":"method","name":"on","desc":"<p>Adds a listener to the end of the listeners array for the specified event.\n\n</p>\n<pre><code>server.on(&apos;connection&apos;, function (stream) {\n console.log(&apos;someone connected!&apos;);\n});</code></pre>\n","signatures":[{"params":[{"name":"event"},{"name":"listener"}]}]},{"textRaw":"emitter.once(event, listener)","type":"method","name":"once","desc":"<p>Adds a <strong>one time</strong> listener for the event. This listener is\ninvoked only the next time the event is fired, after which\nit is removed.\n\n</p>\n<pre><code>server.once(&apos;connection&apos;, function (stream) {\n console.log(&apos;Ah, we have our first user!&apos;);\n});</code></pre>\n","signatures":[{"params":[{"name":"event"},{"name":"listener"}]}]},{"textRaw":"emitter.removeListener(event, listener)","type":"method","name":"removeListener","desc":"<p>Remove a listener from the listener array for the specified event.\n<strong>Caution</strong>: changes array indices in the listener array behind the listener.\n\n</p>\n<pre><code>var callback = function(stream) {\n console.log(&apos;someone connected!&apos;);\n};\nserver.on(&apos;connection&apos;, callback);\n// ...\nserver.removeListener(&apos;connection&apos;, callback);</code></pre>\n","signatures":[{"params":[{"name":"event"},{"name":"listener"}]}]},{"textRaw":"emitter.removeAllListeners([event])","type":"method","name":"removeAllListeners","desc":"<p>Removes all listeners, or those of the specified event.\n\n</p>\n<p>Note that this will <strong>invalidate</strong> any arrays that have previously been\nreturned by <code>emitter.listeners(event)</code>.\n\n\n</p>\n","signatures":[{"params":[{"name":"event","optional":true}]}]},{"textRaw":"emitter.setMaxListeners(n)","type":"method","name":"setMaxListeners","desc":"<p>By default EventEmitters will print a warning if more than 10 listeners are\nadded for a particular event. This is a useful default which helps finding memory leaks.\nObviously not all Emitters should be limited to 10. This function allows\nthat to be increased. Set to zero for unlimited.\n\n\n</p>\n","signatures":[{"params":[{"name":"n"}]}]},{"textRaw":"emitter.listeners(event)","type":"method","name":"listeners","desc":"<p>Returns an array of listeners for the specified event.\n\n</p>\n<pre><code>server.on(&apos;connection&apos;, function (stream) {\n console.log(&apos;someone connected!&apos;);\n});\nconsole.log(util.inspect(server.listeners(&apos;connection&apos;))); // [ [Function] ]</code></pre>\n<p>This array <strong>may</strong> be a mutable reference to the same underlying list of\nlisteners that is used by the event subsystem. However, certain\nactions (specifically, removeAllListeners) will invalidate this\nreference.\n\n</p>\n<p>If you would like to get a copy of the listeners at a specific point in\ntime that is guaranteed not to change, make a copy, for example by doing\n<code>emitter.listeners(event).slice(0)</code>.\n\n</p>\n<p>In a future release of node, this behavior <strong>may</strong> change to always\nreturn a copy, for consistency. In your programs, please do not rely on\nbeing able to modify the EventEmitter listeners using array methods.\nAlways use the &apos;on&apos; method to add new listeners.\n\n</p>\n","signatures":[{"params":[{"name":"event"}]}]},{"textRaw":"emitter.emit(event, [arg1], [arg2], [...])","type":"method","name":"emit","desc":"<p>Execute each of the listeners in order with the supplied arguments.\n\n</p>\n","signatures":[{"params":[{"name":"event"},{"name":"arg1","optional":true},{"name":"arg2","optional":true},{"name":"...","optional":true}]}]}],"events":[{"textRaw":"Event: 'newListener'","type":"event","name":"newListener","params":[],"desc":"<p>This event is emitted any time someone adds a new listener.\n</p>\n"}]}]}]}
View
1 public/json/0.8.1/fs.json
@@ -1 +0,0 @@
-{"source":"doc/api/fs.markdown","modules":[{"textRaw":"File System","name":"fs","stability":3,"stabilityText":"Stable","desc":"<p>File I/O is provided by simple wrappers around standard POSIX functions. To\nuse this module do <code>require(&apos;fs&apos;)</code>. All the methods have asynchronous and\nsynchronous forms.\n\n</p>\n<p>The 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 <code>null</code> or <code>undefined</code>.\n\n</p>\n<p>When using the synchronous form any exceptions are immediately thrown.\nYou can use try/catch to handle exceptions or allow them to bubble up.\n\n</p>\n<p>Here is an example of the asynchronous version:\n\n</p>\n<pre><code>var fs = require(&apos;fs&apos;);\n\nfs.unlink(&apos;/tmp/hello&apos;, function (err) {\n if (err) throw err;\n console.log(&apos;successfully deleted /tmp/hello&apos;);\n});</code></pre>\n<p>Here is the synchronous version:\n\n</p>\n<pre><code>var fs = require(&apos;fs&apos;);\n\nfs.unlinkSync(&apos;/tmp/hello&apos;)\nconsole.log(&apos;successfully deleted /tmp/hello&apos;);</code></pre>\n<p>With the asynchronous methods there is no guaranteed ordering. So the\nfollowing is prone to error:\n\n</p>\n<pre><code>fs.rename(&apos;/tmp/hello&apos;, &apos;/tmp/world&apos;, function (err) {\n if (err) throw err;\n console.log(&apos;renamed complete&apos;);\n});\nfs.stat(&apos;/tmp/world&apos;, function (err, stats) {\n if (err) throw err;\n console.log(&apos;stats: &apos; + JSON.stringify(stats));\n});</code></pre>\n<p>It could be that <code>fs.stat</code> is executed before <code>fs.rename</code>.\nThe correct way to do this is to chain the callbacks.\n\n</p>\n<pre><code>fs.rename(&apos;/tmp/hello&apos;, &apos;/tmp/world&apos;, function (err) {\n if (err) throw err;\n fs.stat(&apos;/tmp/world&apos;, function (err, stats) {\n if (err) throw err;\n console.log(&apos;stats: &apos; + JSON.stringify(stats));\n });\n});</code></pre>\n<p>In busy processes, the programmer is <em>strongly encouraged</em> to use the\nasynchronous versions of these calls. The synchronous versions will block\nthe entire process until they complete--halting all connections.\n\n</p>\n<p>Relative path to filename can be used, remember however that this path will be relative\nto <code>process.cwd()</code>.\n\n</p>\n","methods":[{"textRaw":"fs.rename(oldPath, newPath, [callback])","type":"method","name":"rename","desc":"<p>Asynchronous rename(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"oldPath"},{"name":"newPath"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.renameSync(oldPath, newPath)","type":"method","name":"renameSync","desc":"<p>Synchronous rename(2).\n\n</p>\n","signatures":[{"params":[{"name":"oldPath"},{"name":"newPath"}]}]},{"textRaw":"fs.truncate(fd, len, [callback])","type":"method","name":"truncate","desc":"<p>Asynchronous ftruncate(2). No arguments other than a possible exception are\ngiven to the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"len"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.truncateSync(fd, len)","type":"method","name":"truncateSync","desc":"<p>Synchronous ftruncate(2).\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"len"}]}]},{"textRaw":"fs.chown(path, uid, gid, [callback])","type":"method","name":"chown","desc":"<p>Asynchronous chown(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"uid"},{"name":"gid"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.chownSync(path, uid, gid)","type":"method","name":"chownSync","desc":"<p>Synchronous chown(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"uid"},{"name":"gid"}]}]},{"textRaw":"fs.fchown(fd, uid, gid, [callback])","type":"method","name":"fchown","desc":"<p>Asynchronous fchown(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"uid"},{"name":"gid"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.fchownSync(fd, uid, gid)","type":"method","name":"fchownSync","desc":"<p>Synchronous fchown(2).\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"uid"},{"name":"gid"}]}]},{"textRaw":"fs.lchown(path, uid, gid, [callback])","type":"method","name":"lchown","desc":"<p>Asynchronous lchown(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"uid"},{"name":"gid"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.lchownSync(path, uid, gid)","type":"method","name":"lchownSync","desc":"<p>Synchronous lchown(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"uid"},{"name":"gid"}]}]},{"textRaw":"fs.chmod(path, mode, [callback])","type":"method","name":"chmod","desc":"<p>Asynchronous chmod(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"mode"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.chmodSync(path, mode)","type":"method","name":"chmodSync","desc":"<p>Synchronous chmod(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"mode"}]}]},{"textRaw":"fs.fchmod(fd, mode, [callback])","type":"method","name":"fchmod","desc":"<p>Asynchronous fchmod(2). No arguments other than a possible exception\nare given to the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"mode"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.fchmodSync(fd, mode)","type":"method","name":"fchmodSync","desc":"<p>Synchronous fchmod(2).\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"mode"}]}]},{"textRaw":"fs.lchmod(path, mode, [callback])","type":"method","name":"lchmod","desc":"<p>Asynchronous lchmod(2). No arguments other than a possible exception\nare given to the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"mode"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.lchmodSync(path, mode)","type":"method","name":"lchmodSync","desc":"<p>Synchronous lchmod(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"mode"}]}]},{"textRaw":"fs.stat(path, [callback])","type":"method","name":"stat","desc":"<p>Asynchronous stat(2). The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is a <a href=\"#fs_class_fs_stats\">fs.Stats</a> object. See the <a href=\"#fs_class_fs_stats\">fs.Stats</a>\nsection below for more information.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.lstat(path, [callback])","type":"method","name":"lstat","desc":"<p>Asynchronous lstat(2). The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is a <code>fs.Stats</code> object. <code>lstat()</code> is identical to <code>stat()</code>, except that if\n<code>path</code> is a symbolic link, then the link itself is stat-ed, not the file that it\nrefers to.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.fstat(fd, [callback])","type":"method","name":"fstat","desc":"<p>Asynchronous fstat(2). The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is a <code>fs.Stats</code> object. <code>fstat()</code> is identical to <code>stat()</code>, except that\nthe file to be stat-ed is specified by the file descriptor <code>fd</code>.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.statSync(path)","type":"method","name":"statSync","desc":"<p>Synchronous stat(2). Returns an instance of <code>fs.Stats</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.lstatSync(path)","type":"method","name":"lstatSync","desc":"<p>Synchronous lstat(2). Returns an instance of <code>fs.Stats</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.fstatSync(fd)","type":"method","name":"fstatSync","desc":"<p>Synchronous fstat(2). Returns an instance of <code>fs.Stats</code>.\n\n</p>\n","signatures":[{"params":[{"name":"fd"}]}]},{"textRaw":"fs.link(srcpath, dstpath, [callback])","type":"method","name":"link","desc":"<p>Asynchronous link(2). No arguments other than a possible exception are given to\nthe completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"srcpath"},{"name":"dstpath"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.linkSync(srcpath, dstpath)","type":"method","name":"linkSync","desc":"<p>Synchronous link(2).\n\n</p>\n","signatures":[{"params":[{"name":"srcpath"},{"name":"dstpath"}]}]},{"textRaw":"fs.symlink(destination, path, [type], [callback])","type":"method","name":"symlink","desc":"<p>Asynchronous symlink(2). No arguments other than a possible exception are given\nto the completion callback.\n<code>type</code> argument can be either <code>&apos;dir&apos;</code>, <code>&apos;file&apos;</code>, or <code>&apos;junction&apos;</code> (default is <code>&apos;file&apos;</code>). It is only \nused on Windows (ignored on other platforms).\nNote that Windows junction points require the destination path to be absolute. When using\n<code>&apos;junction&apos;</code>, the <code>destination</code> argument will automatically be normalized to absolute path.\n\n</p>\n","signatures":[{"params":[{"name":"destination"},{"name":"path"},{"name":"type","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"fs.symlinkSync(destination, path, [type])","type":"method","name":"symlinkSync","desc":"<p>Synchronous symlink(2).\n\n</p>\n","signatures":[{"params":[{"name":"destination"},{"name":"path"},{"name":"type","optional":true}]}]},{"textRaw":"fs.readlink(path, [callback])","type":"method","name":"readlink","desc":"<p>Asynchronous readlink(2). The callback gets two arguments <code>(err,\nlinkString)</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.readlinkSync(path)","type":"method","name":"readlinkSync","desc":"<p>Synchronous readlink(2). Returns the symbolic link&apos;s string value.\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.realpath(path, [cache], callback)","type":"method","name":"realpath","desc":"<p>Asynchronous realpath(2). The <code>callback</code> gets two arguments <code>(err,\nresolvedPath)</code>. May use <code>process.cwd</code> to resolve relative paths. <code>cache</code> is an\nobject literal of mapped paths that can be used to force a specific path\nresolution or avoid additional <code>fs.stat</code> calls for known real paths.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var cache = {&apos;/etc&apos;:&apos;/private/etc&apos;};\nfs.realpath(&apos;/etc/passwd&apos;, cache, function (err, resolvedPath) {\n if (err) throw err;\n console.log(resolvedPath);\n});</code></pre>\n","signatures":[{"params":[{"name":"path"},{"name":"cache","optional":true},{"name":"callback"}]}]},{"textRaw":"fs.realpathSync(path, [cache])","type":"method","name":"realpathSync","desc":"<p>Synchronous realpath(2). Returns the resolved path.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"cache","optional":true}]}]},{"textRaw":"fs.unlink(path, [callback])","type":"method","name":"unlink","desc":"<p>Asynchronous unlink(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.unlinkSync(path)","type":"method","name":"unlinkSync","desc":"<p>Synchronous unlink(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.rmdir(path, [callback])","type":"method","name":"rmdir","desc":"<p>Asynchronous rmdir(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.rmdirSync(path)","type":"method","name":"rmdirSync","desc":"<p>Synchronous rmdir(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.mkdir(path, [mode], [callback])","type":"method","name":"mkdir","desc":"<p>Asynchronous mkdir(2). No arguments other than a possible exception are given\nto the completion callback. <code>mode</code> defaults to <code>0777</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"mode","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"fs.mkdirSync(path, [mode])","type":"method","name":"mkdirSync","desc":"<p>Synchronous mkdir(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"mode","optional":true}]}]},{"textRaw":"fs.readdir(path, [callback])","type":"method","name":"readdir","desc":"<p>Asynchronous readdir(3). Reads the contents of a directory.\nThe callback gets two arguments <code>(err, files)</code> where <code>files</code> is an array of\nthe names of the files in the directory excluding <code>&apos;.&apos;</code> and <code>&apos;..&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.readdirSync(path)","type":"method","name":"readdirSync","desc":"<p>Synchronous readdir(3). Returns an array of filenames excluding <code>&apos;.&apos;</code> and\n<code>&apos;..&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.close(fd, [callback])","type":"method","name":"close","desc":"<p>Asynchronous close(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.closeSync(fd)","type":"method","name":"closeSync","desc":"<p>Synchronous close(2).\n\n</p>\n","signatures":[{"params":[{"name":"fd"}]}]},{"textRaw":"fs.open(path, flags, [mode], [callback])","type":"method","name":"open","desc":"<p>Asynchronous file open. See open(2). <code>flags</code> can be:\n\n</p>\n<ul>\n<li><p><code>&apos;r&apos;</code> - Open file for reading.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li><p><code>&apos;r+&apos;</code> - Open file for reading and writing.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li><p><code>&apos;rs&apos;</code> - Open file for reading in synchronous mode. Instructs the operating\nsystem to bypass the local file system cache.</p>\n<p>This is primarily useful for opening files on NFS mounts as it allows you to\nskip the potentially stale local cache. It has a very real impact on I/O\nperformance so don&apos;t use this mode unless you need it.</p>\n<p>Note that this doesn&apos;t turn <code>fs.open()</code> into a synchronous blocking call.\nIf that&apos;s what you want then you should be using <code>fs.openSync()</code></p>\n</li>\n<li><p><code>&apos;rs+&apos;</code> - Open file for reading and writing, telling the OS to open it\nsynchronously. See notes for <code>&apos;rs&apos;</code> about using this with caution.</p>\n</li>\n<li><p><code>&apos;w&apos;</code> - Open file for writing.\nThe file is created (if it does not exist) or truncated (if it exists).</p>\n</li>\n<li><p><code>&apos;wx&apos;</code> - Like <code>&apos;w&apos;</code> but opens the file in exclusive mode.</p>\n</li>\n<li><p><code>&apos;w+&apos;</code> - Open file for reading and writing.\nThe file is created (if it does not exist) or truncated (if it exists).</p>\n</li>\n<li><p><code>&apos;wx+&apos;</code> - Like <code>&apos;w+&apos;</code> but opens the file in exclusive mode.</p>\n</li>\n<li><p><code>&apos;a&apos;</code> - Open file for appending.\nThe file is created if it does not exist.</p>\n</li>\n<li><p><code>&apos;ax&apos;</code> - Like <code>&apos;a&apos;</code> but opens the file in exclusive mode.</p>\n</li>\n<li><p><code>&apos;a+&apos;</code> - Open file for reading and appending.\nThe file is created if it does not exist.</p>\n</li>\n<li><p><code>&apos;ax+&apos;</code> - Like <code>&apos;a+&apos;</code> but opens the file in exclusive mode.</p>\n</li>\n</ul>\n<p><code>mode</code> defaults to <code>0666</code>. The callback gets two arguments <code>(err, fd)</code>.\n\n</p>\n<p>Exclusive mode (<code>O_EXCL</code>) ensures that <code>path</code> is newly created. <code>fs.open()</code>\nfails if a file by that name already exists. On POSIX systems, symlinks are\nnot followed. Exclusive mode may or may not work with network file systems.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"flags"},{"name":"mode","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"fs.openSync(path, flags, [mode])","type":"method","name":"openSync","desc":"<p>Synchronous open(2).\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"flags"},{"name":"mode","optional":true}]}]},{"textRaw":"fs.utimes(path, atime, mtime, [callback])","type":"method","name":"utimes","desc":"<p>Change file timestamps of the file referenced by the supplied path.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"atime"},{"name":"mtime"}]},{"params":[{"name":"path"},{"name":"atime"},{"name":"mtime"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.utimesSync(path, atime, mtime)","type":"method","name":"utimesSync","desc":"<p>Change file timestamps of the file referenced by the supplied path.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"atime"},{"name":"mtime"}]}]},{"textRaw":"fs.futimes(fd, atime, mtime, [callback])","type":"method","name":"futimes","desc":"<p>Change the file timestamps of a file referenced by the supplied file\ndescriptor.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"atime"},{"name":"mtime"}]},{"params":[{"name":"fd"},{"name":"atime"},{"name":"mtime"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.futimesSync(fd, atime, mtime)","type":"method","name":"futimesSync","desc":"<p>Change the file timestamps of a file referenced by the supplied file\ndescriptor.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"atime"},{"name":"mtime"}]}]},{"textRaw":"fs.fsync(fd, [callback])","type":"method","name":"fsync","desc":"<p>Asynchronous fsync(2). No arguments other than a possible exception are given\nto the completion callback.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.fsyncSync(fd)","type":"method","name":"fsyncSync","desc":"<p>Synchronous fsync(2).\n\n</p>\n","signatures":[{"params":[{"name":"fd"}]}]},{"textRaw":"fs.write(fd, buffer, offset, length, position, [callback])","type":"method","name":"write","desc":"<p>Write <code>buffer</code> to the file specified by <code>fd</code>.\n\n</p>\n<p><code>offset</code> and <code>length</code> determine the part of the buffer to be written.\n\n</p>\n<p><code>position</code> refers to the offset from the beginning of the file where this data\nshould be written. If <code>position</code> is <code>null</code>, the data will be written at the\ncurrent position.\nSee pwrite(2).\n\n</p>\n<p>The callback will be given three arguments <code>(err, written, buffer)</code> where <code>written</code>\nspecifies how many <em>bytes</em> were written from <code>buffer</code>.\n\n</p>\n<p>Note that it is unsafe to use <code>fs.write</code> multiple times on the same file\nwithout waiting for the callback. For this scenario,\n<code>fs.createWriteStream</code> is strongly recommended.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"buffer"},{"name":"offset"},{"name":"length"},{"name":"position"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.writeSync(fd, buffer, offset, length, position)","type":"method","name":"writeSync","desc":"<p>Synchronous version of <code>fs.write()</code>. Returns the number of bytes written.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"buffer"},{"name":"offset"},{"name":"length"},{"name":"position"}]}]},{"textRaw":"fs.read(fd, buffer, offset, length, position, [callback])","type":"method","name":"read","desc":"<p>Read data from the file specified by <code>fd</code>.\n\n</p>\n<p><code>buffer</code> is the buffer that the data will be written to.\n\n</p>\n<p><code>offset</code> is offset within the buffer where writing will start.\n\n</p>\n<p><code>length</code> is an integer specifying the number of bytes to read.\n\n</p>\n<p><code>position</code> is an integer specifying where to begin reading from in the file.\nIf <code>position</code> is <code>null</code>, data will be read from the current file position.\n\n</p>\n<p>The callback is given the three arguments, <code>(err, bytesRead, buffer)</code>.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"buffer"},{"name":"offset"},{"name":"length"},{"name":"position"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.readSync(fd, buffer, offset, length, position)","type":"method","name":"readSync","desc":"<p>Synchronous version of <code>fs.read</code>. Returns the number of <code>bytesRead</code>.\n\n</p>\n","signatures":[{"params":[{"name":"fd"},{"name":"buffer"},{"name":"offset"},{"name":"length"},{"name":"position"}]}]},{"textRaw":"fs.readFile(filename, [encoding], [callback])","type":"method","name":"readFile","desc":"<p>Asynchronously reads the entire contents of a file. Example:\n\n</p>\n<pre><code>fs.readFile(&apos;/etc/passwd&apos;, function (err, data) {\n if (err) throw err;\n console.log(data);\n});</code></pre>\n<p>The callback is passed two arguments <code>(err, data)</code>, where <code>data</code> is the\ncontents of the file.\n\n</p>\n<p>If no encoding is specified, then the raw buffer is returned.\n\n\n</p>\n","signatures":[{"params":[{"name":"filename"},{"name":"encoding","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"fs.readFileSync(filename, [encoding])","type":"method","name":"readFileSync","desc":"<p>Synchronous version of <code>fs.readFile</code>. Returns the contents of the <code>filename</code>.\n\n</p>\n<p>If <code>encoding</code> is specified then this function returns a string. Otherwise it\nreturns a buffer.\n\n\n</p>\n","signatures":[{"params":[{"name":"filename"},{"name":"encoding","optional":true}]}]},{"textRaw":"fs.writeFile(filename, data, [encoding], [callback])","type":"method","name":"writeFile","desc":"<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string or a buffer. The <code>encoding</code> argument is ignored if\n<code>data</code> is a buffer. It defaults to <code>&apos;utf8&apos;</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>fs.writeFile(&apos;message.txt&apos;, &apos;Hello Node&apos;, function (err) {\n if (err) throw err;\n console.log(&apos;It\\&apos;s saved!&apos;);\n});</code></pre>\n","signatures":[{"params":[{"name":"filename"},{"name":"data"},{"name":"encoding","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"fs.writeFileSync(filename, data, [encoding])","type":"method","name":"writeFileSync","desc":"<p>The synchronous version of <code>fs.writeFile</code>.\n\n</p>\n","signatures":[{"params":[{"name":"filename"},{"name":"data"},{"name":"encoding","optional":true}]}]},{"textRaw":"fs.appendFile(filename, data, encoding='utf8', [callback])","type":"method","name":"appendFile","desc":"<p>Asynchronously append data to a file, creating the file if it not yet exists.\n<code>data</code> can be a string or a buffer. The <code>encoding</code> argument is ignored if\n<code>data</code> is a buffer.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>fs.appendFile(&apos;message.txt&apos;, &apos;data to append&apos;, function (err) {\n if (err) throw err;\n console.log(&apos;The &quot;data to append&quot; was appended to file!&apos;);\n});</code></pre>\n","signatures":[{"params":[{"name":"filename"},{"name":"data"},{"name":"encoding","default":"'utf8'"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.appendFileSync(filename, data, encoding='utf8')","type":"method","name":"appendFileSync","desc":"<p>The synchronous version of <code>fs.appendFile</code>.\n\n</p>\n","signatures":[{"params":[{"name":"filename"},{"name":"data"},{"name":"encoding","default":"'utf8'"}]}]},{"textRaw":"fs.watchFile(filename, [options], listener)","type":"method","name":"watchFile","stability":2,"stabilityText":"Unstable. Use fs.watch instead, if available.","desc":"<p>Watch for changes on <code>filename</code>. The callback <code>listener</code> will be called each\ntime the file is accessed.\n\n</p>\n<p>The second argument is optional. The <code>options</code> if provided should be an object\ncontaining two members a boolean, <code>persistent</code>, and <code>interval</code>. <code>persistent</code>\nindicates whether the process should continue to run as long as files are\nbeing watched. <code>interval</code> indicates how often the target should be polled,\nin milliseconds. The default is <code>{ persistent: true, interval: 5007 }</code>.\n\n</p>\n<p>The <code>listener</code> gets two arguments the current stat object and the previous\nstat object:\n\n</p>\n<pre><code>fs.watchFile(&apos;message.text&apos;, function (curr, prev) {\n console.log(&apos;the current mtime is: &apos; + curr.mtime);\n console.log(&apos;the previous mtime was: &apos; + prev.mtime);\n});</code></pre>\n<p>These stat objects are instances of <code>fs.Stat</code>.\n\n</p>\n<p>If you want to be notified when the file was modified, not just accessed\nyou need to compare <code>curr.mtime</code> and <code>prev.mtime</code>.\n\n\n</p>\n","signatures":[{"params":[{"name":"filename"},{"name":"options","optional":true},{"name":"listener"}]}]},{"textRaw":"fs.unwatchFile(filename)","type":"method","name":"unwatchFile","stability":2,"stabilityText":"Unstable. Use fs.watch instead, if available.","desc":"<p>Stop watching for changes on <code>filename</code>.\n\n</p>\n","signatures":[{"params":[{"name":"filename"}]}]},{"textRaw":"fs.watch(filename, [options], [listener])","type":"method","name":"watch","stability":2,"stabilityText":"Unstable. Not available on all platforms.","desc":"<p>Watch for changes on <code>filename</code>, where <code>filename</code> is either a file or a\ndirectory. The returned object is a <a href=\"#fs_class_fs_fswatcher\">fs.FSWatcher</a>.\n\n</p>\n<p>The second argument is optional. The <code>options</code> if provided should be an object\ncontaining a boolean member <code>persistent</code>, which indicates whether the process\nshould continue to run as long as files are being watched. The default is\n<code>{ persistent: true }</code>.\n\n</p>\n<p>The listener callback gets two arguments <code>(event, filename)</code>. <code>event</code> is either\n&apos;rename&apos; or &apos;change&apos;, and <code>filename</code> is the name of the file which triggered\nthe event.\n\n</p>\n","miscs":[{"textRaw":"Caveats","name":"Caveats","type":"misc","desc":"<p>The <code>fs.watch</code> API is not 100% consistent across platforms, and is\nunavailable in some situations.\n\n</p>\n","miscs":[{"textRaw":"Availability","name":"Availability","type":"misc","desc":"<p>This feature depends on the underlying operating system providing a way\nto be notified of filesystem changes.\n\n</p>\n<ul>\n<li>On Linux systems, this uses <code>inotify</code>.</li>\n<li>On BSD systems (including OS X), this uses <code>kqueue</code>.</li>\n<li>On SunOS systems (including Solaris and SmartOS), this uses <code>event ports</code>.</li>\n<li>On Windows systems, this feature depends on <code>ReadDirectoryChangesW</code>.</li>\n</ul>\n<p>If the underlying functionality is not available for some reason, then\n<code>fs.watch</code> will not be able to function. You can still use\n<code>fs.watchFile</code>, which uses stat polling, but it is slower and less\nreliable.\n\n</p>\n"},{"textRaw":"Filename Argument","name":"Filename Argument","type":"misc","desc":"<p>Providing <code>filename</code> argument in the callback is not supported\non every platform (currently it&apos;s only supported on Linux and Windows). Even\non supported platforms <code>filename</code> is not always guaranteed to be provided.\nTherefore, don&apos;t assume that <code>filename</code> argument is always provided in the\ncallback, and have some fallback logic if it is null.\n\n</p>\n<pre><code>fs.watch(&apos;somedir&apos;, function (event, filename) {\n console.log(&apos;event is: &apos; + event);\n if (filename) {\n console.log(&apos;filename provided: &apos; + filename);\n } else {\n console.log(&apos;filename not provided&apos;);\n }\n});</code></pre>\n"}]}],"signatures":[{"params":[{"name":"filename"},{"name":"options","optional":true},{"name":"listener","optional":true}]}]},{"textRaw":"fs.exists(path, [callback])","type":"method","name":"exists","desc":"<p>Test whether or not the given path exists by checking with the file system.\nThen call the <code>callback</code> argument with either true or false. Example:\n\n</p>\n<pre><code>fs.exists(&apos;/etc/passwd&apos;, function (exists) {\n util.debug(exists ? &quot;it&apos;s there&quot; : &quot;no passwd!&quot;);\n});</code></pre>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"fs.existsSync(path)","type":"method","name":"existsSync","desc":"<p>Synchronous version of <code>fs.exists</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"}]}]},{"textRaw":"fs.createReadStream(path, [options])","type":"method","name":"createReadStream","desc":"<p>Returns a new ReadStream object (See <code>Readable Stream</code>).\n\n</p>\n<p><code>options</code> is an object with the following defaults:\n\n</p>\n<pre><code>{ flags: &apos;r&apos;,\n encoding: null,\n fd: null,\n mode: 0666,\n bufferSize: 64 * 1024\n}</code></pre>\n<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart at 0. The <code>encoding</code> can be <code>&apos;utf8&apos;</code>, <code>&apos;ascii&apos;</code>, or <code>&apos;base64&apos;</code>.\n\n</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:\n\n</p>\n<pre><code>fs.createReadStream(&apos;sample.txt&apos;, {start: 90, end: 99});</code></pre>\n","signatures":[{"params":[{"name":"path"},{"name":"options","optional":true}]}]},{"textRaw":"fs.createWriteStream(path, [options])","type":"method","name":"createWriteStream","desc":"<p>Returns a new WriteStream object (See <code>Writable Stream</code>).\n\n</p>\n<p><code>options</code> is an object with the following defaults:\n\n</p>\n<pre><code>{ flags: &apos;w&apos;,\n encoding: null,\n mode: 0666 }</code></pre>\n<p><code>options</code> may also include a <code>start</code> option to allow writing data at\nsome position past the beginning of the file. Modifying a file rather\nthan replacing it may require a <code>flags</code> mode of <code>r+</code> rather than the\ndefault mode <code>w</code>.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"options","optional":true}]}]}],"classes":[{"textRaw":"Class: fs.Stats","type":"class","name":"fs.Stats","desc":"<p>Objects returned from <code>fs.stat()</code>, <code>fs.lstat()</code> and <code>fs.fstat()</code> and their\nsynchronous counterparts are of this type.\n\n</p>\n<ul>\n<li><code>stats.isFile()</code></li>\n<li><code>stats.isDirectory()</code></li>\n<li><code>stats.isBlockDevice()</code></li>\n<li><code>stats.isCharacterDevice()</code></li>\n<li><code>stats.isSymbolicLink()</code> (only valid with <code>fs.lstat()</code>)</li>\n<li><code>stats.isFIFO()</code></li>\n<li><code>stats.isSocket()</code></li>\n</ul>\n<p>For a regular file <code>util.inspect(stats)</code> would return a string very\nsimilar to this:\n\n</p>\n<pre><code>{ 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 }</code></pre>\n<p>Please note that <code>atime</code>, <code>mtime</code> and <code>ctime</code> are instances\nof [Date][MDN-Date] object and to compare the values of\nthese objects you should use appropriate methods. For most\ngeneral uses [getTime()][MDN-Date-getTime] will return\nthe number of milliseconds elapsed since <em>1 January 1970\n00:00:00 UTC</em> and this integer should be sufficient for\nany comparison, however there additional methods which can\nbe used for displaying fuzzy information. More details can\nbe found in the [MDN JavaScript Reference][MDN-Date] page.\n\n</p>\n"},{"textRaw":"Class: fs.ReadStream","type":"class","name":"fs.ReadStream","desc":"<p><code>ReadStream</code> is a <a href=\"stream.html#stream_readable_stream\">Readable Stream</a>.\n\n</p>\n","events":[{"textRaw":"Event: 'open'","type":"event","name":"open","params":[],"desc":"<p>Emitted when the ReadStream&apos;s file is opened.\n\n\n</p>\n"}]},{"textRaw":"Class: fs.FSWatcher","type":"class","name":"fs.FSWatcher","desc":"<p>Objects returned from <code>fs.watch()</code> are of this type.\n\n</p>\n","methods":[{"textRaw":"watcher.close()","type":"method","name":"close","desc":"<p>Stop watching for changes on the given <code>fs.FSWatcher</code>.\n\n</p>\n","signatures":[{"params":[]}]}],"events":[{"textRaw":"Event: 'change'","type":"event","name":"change","params":[],"desc":"<p>Emitted when something changes in a watched directory or file.\nSee more details in <a href=\"#fs_fs_watch_filename_options_listener\">fs.watch</a>.\n\n</p>\n"},{"textRaw":"Event: 'error'","type":"event","name":"error","params":[],"desc":"<p>Emitted when an error occurs.\n</p>\n"}]}],"properties":[{"textRaw":"fs.WriteStream","name":"WriteStream","desc":"<p><code>WriteStream</code> is a <a href=\"stream.html#stream_writable_stream\">Writable Stream</a>.\n\n</p>\n","events":[{"textRaw":"Event: 'open'","type":"event","name":"open","params":[],"desc":"<p>Emitted when the WriteStream&apos;s file is opened.\n\n</p>\n"}],"properties":[{"textRaw":"file.bytesWritten","name":"bytesWritten","desc":"<p>The number of bytes written so far. Does not include data that is still queued\nfor writing.\n\n</p>\n"}]}],"type":"module","displayName":"fs"}]}
View
1 public/json/0.8.1/globals.json
@@ -1 +0,0 @@
-{"source":"doc/api/globals.markdown","globals":[{"textRaw":"global","name":"global","type":"global","desc":"<p>In browsers, the top-level scope is the global scope. That means that in\nbrowsers if you&apos;re in the global scope <code>var something</code> will define a global\nvariable. In Node this is different. The top-level scope is not the global\nscope; <code>var something</code> inside a Node module will be local to that module.\n\n</p>\n"},{"textRaw":"process","name":"process","type":"global","desc":"<p>The process object. See the [process object][] section.\n\n</p>\n"},{"textRaw":"console","name":"console","type":"global","desc":"<p>Used to print to stdout and stderr. See the [stdio][] section.\n\n</p>\n"},{"textRaw":"Class: Buffer","type":"global","name":"Buffer","desc":"<p>Used to handle binary data. See the [buffer section][]\n\n</p>\n"},{"textRaw":"clearInterval(t)","type":"global","name":"clearInterval","desc":"<p>The timer functions are global variables. See the [timers][] section.\n\n</p>\n"}],"vars":[{"textRaw":"require()","type":"var","name":"require","desc":"<p>To require modules. See the [Modules][] section. <code>require</code> isn&apos;t actually a\nglobal but rather local to each module.\n\n</p>\n","methods":[{"textRaw":"require.resolve()","type":"method","name":"resolve","desc":"<p>Use the internal <code>require()</code> machinery to look up the location of a module,\nbut rather than loading the module, just return the resolved filename.\n\n</p>\n","signatures":[{"params":[]}]}],"properties":[{"textRaw":"`cache` {Object} ","name":"cache","desc":"<p>Modules are cached in this object when they are required. By deleting a key\nvalue from this object, the next <code>require</code> will reload the module.\n\n</p>\n"},{"textRaw":"`extensions` {Array} ","name":"extensions","desc":"<p>Instruct <code>require</code> on how to handle certain file extensions.\n\n</p>\n<p>Process files with the extension <code>.sjs</code> as <code>.js</code>:\n\n</p>\n<pre><code>require.extensions[&apos;.sjs&apos;] = require.extensions[&apos;.js&apos;];</code></pre>\n<p>Write your own extension handler:\n\n</p>\n<pre><code>require.extensions[&apos;.sjs&apos;] = function(module, filename) {\n var content = fs.readFileSync(filename, &apos;utf8&apos;);\n // Parse the file content and give to module.exports\n module.exports = content;\n};</code></pre>\n"}]},{"textRaw":"__filename","name":"__filename","type":"var","desc":"<p>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\nfilename used in the command line. The value inside a module is the path\nto that module file.\n\n</p>\n<p>Example: running <code>node example.js</code> from <code>/Users/mjr</code>\n\n</p>\n<pre><code>console.log(__filename);\n// /Users/mjr/example.js</code></pre>\n<p><code>__filename</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n"},{"textRaw":"__dirname","name":"__dirname","type":"var","desc":"<p>The name of the directory that the currently executing script resides in.\n\n</p>\n<p>Example: running <code>node example.js</code> from <code>/Users/mjr</code>\n\n</p>\n<pre><code>console.log(__dirname);\n// /Users/mjr</code></pre>\n<p><code>__dirname</code> isn&apos;t actually a global but rather local to each module.\n\n\n</p>\n"},{"textRaw":"module","name":"module","type":"var","desc":"<p>A reference to the current module. In particular\n<code>module.exports</code> is the same as the <code>exports</code> object.\n<code>module</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n<p>See the [module system documentation][] for more information.\n\n</p>\n"},{"textRaw":"exports","name":"exports","type":"var","desc":"<p>An object which is shared between all instances of the current module and\nmade accessible through <code>require()</code>.\n<code>exports</code> is the same as the <code>module.exports</code> object.\n<code>exports</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n<p>See the [module system documentation][] for more information.\n\n</p>\n<p>See the [module section][] for more information.\n\n</p>\n"}],"methods":[{"textRaw":"setInterval(cb, ms)","type":"method","name":"setInterval","desc":"<p>The timer functions are global variables. See the [timers][] section.\n\n</p>\n","signatures":[{"params":[{"name":"cb"},{"name":"ms"}]}]}],"miscs":[{"textRaw":"Global Objects","name":"Global Objects","type":"misc","desc":"<p>These objects are available in all modules. Some of these objects aren&apos;t\nactually in the global scope but in the module scope - this will be noted.\n\n</p>\n","globals":[{"textRaw":"global","name":"global","type":"global","desc":"<p>In browsers, the top-level scope is the global scope. That means that in\nbrowsers if you&apos;re in the global scope <code>var something</code> will define a global\nvariable. In Node this is different. The top-level scope is not the global\nscope; <code>var something</code> inside a Node module will be local to that module.\n\n</p>\n"},{"textRaw":"process","name":"process","type":"global","desc":"<p>The process object. See the [process object][] section.\n\n</p>\n"},{"textRaw":"console","name":"console","type":"global","desc":"<p>Used to print to stdout and stderr. See the [stdio][] section.\n\n</p>\n"},{"textRaw":"Class: Buffer","type":"global","name":"Buffer","desc":"<p>Used to handle binary data. See the [buffer section][]\n\n</p>\n"},{"textRaw":"clearInterval(t)","type":"global","name":"clearInterval","desc":"<p>The timer functions are global variables. See the [timers][] section.\n\n</p>\n"}],"vars":[{"textRaw":"require()","type":"var","name":"require","desc":"<p>To require modules. See the [Modules][] section. <code>require</code> isn&apos;t actually a\nglobal but rather local to each module.\n\n</p>\n","methods":[{"textRaw":"require.resolve()","type":"method","name":"resolve","desc":"<p>Use the internal <code>require()</code> machinery to look up the location of a module,\nbut rather than loading the module, just return the resolved filename.\n\n</p>\n","signatures":[{"params":[]}]}],"properties":[{"textRaw":"`cache` {Object} ","name":"cache","desc":"<p>Modules are cached in this object when they are required. By deleting a key\nvalue from this object, the next <code>require</code> will reload the module.\n\n</p>\n"},{"textRaw":"`extensions` {Array} ","name":"extensions","desc":"<p>Instruct <code>require</code> on how to handle certain file extensions.\n\n</p>\n<p>Process files with the extension <code>.sjs</code> as <code>.js</code>:\n\n</p>\n<pre><code>require.extensions[&apos;.sjs&apos;] = require.extensions[&apos;.js&apos;];</code></pre>\n<p>Write your own extension handler:\n\n</p>\n<pre><code>require.extensions[&apos;.sjs&apos;] = function(module, filename) {\n var content = fs.readFileSync(filename, &apos;utf8&apos;);\n // Parse the file content and give to module.exports\n module.exports = content;\n};</code></pre>\n"}]},{"textRaw":"__filename","name":"__filename","type":"var","desc":"<p>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\nfilename used in the command line. The value inside a module is the path\nto that module file.\n\n</p>\n<p>Example: running <code>node example.js</code> from <code>/Users/mjr</code>\n\n</p>\n<pre><code>console.log(__filename);\n// /Users/mjr/example.js</code></pre>\n<p><code>__filename</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n"},{"textRaw":"__dirname","name":"__dirname","type":"var","desc":"<p>The name of the directory that the currently executing script resides in.\n\n</p>\n<p>Example: running <code>node example.js</code> from <code>/Users/mjr</code>\n\n</p>\n<pre><code>console.log(__dirname);\n// /Users/mjr</code></pre>\n<p><code>__dirname</code> isn&apos;t actually a global but rather local to each module.\n\n\n</p>\n"},{"textRaw":"module","name":"module","type":"var","desc":"<p>A reference to the current module. In particular\n<code>module.exports</code> is the same as the <code>exports</code> object.\n<code>module</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n<p>See the [module system documentation][] for more information.\n\n</p>\n"},{"textRaw":"exports","name":"exports","type":"var","desc":"<p>An object which is shared between all instances of the current module and\nmade accessible through <code>require()</code>.\n<code>exports</code> is the same as the <code>module.exports</code> object.\n<code>exports</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n<p>See the [module system documentation][] for more information.\n\n</p>\n<p>See the [module section][] for more information.\n\n</p>\n"}],"methods":[{"textRaw":"setInterval(cb, ms)","type":"method","name":"setInterval","desc":"<p>The timer functions are global variables. See the [timers][] section.\n\n</p>\n","signatures":[{"params":[{"name":"cb"},{"name":"ms"}]}]}]}]}
View
1 public/json/0.8.1/https.json
@@ -1 +0,0 @@
-{"source":"doc/api/https.markdown","modules":[{"textRaw":"HTTPS","name":"https","stability":3,"stabilityText":"Stable","desc":"<p>HTTPS is the HTTP protocol over TLS/SSL. In Node this is implemented as a\nseparate module.\n\n</p>\n","classes":[{"textRaw":"Class: https.Server","type":"class","name":"https.Server","desc":"<p>This class is a subclass of <code>tls.Server</code> and emits events same as\n<code>http.Server</code>. See <code>http.Server</code> for more information.\n\n</p>\n"},{"textRaw":"Class: https.Agent","type":"class","name":"https.Agent","desc":"<p>An Agent object for HTTPS similar to [http.Agent][]. See [https.request()][]\nfor more information.\n\n\n</p>\n"}],"methods":[{"textRaw":"https.createServer(options, [requestListener])","type":"method","name":"createServer","desc":"<p>Returns a new HTTPS web server object. The <code>options</code> is similar to\n[tls.createServer()][]. The <code>requestListener</code> is a function which is\nautomatically added to the <code>&apos;request&apos;</code> event.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>// curl -k https://localhost:8000/\nvar https = require(&apos;https&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n key: fs.readFileSync(&apos;test/fixtures/keys/agent2-key.pem&apos;),\n cert: fs.readFileSync(&apos;test/fixtures/keys/agent2-cert.pem&apos;)\n};\n\nhttps.createServer(options, function (req, res) {\n res.writeHead(200);\n res.end(&quot;hello world\\n&quot;);\n}).listen(8000);</code></pre>\n<p>Or\n\n</p>\n<pre><code>var https = require(&apos;https&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n pfx: fs.readFileSync(&apos;server.pfx&apos;)\n};\n\nhttps.createServer(options, function (req, res) {\n res.writeHead(200);\n res.end(&quot;hello world\\n&quot;);\n}).listen(8000);</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"requestListener","optional":true}]}]},{"textRaw":"https.request(options, callback)","type":"method","name":"request","desc":"<p>Makes a request to a secure web server. All options from [http.request()][]\nare valid.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var https = require(&apos;https&apos;);\n\nvar options = {\n host: &apos;encrypted.google.com&apos;,\n port: 443,\n path: &apos;/&apos;,\n method: &apos;GET&apos;\n};\n\nvar req = https.request(options, function(res) {\n console.log(&quot;statusCode: &quot;, res.statusCode);\n console.log(&quot;headers: &quot;, res.headers);\n\n res.on(&apos;data&apos;, function(d) {\n process.stdout.write(d);\n });\n});\nreq.end();\n\nreq.on(&apos;error&apos;, function(e) {\n console.error(e);\n});</code></pre>\n<p>The options argument has the following options\n\n</p>\n<ul>\n<li>host: IP or domain of host to make request to. Defaults to <code>&apos;localhost&apos;</code>.</li>\n<li>port: port of host to request to. Defaults to 443.</li>\n<li>path: Path to request. Default <code>&apos;/&apos;</code>.</li>\n<li><p>method: HTTP request method. Default <code>&apos;GET&apos;</code>.</p>\n</li>\n<li><p><code>host</code>: A domain name or IP address of the server to issue the request to.\nDefaults to <code>&apos;localhost&apos;</code>.</p>\n</li>\n<li><code>hostname</code>: To support <code>url.parse()</code> <code>hostname</code> is preferred over <code>host</code></li>\n<li><code>port</code>: Port of remote server. Defaults to 443.</li>\n<li><code>method</code>: A string specifying the HTTP request method. Defaults to <code>&apos;GET&apos;</code>.</li>\n<li><code>path</code>: Request path. Defaults to <code>&apos;/&apos;</code>. Should include query string if any.\nE.G. <code>&apos;/index.html?page=12&apos;</code></li>\n<li><code>headers</code>: An object containing request headers.</li>\n<li><code>auth</code>: Basic authentication i.e. <code>&apos;user:password&apos;</code> to compute an\nAuthorization header.</li>\n<li><code>agent</code>: Controls [Agent][] behavior. When an Agent is used request will\ndefault to <code>Connection: keep-alive</code>. Possible values:<ul>\n<li><code>undefined</code> (default): use [globalAgent][] for this host and port.</li>\n<li><code>Agent</code> object: explicitly use the passed in <code>Agent</code>.</li>\n<li><code>false</code>: opts out of connection pooling with an Agent, defaults request to\n<code>Connection: close</code>.</li>\n</ul>\n</li>\n</ul>\n<p>The following options from [tls.connect()][] can also be specified. However, a\n[globalAgent][] silently ignores these.\n\n</p>\n<ul>\n<li><code>pfx</code>: Certificate, Private key and CA certificates to use for SSL. Default <code>null</code>.</li>\n<li><code>key</code>: Private key to use for SSL. Default <code>null</code>.</li>\n<li><code>passphrase</code>: A string of passphrase for the private key or pfx. Default <code>null</code>.</li>\n<li><code>cert</code>: Public x509 certificate to use. Default <code>null</code>.</li>\n<li><code>ca</code>: An authority certificate or array of authority certificates to check\nthe remote host against.</li>\n<li><code>ciphers</code>: A string describing the ciphers to use or exclude. Consult\n<a href=\"http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT\">http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT</a> for\ndetails on the format.</li>\n<li><code>rejectUnauthorized</code>: If <code>true</code>, the server certificate is verified against\nthe list of supplied CAs. An <code>&apos;error&apos;</code> event is emitted if verification\nfails. Verification happens at the connection level, <em>before</em> the HTTP\nrequest is sent. Default <code>false</code>.</li>\n</ul>\n<p>In order to specify these options, use a custom <code>Agent</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var options = {\n host: &apos;encrypted.google.com&apos;,\n port: 443,\n path: &apos;/&apos;,\n method: &apos;GET&apos;,\n key: fs.readFileSync(&apos;test/fixtures/keys/agent2-key.pem&apos;),\n cert: fs.readFileSync(&apos;test/fixtures/keys/agent2-cert.pem&apos;)\n};\noptions.agent = new https.Agent(options);\n\nvar req = https.request(options, function(res) {\n ...\n}</code></pre>\n<p>Or does not use an <code>Agent</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var options = {\n host: &apos;encrypted.google.com&apos;,\n port: 443,\n path: &apos;/&apos;,\n method: &apos;GET&apos;,\n key: fs.readFileSync(&apos;test/fixtures/keys/agent2-key.pem&apos;),\n cert: fs.readFileSync(&apos;test/fixtures/keys/agent2-cert.pem&apos;),\n agent: false\n};\n\nvar req = https.request(options, function(res) {\n ...\n}</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"callback"}]}]},{"textRaw":"https.get(options, callback)","type":"method","name":"get","desc":"<p>Like <code>http.get()</code> but for HTTPS.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var https = require(&apos;https&apos;);\n\nhttps.get({ host: &apos;encrypted.google.com&apos;, path: &apos;/&apos; }, function(res) {\n console.log(&quot;statusCode: &quot;, res.statusCode);\n console.log(&quot;headers: &quot;, res.headers);\n\n res.on(&apos;data&apos;, function(d) {\n process.stdout.write(d);\n });\n\n}).on(&apos;error&apos;, function(e) {\n console.error(e);\n});</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"callback"}]}]}],"properties":[{"textRaw":"https.globalAgent","name":"globalAgent","desc":"<p>Global instance of [https.Agent][] for all HTTPS client requests.\n\n</p>\n"}],"type":"module","displayName":"HTTPS"}]}
View
1 public/json/0.8.1/modules.json
@@ -1 +0,0 @@
-{"source":"doc/api/modules.markdown","modules":[{"textRaw":"Modules","name":"module","stability":5,"stabilityText":"Locked","desc":"<p>Node has a simple module loading system. In Node, files and modules are in\none-to-one correspondence. As an example, <code>foo.js</code> loads the module\n<code>circle.js</code> in the same directory.\n\n</p>\n<p>The contents of <code>foo.js</code>:\n\n</p>\n<pre><code>var circle = require(&apos;./circle.js&apos;);\nconsole.log( &apos;The area of a circle of radius 4 is &apos;\n + circle.area(4));</code></pre>\n<p>The contents of <code>circle.js</code>:\n\n</p>\n<pre><code>var PI = Math.PI;\n\nexports.area = function (r) {\n return PI * r * r;\n};\n\nexports.circumference = function (r) {\n return 2 * PI * r;\n};</code></pre>\n<p>The module <code>circle.js</code> has exported the functions <code>area()</code> and\n<code>circumference()</code>. To export an object, add to the special <code>exports</code>\nobject.\n\n</p>\n<p>Variables\nlocal to the module will be private. In this example the variable <code>PI</code> is\nprivate to <code>circle.js</code>.\n\n</p>\n<p>The module system is implemented in the <code>require(&quot;module&quot;)</code> module.\n\n</p>\n","miscs":[{"textRaw":"Cycles","name":"Cycles","type":"misc","desc":"<p>When there are circular <code>require()</code> calls, a module might not be\ndone being executed when it is returned.\n\n</p>\n<p>Consider this situation:\n\n</p>\n<p><code>a.js</code>:\n\n</p>\n<pre><code>console.log(&apos;a starting&apos;);\nexports.done = false;\nvar b = require(&apos;./b.js&apos;);\nconsole.log(&apos;in a, b.done = %j&apos;, b.done);\nexports.done = true;\nconsole.log(&apos;a done&apos;);</code></pre>\n<p><code>b.js</code>:\n\n</p>\n<pre><code>console.log(&apos;b starting&apos;);\nexports.done = false;\nvar a = require(&apos;./a.js&apos;);\nconsole.log(&apos;in b, a.done = %j&apos;, a.done);\nexports.done = true;\nconsole.log(&apos;b done&apos;);</code></pre>\n<p><code>main.js</code>:\n\n</p>\n<pre><code>console.log(&apos;main starting&apos;);\nvar a = require(&apos;./a.js&apos;);\nvar b = require(&apos;./b.js&apos;);\nconsole.log(&apos;in main, a.done=%j, b.done=%j&apos;, a.done, b.done);</code></pre>\n<p>When <code>main.js</code> loads <code>a.js</code>, then <code>a.js</code> in turn loads <code>b.js</code>. At that\npoint, <code>b.js</code> tries to load <code>a.js</code>. In order to prevent an infinite\nloop an <strong>unfinished copy</strong> of the <code>a.js</code> exports object is returned to the\n<code>b.js</code> module. <code>b.js</code> then finishes loading, and its exports object is\nprovided to the <code>a.js</code> module.\n\n</p>\n<p>By the time <code>main.js</code> has loaded both modules, they&apos;re both finished.\nThe output of this program would thus be:\n\n</p>\n<pre><code>$ node main.js\nmain starting\na starting\nb starting\nin b, a.done = false\nb done\nin a, b.done = true\na done\nin main, a.done=true, b.done=true</code></pre>\n<p>If you have cyclic module dependencies in your program, make sure to\nplan accordingly.\n\n</p>\n"},{"textRaw":"Core Modules","name":"Core Modules","type":"misc","desc":"<p>Node has several modules compiled into the binary. These modules are\ndescribed in greater detail elsewhere in this documentation.\n\n</p>\n<p>The core modules are defined in node&apos;s source in the <code>lib/</code> folder.\n\n</p>\n<p>Core modules are always preferentially loaded if their identifier is\npassed to <code>require()</code>. For instance, <code>require(&apos;http&apos;)</code> will always\nreturn the built in HTTP module, even if there is a file by that name.\n\n</p>\n"},{"textRaw":"File Modules","name":"File Modules","type":"misc","desc":"<p>If the exact filename is not found, then node will attempt to load the\nrequired filename with the added extension of <code>.js</code>, <code>.json</code>, and then <code>.node</code>.\n\n</p>\n<p><code>.js</code> files are interpreted as JavaScript text files, and <code>.json</code> files are\nparsed as JSON text files. <code>.node</code> files are interpreted as compiled addon\nmodules loaded with <code>dlopen</code>.\n\n</p>\n<p>A module prefixed with <code>&apos;/&apos;</code> is an absolute path to the file. For\nexample, <code>require(&apos;/home/marco/foo.js&apos;)</code> will load the file at\n<code>/home/marco/foo.js</code>.\n\n</p>\n<p>A module prefixed with <code>&apos;./&apos;</code> is relative to the file calling <code>require()</code>.\nThat is, <code>circle.js</code> must be in the same directory as <code>foo.js</code> for\n<code>require(&apos;./circle&apos;)</code> to find it.\n\n</p>\n<p>Without a leading &apos;/&apos; or &apos;./&apos; to indicate a file, the module is either a\n&quot;core module&quot; or is loaded from a <code>node_modules</code> folder.\n\n</p>\n<p>If the given path does not exist, <code>require()</code> will throw an Error with its\n<code>code</code> property set to <code>&apos;MODULE_NOT_FOUND&apos;</code>.\n\n</p>\n"},{"textRaw":"Loading from `node_modules` Folders","name":"Loading from `node_modules` Folders","type":"misc","desc":"<p>If the module identifier passed to <code>require()</code> is not a native module,\nand does not begin with <code>&apos;/&apos;</code>, <code>&apos;../&apos;</code>, or <code>&apos;./&apos;</code>, then node starts at the\nparent directory of the current module, and adds <code>/node_modules</code>, and\nattempts to load the module from that location.\n\n</p>\n<p>If it is not found there, then it moves to the parent directory, and so\non, until the root of the tree is reached.\n\n</p>\n<p>For example, if the file at <code>&apos;/home/ry/projects/foo.js&apos;</code> called\n<code>require(&apos;bar.js&apos;)</code>, then node would look in the following locations, in\nthis order:\n\n</p>\n<ul>\n<li><code>/home/ry/projects/node_modules/bar.js</code></li>\n<li><code>/home/ry/node_modules/bar.js</code></li>\n<li><code>/home/node_modules/bar.js</code></li>\n<li><code>/node_modules/bar.js</code></li>\n</ul>\n<p>This allows programs to localize their dependencies, so that they do not\nclash.\n\n</p>\n"},{"textRaw":"Folders as Modules","name":"Folders as Modules","type":"misc","desc":"<p>It is convenient to organize programs and libraries into self-contained\ndirectories, and then provide a single entry point to that library.\nThere are three ways in which a folder may be passed to <code>require()</code> as\nan argument.\n\n</p>\n<p>The first is to create a <code>package.json</code> file in the root of the folder,\nwhich specifies a <code>main</code> module. An example package.json file might\nlook like this:\n\n</p>\n<pre><code>{ &quot;name&quot; : &quot;some-library&quot;,\n &quot;main&quot; : &quot;./lib/some-library.js&quot; }</code></pre>\n<p>If this was in a folder at <code>./some-library</code>, then\n<code>require(&apos;./some-library&apos;)</code> would attempt to load\n<code>./some-library/lib/some-library.js</code>.\n\n</p>\n<p>This is the extent of Node&apos;s awareness of package.json files.\n\n</p>\n<p>If there is no package.json file present in the directory, then node\nwill attempt to load an <code>index.js</code> or <code>index.node</code> file out of that\ndirectory. For example, if there was no package.json file in the above\nexample, then <code>require(&apos;./some-library&apos;)</code> would attempt to load:\n\n</p>\n<ul>\n<li><code>./some-library/index.js</code></li>\n<li><code>./some-library/index.node</code></li>\n</ul>\n"},{"textRaw":"Caching","name":"Caching","type":"misc","desc":"<p>Modules are cached after the first time they are loaded. This means\n(among other things) that every call to <code>require(&apos;foo&apos;)</code> will get\nexactly the same object returned, if it would resolve to the same file.\n\n</p>\n<p>Multiple calls to <code>require(&apos;foo&apos;)</code> may not cause the module code to be\nexecuted multiple times. This is an important feature. With it,\n&quot;partially done&quot; objects can be returned, thus allowing transitive\ndependencies to be loaded even when they would cause cycles.\n\n</p>\n<p>If you want to have a module execute code multiple times, then export a\nfunction, and call that function.\n\n</p>\n","miscs":[{"textRaw":"Module Caching Caveats","name":"Module Caching Caveats","type":"misc","desc":"<p>Modules are cached based on their resolved filename. Since modules may\nresolve to a different filename based on the location of the calling\nmodule (loading from <code>node_modules</code> folders), it is not a <em>guarantee</em>\nthat <code>require(&apos;foo&apos;)</code> will always return the exact same object, if it\nwould resolve to different files.\n\n</p>\n"}]},{"textRaw":"All Together...","name":"All Together...","type":"misc","desc":"<p>To get the exact filename that will be loaded when <code>require()</code> is called, use\nthe <code>require.resolve()</code> function.\n\n</p>\n<p>Putting together all of the above, here is the high-level algorithm\nin pseudocode of what require.resolve does:\n\n</p>\n<pre><code>require(X) from module at path Y\n1. If X is a core module,\n a. return the core module\n b. STOP\n2. If X begins with &apos;./&apos; or &apos;/&apos; or &apos;../&apos;\n a. LOAD_AS_FILE(Y + X)\n b. LOAD_AS_DIRECTORY(Y + X)\n3. LOAD_NODE_MODULES(X, dirname(Y))\n4. THROW &quot;not found&quot;\n\nLOAD_AS_FILE(X)\n1. If X is a file, load X as JavaScript text. STOP\n2. If X.js is a file, load X.js as JavaScript text. STOP\n3. If X.node is a file, load X.node as binary addon. STOP\n\nLOAD_AS_DIRECTORY(X)\n1. If X/package.json is a file,\n a. Parse X/package.json, and look for &quot;main&quot; field.\n b. let M = X + (json main field)\n c. LOAD_AS_FILE(M)\n2. If X/index.js is a file, load X/index.js as JavaScript text. STOP\n3. If X/index.node is a file, load X/index.node as binary addon. STOP\n\nLOAD_NODE_MODULES(X, START)\n1. let DIRS=NODE_MODULES_PATHS(START)\n2. for each DIR in DIRS:\n a. LOAD_AS_FILE(DIR/X)\n b. LOAD_AS_DIRECTORY(DIR/X)\n\nNODE_MODULES_PATHS(START)\n1. let PARTS = path split(START)\n2. let ROOT = index of first instance of &quot;node_modules&quot; in PARTS, or 0\n3. let I = count of PARTS - 1\n4. let DIRS = []\n5. while I &gt; ROOT,\n a. if PARTS[I] = &quot;node_modules&quot; CONTINUE\n c. DIR = path join(PARTS[0 .. I] + &quot;node_modules&quot;)\n b. DIRS = DIRS + DIR\n c. let I = I - 1\n6. return DIRS</code></pre>\n"},{"textRaw":"Loading from the global folders","name":"Loading from the global folders","type":"misc","desc":"<p>If the <code>NODE_PATH</code> environment variable is set to a colon-delimited list\nof absolute paths, then node will search those paths for modules if they\nare not found elsewhere. (Note: On Windows, <code>NODE_PATH</code> is delimited by\nsemicolons instead of colons.)\n\n</p>\n<p>Additionally, node will search in the following locations:\n\n</p>\n<ul>\n<li>1: <code>$HOME/.node_modules</code></li>\n<li>2: <code>$HOME/.node_libraries</code></li>\n<li>3: <code>$PREFIX/lib/node</code></li>\n</ul>\n<p>Where <code>$HOME</code> is the user&apos;s home directory, and <code>$PREFIX</code> is node&apos;s\nconfigured <code>node_prefix</code>.\n\n</p>\n<p>These are mostly for historic reasons. You are highly encouraged to\nplace your dependencies locally in <code>node_modules</code> folders. They will be\nloaded faster, and more reliably.\n\n</p>\n"},{"textRaw":"Accessing the main module","name":"Accessing the main module","type":"misc","desc":"<p>When a file is run directly from Node, <code>require.main</code> is set to its\n<code>module</code>. That means that you can determine whether a file has been run\ndirectly by testing\n\n</p>\n<pre><code>require.main === module</code></pre>\n<p>For a file <code>foo.js</code>, this will be <code>true</code> if run via <code>node foo.js</code>, but\n<code>false</code> if run by <code>require(&apos;./foo&apos;)</code>.\n\n</p>\n<p>Because <code>module</code> provides a <code>filename</code> property (normally equivalent to\n<code>__filename</code>), the entry point of the current application can be obtained\nby checking <code>require.main.filename</code>.\n\n</p>\n"},{"textRaw":"Addenda: Package Manager Tips","name":"Addenda: Package Manager Tips","type":"misc","desc":"<p>The semantics of Node&apos;s <code>require()</code> function were designed to be general\nenough to support a number of sane directory structures. Package manager\nprograms such as <code>dpkg</code>, <code>rpm</code>, and <code>npm</code> will hopefully find it possible to\nbuild native packages from Node modules without modification.\n\n</p>\n<p>Below we give a suggested directory structure that could work:\n\n</p>\n<p>Let&apos;s say that we wanted to have the folder at\n<code>/usr/lib/node/&lt;some-package&gt;/&lt;some-version&gt;</code> hold the contents of a\nspecific version of a package.\n\n</p>\n<p>Packages can depend on one another. In order to install package <code>foo</code>, you\nmay have to install a specific version of package <code>bar</code>. The <code>bar</code> package\nmay itself have dependencies, and in some cases, these dependencies may even\ncollide or form cycles.\n\n</p>\n<p>Since Node looks up the <code>realpath</code> of any modules it loads (that is,\nresolves symlinks), and then looks for their dependencies in the\n<code>node_modules</code> folders as described above, this situation is very simple to\nresolve with the following architecture:\n\n</p>\n<ul>\n<li><code>/usr/lib/node/foo/1.2.3/</code> - Contents of the <code>foo</code> package, version 1.2.3.</li>\n<li><code>/usr/lib/node/bar/4.3.2/</code> - Contents of the <code>bar</code> package that <code>foo</code>\ndepends on.</li>\n<li><code>/usr/lib/node/foo/1.2.3/node_modules/bar</code> - Symbolic link to\n<code>/usr/lib/node/bar/4.3.2/</code>.</li>\n<li><code>/usr/lib/node/bar/4.3.2/node_modules/*</code> - Symbolic links to the packages\nthat <code>bar</code> depends on.</li>\n</ul>\n<p>Thus, even if a cycle is encountered, or if there are dependency\nconflicts, every module will be able to get a version of its dependency\nthat it can use.\n\n</p>\n<p>When the code in the <code>foo</code> package does <code>require(&apos;bar&apos;)</code>, it will get the\nversion that is symlinked into <code>/usr/lib/node/foo/1.2.3/node_modules/bar</code>.\nThen, when the code in the <code>bar</code> package calls <code>require(&apos;quux&apos;)</code>, it&apos;ll get\nthe version that is symlinked into\n<code>/usr/lib/node/bar/4.3.2/node_modules/quux</code>.\n\n</p>\n<p>Furthermore, to make the module lookup process even more optimal, rather\nthan putting packages directly in <code>/usr/lib/node</code>, we could put them in\n<code>/usr/lib/node_modules/&lt;name&gt;/&lt;version&gt;</code>. Then node will not bother\nlooking for missing dependencies in <code>/usr/node_modules</code> or <code>/node_modules</code>.\n\n</p>\n<p>In order to make modules available to the node REPL, it might be useful to\nalso add the <code>/usr/lib/node_modules</code> folder to the <code>$NODE_PATH</code> environment\nvariable. Since the module lookups using <code>node_modules</code> folders are all\nrelative, and based on the real path of the files making the calls to\n<code>require()</code>, the packages themselves can be anywhere.\n</p>\n"}],"vars":[{"textRaw":"The `module` Object","name":"module","type":"var","desc":"<p>In each module, the <code>module</code> free variable is a reference to the object\nrepresenting the current module. In particular\n<code>module.exports</code> is the same as the <code>exports</code> object.\n<code>module</code> isn&apos;t actually a global but rather local to each module.\n\n</p>\n","properties":[{"textRaw":"`exports` {Object} ","name":"exports","desc":"<p>The <code>exports</code> object is created by the Module system. Sometimes this is not\nacceptable, many want their module to be an instance of some class. To do this\nassign the desired export object to <code>module.exports</code>. For example suppose we\nwere making a module called <code>a.js</code>\n\n</p>\n<pre><code>var EventEmitter = require(&apos;events&apos;).EventEmitter;\n\nmodule.exports = new EventEmitter();\n\n// Do some work, and after some time emit\n// the &apos;ready&apos; event from the module itself.\nsetTimeout(function() {\n module.exports.emit(&apos;ready&apos;);\n}, 1000);</code></pre>\n<p>Then in another file we could do\n\n</p>\n<pre><code>var a = require(&apos;./a&apos;);\na.on(&apos;ready&apos;, function() {\n console.log(&apos;module a is ready&apos;);\n});</code></pre>\n<p>Note that assignment to <code>module.exports</code> must be done immediately. It cannot be\ndone in any callbacks. This does not work:\n\n</p>\n<p>x.js:\n\n</p>\n<pre><code>setTimeout(function() {\n module.exports = { a: &quot;hello&quot; };\n}, 0);</code></pre>\n<p>y.js:\n\n</p>\n<pre><code>var x = require(&apos;./x&apos;);\nconsole.log(x.a);</code></pre>\n"},{"textRaw":"`id` {String} ","name":"id","desc":"<p>The identifier for the module. Typically this is the fully resolved\nfilename.\n\n\n</p>\n"},{"textRaw":"`filename` {String} ","name":"filename","desc":"<p>The fully resolved filename to the module.\n\n\n</p>\n"},{"textRaw":"`loaded` {Boolean} ","name":"loaded","desc":"<p>Whether or not the module is done loading, or is in the process of\nloading.\n\n\n</p>\n"},{"textRaw":"`parent` {Module Object} ","name":"parent","desc":"<p>The module that required this one.\n\n\n</p>\n"},{"textRaw":"`children` {Array} ","name":"children","desc":"<p>The module objects required by this one.\n\n\n\n</p>\n"}],"methods":[{"textRaw":"module.require(id)","type":"method","name":"require","signatures":[{"return":{"textRaw":"Return: {Object} `exports` from the resolved module ","name":"return","type":"Object","desc":"`exports` from the resolved module"},"params":[{"textRaw":"`id` {String} ","name":"id","type":"String"}]},{"params":[{"name":"id"}]}],"desc":"<p>The <code>module.require</code> method provides a way to load a module as if\n<code>require()</code> was called from the original module.\n\n</p>\n<p>Note that in order to do this, you must get a reference to the <code>module</code>\nobject. Since <code>require()</code> returns the <code>exports</code>, and the <code>module</code> is\ntypically <em>only</em> available within a specific module&apos;s code, it must be\nexplicitly exported in order to be used.\n\n\n</p>\n"}]}],"type":"module","displayName":"module"}]}
View
1 public/json/0.8.1/mydata.json
@@ -1 +0,0 @@
-{"documentation.json":{"About this Documentation":{"p":"miscs.0","t":"misc"},"Stability Index":{"p":"miscs.0.miscs.0","t":"misc"},"JSON Output":{"p":"miscs.0.miscs.1","t":"misc"}},"synopsis.json":{"Synopsis":{"p":"miscs.0","t":"misc"}},"timers.json":{"Timers":{"p":"modules.0","t":"module"},"setTimeout(callback, delay, [arg], [...])":{"p":"modules.0.methods.0","t":"method"},"clearTimeout(timeoutId)":{"p":"modules.0.methods.1","t":"method"},"setInterval(callback, delay, [arg], [...])":{"p":"modules.0.methods.2","t":"method"},"clearInterval(intervalId)":{"p":"modules.0.methods.3","t":"method"}},"globals.json":{"global":{"p":"miscs.0.globals.0","t":"global"},"process":{"p":"miscs.0.globals.1","t":"global"},"console":{"p":"miscs.0.globals.2","t":"global"},"Class: Buffer":{"p":"miscs.0.globals.3","t":"global"},"clearInterval(t)":{"p":"miscs.0.globals.4","t":"global"},"require()":{"p":"miscs.0.vars.0","t":"var"},"require.resolve()":{"p":"miscs.0.vars.0.methods.0","t":"method"},"`cache` {Object} ":{"p":"miscs.0.vars.0.properties.0"},"`extensions` {Array} ":{"p":"miscs.0.vars.0.properties.1"},"__filename":{"p":"miscs.0.vars.1","t":"var"},"__dirname":{"p":"miscs.0.vars.2","t":"var"},"module":{"p":"miscs.0.vars.3","t":"var"},"exports":{"p":"miscs.0.vars.4","t":"var"},"setInterval(cb, ms)":{"p":"miscs.0.methods.0","t":"method"},"Global Objects":{"p":"miscs.0","t":"misc"}},"modules.json":{"Modules":{"p":"modules.0","t":"module"},"Cycles":{"p":"modules.0.miscs.0","t":"misc"},"Core Modules":{"p":"modules.0.miscs.1","t":"misc"},"File Modules":{"p":"modules.0.miscs.2","t":"misc"},"Loading from `node_modules` Folders":{"p":"modules.0.miscs.3","t":"misc"},"Folders as Modules":{"p":"modules.0.miscs.4","t":"misc"},"Caching":{"p":"modules.0.miscs.5","t":"misc"},"Module Caching Caveats":{"p":"modules.0.miscs.5.miscs.0","t":"misc"},"All Together...":{"p":"modules.0.miscs.6","t":"misc"},"Loading from the global folders":{"p":"modules.0.miscs.7","t":"misc"},"Accessing the main module":{"p":"modules.0.miscs.8","t":"misc"},"Addenda: Package Manager Tips":{"p":"modules.0.miscs.9","t":"misc"},"The `module` Object":{"p":"modules.0.vars.0","t":"var"},"`exports` {Object} ":{"p":"modules.0.vars.0.properties.0"},"`id` {String} ":{"p":"modules.0.vars.0.methods.0.signatures.0.params.0","t":"String"},"`filename` {String} ":{"p":"modules.0.vars.0.properties.2"},"`loaded` {Boolean} ":{"p":"modules.0.vars.0.properties.3"},"`parent` {Module Object} ":{"p":"modules.0.vars.0.properties.4"},"`children` {Array} ":{"p":"modules.0.vars.0.properties.5"},"module.require(id)":{"p":"modules.0.vars.0.methods.0","t":"method"},"Return: {Object} `exports` from the resolved module ":{"p":"modules.0.vars.0.methods.0.signatures.0.return","t":"Object"}},"util.json":{"util":{"p":"modules.0","t":"module"},"util.format(format, [...])":{"p":"modules.0.methods.0","t":"method"},"util.debug(string)":{"p":"modules.0.methods.1","t":"method"},"util.error([...])":{"p":"modules.0.methods.2","t":"method"},"util.puts([...])":{"p":"modules.0.methods.3","t":"method"},"util.print([...])":{"p":"modules.0.methods.4","t":"method"},"util.log(string)":{"p":"modules.0.methods.5","t":"method"},"util.inspect(object, [showHidden], [depth], [colors])":{"p":"modules.0.methods.6","t":"method"},"util.isArray(object)":{"p":"modules.0.methods.7","t":"method"},"util.isRegExp(object)":{"p":"modules.0.methods.8","t":"method"},"util.isDate(object)":{"p":"modules.0.methods.9","t":"method"},"util.isError(object)":{"p":"modules.0.methods.10","t":"method"},"util.pump(readableStream, writableStream, [callback])":{"p":"modules.0.methods.11","t":"method"},"util.inherits(constructor, superConstructor)":{"p":"modules.0.methods.12","t":"method"}},"events.json":{"Events":{"p":"modules.0","t":"module"},"Class: events.EventEmitter":{"p":"modules.0.classes.0","t":"class"},"emitter.addListener(event, listener)":{"p":"modules.0.classes.0.methods.0","t":"method"},"emitter.on(event, listener)":{"p":"modules.0.classes.0.methods.1","t":"method"},"emitter.once(event, listener)":{"p":"modules.0.classes.0.methods.2","t":"method"},"emitter.removeListener(event, listener)":{"p":"modules.0.classes.0.methods.3","t":"method"},"emitter.removeAllListeners([event])":{"p":"modules.0.classes.0.methods.4","t":"method"},"emitter.setMaxListeners(n)":{"p":"modules.0.classes.0.methods.5","t":"method"},"emitter.listeners(event)":{"p":"modules.0.classes.0.methods.6","t":"method"},"emitter.emit(event, [arg1], [arg2], [...])":{"p":"modules.0.classes.0.methods.7","t":"method"},"Event: 'newListener'":{"p":"modules.0.classes.0.events.0","t":"event"}},"process.json":{"process":{"p":"globals.0","t":"global"},"Event: 'exit'":{"p":"globals.0.events.0","t":"event"},"Event: 'uncaughtException'":{"p":"globals.0.events.1","t":"event"},"Signal Events":{"p":"globals.0.events.2","t":"event"},"process.stdout":{"p":"globals.0.properties.0"},"process.stderr":{"p":"globals.0.properties.1"},"process.stdin":{"p":"globals.0.properties.2"},"process.argv":{"p":"globals.0.properties.3"},"process.execPath":{"p":"globals.0.properties.4"},"process.env":{"p":"globals.0.properties.5"},"process.version":{"p":"globals.0.properties.6"},"process.versions":{"p":"globals.0.properties.7"},"process.config":{"p":"globals.0.properties.8"},"process.pid":{"p":"globals.0.properties.9"},"process.title":{"p":"globals.0.properties.10"},"process.arch":{"p":"globals.0.properties.11"},"process.platform":{"p":"globals.0.properties.12"},"process.abort()":{"p":"globals.0.methods.0","t":"method"},"process.chdir(directory)":{"p":"globals.0.methods.1","t":"method"},"process.cwd()":{"p":"globals.0.methods.2","t":"method"},"process.exit([code])":{"p":"globals.0.methods.3","t":"method"},"process.getgid()":{"p":"globals.0.methods.4","t":"method"},"process.setgid(id)":{"p":"globals.0.methods.5","t":"method"},"process.getuid()":{"p":"globals.0.methods.6","t":"method"},"process.setuid(id)":{"p":"globals.0.methods.7","t":"method"},"process.kill(pid, [signal])":{"p":"globals.0.methods.8","t":"method"},"process.memoryUsage()":{"p":"globals.0.methods.9","t":"method"},"process.nextTick(callback)":{"p":"globals.0.methods.10","t":"method"},"process.umask([mask])":{"p":"globals.0.methods.11","t":"method"},"process.uptime()":{"p":"globals.0.methods.12","t":"method"},"process.hrtime()":{"p":"globals.0.methods.13","t":"method"}},"domain.json":{"Domain":{"p":"modules.0","t":"module"},"Additions to Error objects":{"p":"modules.0.miscs.0","t":"misc"},"Implicit Binding":{"p":"modules.0.miscs.1","t":"misc"},"Explicit Binding":{"p":"modules.0.miscs.2","t":"misc"},"domain.create()":{"p":"modules.0.methods.0","t":"method"},"return: {Domain} ":{"p":"modules.0.methods.0.signatures.0.return","t":"Domain"},"Class: Domain":{"p":"modules.0.classes.0","t":"class"},"domain.run(fn)":{"p":"modules.0.classes.0.methods.0","t":"method"},"`fn` {Function} ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.0","t":"Function"},"domain.add(emitter)":{"p":"modules.0.classes.0.methods.1","t":"method"},"`emitter` {EventEmitter | Timer} emitter or timer to be added to the domain ":{"p":"modules.0.classes.0.methods.1.signatures.0.params.0","t":"EventEmitter | Timer"},"domain.remove(emitter)":{"p":"modules.0.classes.0.methods.2","t":"method"},"`emitter` {EventEmitter | Timer} emitter or timer to be removed from the domain ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.0","t":"EventEmitter | Timer"},"domain.bind(cb)":{"p":"modules.0.classes.0.methods.3","t":"method"},"return: {Function} The bound function ":{"p":"modules.0.classes.0.methods.3.signatures.0.return","t":"Function"},"`cb` {Function} The callback function ":{"p":"modules.0.classes.0.methods.4.signatures.0.params.0","t":"Function"},"domain.intercept(cb)":{"p":"modules.0.classes.0.methods.4","t":"method"},"return: {Function} The intercepted function ":{"p":"modules.0.classes.0.methods.4.signatures.0.return","t":"Function"},"domain.dispose()":{"p":"modules.0.classes.0.methods.5","t":"method"},"`members` {Array} ":{"p":"modules.0.classes.0.properties.0"}},"stream.json":{"Stream":{"p":"modules.0","t":"module"},"Readable Stream":{"p":"modules.0.classes.0","t":"class"},"Event: 'data'":{"p":"modules.0.classes.0.events.0","t":"event"},"Event: 'end'":{"p":"modules.0.classes.0.events.1","t":"event"},"Event: 'error'":{"p":"modules.0.classes.1.events.1","t":"event"},"Event: 'close'":{"p":"modules.0.classes.1.events.2","t":"event"},"stream.readable":{"p":"modules.0.classes.0.properties.0"},"stream.setEncoding([encoding])":{"p":"modules.0.classes.0.methods.0","t":"method"},"stream.pause()":{"p":"modules.0.classes.0.methods.1","t":"method"},"stream.resume()":{"p":"modules.0.classes.0.methods.2","t":"method"},"stream.destroy()":{"p":"modules.0.classes.1.methods.5","t":"method"},"stream.pipe(destination, [options])":{"p":"modules.0.classes.0.methods.4","t":"method"},"Writable Stream":{"p":"modules.0.classes.1","t":"class"},"Event: 'drain'":{"p":"modules.0.classes.1.events.0","t":"event"},"Event: 'pipe'":{"p":"modules.0.classes.1.events.3","t":"event"},"stream.writable":{"p":"modules.0.classes.1.properties.0"},"stream.write(string, [encoding], [fd])":{"p":"modules.0.classes.1.methods.0","t":"method"},"stream.write(buffer)":{"p":"modules.0.classes.1.methods.1","t":"method"},"stream.end()":{"p":"modules.0.classes.1.methods.2","t":"method"},"stream.end(string, encoding)":{"p":"modules.0.classes.1.methods.3","t":"method"},"stream.end(buffer)":{"p":"modules.0.classes.1.methods.4","t":"method"},"stream.destroySoon()":{"p":"modules.0.classes.1.methods.6","t":"method"}},"stdio.json":{"console":{"p":"globals.0","t":"global"},"console.log([data], [...])":{"p":"globals.0.methods.0","t":"method"},"console.info([data], [...])":{"p":"globals.0.methods.1","t":"method"},"console.error([data], [...])":{"p":"globals.0.methods.2","t":"method"},"console.warn([data], [...])":{"p":"globals.0.methods.3","t":"method"},"console.dir(obj)":{"p":"globals.0.methods.4","t":"method"},"console.time(label)":{"p":"globals.0.methods.5","t":"method"},"console.timeEnd(label)":{"p":"globals.0.methods.6","t":"method"},"console.trace(label)":{"p":"globals.0.methods.7","t":"method"},"console.assert(expression, [message])":{"p":"globals.0.methods.8","t":"method"}},"crypto.json":{"Crypto":{"p":"modules.0","t":"module"},"crypto.createCredentials(details)":{"p":"modules.0.methods.0","t":"method"},"crypto.createHash(algorithm)":{"p":"modules.0.methods.1","t":"method"},"crypto.createHmac(algorithm, key)":{"p":"modules.0.methods.2","t":"method"},"crypto.createCipher(algorithm, password)":{"p":"modules.0.methods.3","t":"method"},"crypto.createCipheriv(algorithm, key, iv)":{"p":"modules.0.methods.4","t":"method"},"crypto.createDecipher(algorithm, password)":{"p":"modules.0.methods.5","t":"method"},"crypto.createDecipheriv(algorithm, key, iv)":{"p":"modules.0.methods.6","t":"method"},"crypto.createSign(algorithm)":{"p":"modules.0.methods.7","t":"method"},"crypto.createVerify(algorithm)":{"p":"modules.0.methods.8","t":"method"},"crypto.createDiffieHellman(prime_length)":{"p":"modules.0.methods.9","t":"method"},"crypto.createDiffieHellman(prime, [encoding])":{"p":"modules.0.methods.10","t":"method"},"crypto.getDiffieHellman(group_name)":{"p":"modules.0.methods.11","t":"method"},"crypto.pbkdf2(password, salt, iterations, keylen, callback)":{"p":"modules.0.methods.12","t":"method"},"crypto.randomBytes(size, [callback])":{"p":"modules.0.methods.13","t":"method"},"Class: Hash":{"p":"modules.0.classes.0","t":"class"},"hash.update(data, [input_encoding])":{"p":"modules.0.classes.0.methods.0","t":"method"},"hash.digest([encoding])":{"p":"modules.0.classes.0.methods.1","t":"method"},"Class: Hmac":{"p":"modules.0.classes.1","t":"class"},"hmac.update(data)":{"p":"modules.0.classes.1.methods.0","t":"method"},"hmac.digest([encoding])":{"p":"modules.0.classes.1.methods.1","t":"method"},"Class: Cipher":{"p":"modules.0.classes.2","t":"class"},"cipher.update(data, [input_encoding], [output_encoding])":{"p":"modules.0.classes.2.methods.0","t":"method"},"cipher.final([output_encoding])":{"p":"modules.0.classes.2.methods.1","t":"method"},"cipher.setAutoPadding(auto_padding=true)":{"p":"modules.0.classes.2.methods.2","t":"method"},"Class: Decipher":{"p":"modules.0.classes.3","t":"class"},"decipher.update(data, [input_encoding], [output_encoding])":{"p":"modules.0.classes.3.methods.0","t":"method"},"decipher.final([output_encoding])":{"p":"modules.0.classes.3.methods.1","t":"method"},"decipher.setAutoPadding(auto_padding=true)":{"p":"modules.0.classes.3.methods.2","t":"method"},"Class: Signer":{"p":"modules.0.classes.4","t":"class"},"signer.update(data)":{"p":"modules.0.classes.4.methods.0","t":"method"},"signer.sign(private_key, [output_format])":{"p":"modules.0.classes.4.methods.1","t":"method"},"Class: Verify":{"p":"modules.0.classes.5","t":"class"},"verifier.update(data)":{"p":"modules.0.classes.5.methods.0","t":"method"},"verifier.verify(object, signature, [signature_format])":{"p":"modules.0.classes.5.methods.1","t":"method"},"Class: DiffieHellman":{"p":"modules.0.classes.6","t":"class"},"diffieHellman.generateKeys([encoding])":{"p":"modules.0.classes.6.methods.0","t":"method"},"diffieHellman.computeSecret(other_public_key, [input_encoding], [output_encoding])":{"p":"modules.0.classes.6.methods.1","t":"method"},"diffieHellman.getPrime([encoding])":{"p":"modules.0.classes.6.methods.2","t":"method"},"diffieHellman.getGenerator([encoding])":{"p":"modules.0.classes.6.methods.3","t":"method"},"diffieHellman.getPublicKey([encoding])":{"p":"modules.0.classes.6.methods.4","t":"method"},"diffieHellman.getPrivateKey([encoding])":{"p":"modules.0.classes.6.methods.5","t":"method"},"diffieHellman.setPublicKey(public_key, [encoding])":{"p":"modules.0.classes.6.methods.6","t":"method"},"diffieHellman.setPrivateKey(public_key, [encoding])":{"p":"modules.0.classes.6.methods.7","t":"method"}},"string_decoder.json":{"StringDecoder":{"p":"modules.0","t":"module"},"Class: StringDecoder":{"p":"modules.0.classes.0","t":"class"},"StringDecoder.write(buffer)":{"p":"modules.0.classes.0.methods.0","t":"method"}},"tls.json":{"TLS (SSL)":{"p":"modules.0","t":"module"},"Client-initiated renegotiation attack mitigation":{"p":"modules.0.miscs.0","t":"misc"},"NPN and SNI":{"p":"modules.0.miscs.1","t":"misc"},"tls.createServer(options, [secureConnectionListener])":{"p":"modules.0.methods.0","t":"method"},"tls.connect(options, [secureConnectListener])":{"p":"modules.0.methods.1","t":"method"},"tls.connect(port, [host], [options], [secureConnectListener])":{"p":"modules.0.methods.2","t":"method"},"tls.createSecurePair([credentials], [isServer], [requestCert], [rejectUnauthorized])":{"p":"modules.0.methods.3","t":"method"},"Class: SecurePair":{"p":"modules.0.classes.0","t":"class"},"Event: 'secure'":{"p":"modules.0.classes.0.events.0","t":"event"},"Class: tls.Server":{"p":"modules.0.classes.1","t":"class"},"Event: 'secureConnection'":{"p":"modules.0.classes.1.events.0","t":"event"},"Event: 'clientError'":{"p":"modules.0.classes.1.events.1","t":"event"},"server.listen(port, [host], [callback])":{"p":"modules.0.classes.1.methods.0","t":"method"},"server.close()":{"p":"modules.0.classes.1.methods.1","t":"method"},"server.address()":{"p":"modules.0.classes.1.methods.2","t":"method"},"server.addContext(hostname, credentials)":{"p":"modules.0.classes.1.methods.3","t":"method"},"server.maxConnections":{"p":"modules.0.classes.1.properties.0"},"server.connections":{"p":"modules.0.classes.1.properties.1"},"Class: tls.CleartextStream":{"p":"modules.0.classes.2","t":"class"},"Event: 'secureConnect'":{"p":"modules.0.classes.2.events.0","t":"event"},"cleartextStream.authorized":{"p":"modules.0.classes.2.properties.0"},"cleartextStream.authorizationError":{"p":"modules.0.classes.2.properties.1"},"cleartextStream.remoteAddress":{"p":"modules.0.classes.2.properties.2"},"cleartextStream.remotePort":{"p":"modules.0.classes.2.properties.3"},"cleartextStream.getPeerCertificate()":{"p":"modules.0.classes.2.methods.0","t":"method"},"cleartextStream.getCipher()":{"p":"modules.0.classes.2.methods.1","t":"method"},"cleartextStream.address()":{"p":"modules.0.classes.2.methods.2","t":"method"}},"buffer.json":{"Buffer":{"p":"modules.0","t":"module"},"Class: Buffer":{"p":"modules.0.classes.0","t":"class"},"buf.write(string, [offset], [length], [encoding])":{"p":"modules.0.classes.0.methods.0","t":"method"},"`string` String - data to be written to buffer ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.0"},"`offset` Number, Optional, Default: 0 ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.1"},"`length` Number, Optional, Default: `buffer.length - offset` ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.2"},"`encoding` String, Optional, Default: 'utf8' ":{"p":"modules.0.classes.0.classMethods.1.signatures.0.params.1"},"buf.toString([encoding], [start], [end])":{"p":"modules.0.classes.0.methods.1","t":"method"},"`start` Number, Optional, Default: 0 ":{"p":"modules.0.classes.0.methods.3.signatures.0.params.0"},"`end` Number, Optional, Default: `buffer.length` ":{"p":"modules.0.classes.0.methods.3.signatures.0.params.1"},"buf.copy(targetBuffer, [targetStart], [sourceStart], [sourceEnd])":{"p":"modules.0.classes.0.methods.2","t":"method"},"`targetBuffer` Buffer object - Buffer to copy into ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.0"},"`targetStart` Number, Optional, Default: 0 ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.1"},"`sourceStart` Number, Optional, Default: 0 ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.2"},"`sourceEnd` Number, Optional, Default: `buffer.length` ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.3"},"buf.slice([start], [end])":{"p":"modules.0.classes.0.methods.3","t":"method"},"buf.readUInt8(offset, [noAssert])":{"p":"modules.0.classes.0.methods.4","t":"method"},"Return: Number ":{"p":"modules.0.classes.0.classMethods.1.signatures.0.return"},"`offset` Number ":{"p":"modules.0.classes.0.methods.31.signatures.0.params.1"},"`noAssert` Boolean, Optional, Default: false ":{"p":"modules.0.classes.0.methods.31.signatures.0.params.2"},"buf.readUInt16LE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.5","t":"method"},"buf.readUInt16BE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.6","t":"method"},"buf.readUInt32LE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.7","t":"method"},"buf.readUInt32BE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.8","t":"method"},"buf.readInt8(offset, [noAssert])":{"p":"modules.0.classes.0.methods.9","t":"method"},"buf.readInt16LE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.10","t":"method"},"buf.readInt16BE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.11","t":"method"},"buf.readInt32LE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.12","t":"method"},"buf.readInt32BE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.13","t":"method"},"buf.readFloatLE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.14","t":"method"},"buf.readFloatBE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.15","t":"method"},"buf.readDoubleLE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.16","t":"method"},"buf.readDoubleBE(offset, [noAssert])":{"p":"modules.0.classes.0.methods.17","t":"method"},"buf.writeUInt8(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.18","t":"method"},"`value` Number ":{"p":"modules.0.classes.0.methods.31.signatures.0.params.0"},"buf.writeUInt16LE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.19","t":"method"},"buf.writeUInt16BE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.20","t":"method"},"buf.writeUInt32LE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.21","t":"method"},"buf.writeUInt32BE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.22","t":"method"},"buf.writeInt8(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.23","t":"method"},"buf.writeInt16LE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.24","t":"method"},"buf.writeInt16BE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.25","t":"method"},"buf.writeInt32LE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.26","t":"method"},"buf.writeInt32BE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.27","t":"method"},"buf.writeFloatLE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.28","t":"method"},"buf.writeFloatBE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.29","t":"method"},"buf.writeDoubleLE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.30","t":"method"},"buf.writeDoubleBE(value, offset, [noAssert])":{"p":"modules.0.classes.0.methods.31","t":"method"},"buf.fill(value, [offset], [end])":{"p":"modules.0.classes.0.methods.32","t":"method"},"`value` ":{"p":"modules.0.classes.0.methods.32.signatures.0.params.0"},"`offset` Number, Optional ":{"p":"modules.0.classes.0.methods.32.signatures.0.params.1"},"`end` Number, Optional ":{"p":"modules.0.classes.0.methods.32.signatures.0.params.2"},"buf[index]":{"p":"modules.0.classes.0.properties.0"},"`length` Number ":{"p":"modules.0.classes.0.properties.1"},"Class Method: Buffer.isBuffer(obj)":{"p":"modules.0.classes.0.classMethods.0","t":"classMethod"},"Return: Boolean ":{"p":"modules.0.classes.0.classMethods.0.signatures.0.return"},"`obj` Object ":{"p":"modules.0.classes.0.classMethods.0.signatures.0.params.0"},"Class Method: Buffer.byteLength(string, [encoding])":{"p":"modules.0.classes.0.classMethods.1","t":"classMethod"},"`string` String ":{"p":"modules.0.classes.0.classMethods.1.signatures.0.params.0"},"Class Method: Buffer.concat(list, [totalLength])":{"p":"modules.0.classes.0.classMethods.2","t":"classMethod"},"`list` {Array} List of Buffer objects to concat ":{"p":"modules.0.classes.0.classMethods.2.signatures.0.params.0","t":"Array"},"`totalLength` {Number} Total length of the buffers when concatenated ":{"p":"modules.0.classes.0.classMethods.2.signatures.0.params.1","t":"Number"},"`size` Number ":{"p":"modules.0.classes.0.signatures.0.params.0"},"`array` Array ":{"p":"modules.0.classes.0.signatures.2.params.0"},"`str` String - string to encode. ":{"p":"modules.0.classes.0.signatures.4.params.0"},"`encoding` String - encoding to use, Optional. ":{"p":"modules.0.classes.0.signatures.4.params.1"},"Class: SlowBuffer":{"p":"modules.0.classes.1","t":"class"},"`INSPECT_MAX_BYTES` Number, Default: 50 ":{"p":"modules.0.properties.0"}},"path.json":{"Path":{"p":"modules.0","t":"module"},"path.normalize(p)":{"p":"modules.0.methods.0","t":"method"},"path.join([path1], [path2], [...])":{"p":"modules.0.methods.1","t":"method"},"path.resolve([from ...], to)":{"p":"modules.0.methods.2","t":"method"},"path.relative(from, to)":{"p":"modules.0.methods.3","t":"method"},"path.dirname(p)":{"p":"modules.0.methods.4","t":"method"},"path.basename(p, [ext])":{"p":"modules.0.methods.5","t":"method"},"path.extname(p)":{"p":"modules.0.methods.6","t":"method"},"path.sep":{"p":"modules.0.properties.0"}},"fs.json":{"File System":{"p":"modules.0","t":"module"},"fs.rename(oldPath, newPath, [callback])":{"p":"modules.0.methods.0","t":"method"},"fs.renameSync(oldPath, newPath)":{"p":"modules.0.methods.1","t":"method"},"fs.truncate(fd, len, [callback])":{"p":"modules.0.methods.2","t":"method"},"fs.truncateSync(fd, len)":{"p":"modules.0.methods.3","t":"method"},"fs.chown(path, uid, gid, [callback])":{"p":"modules.0.methods.4","t":"method"},"fs.chownSync(path, uid, gid)":{"p":"modules.0.methods.5","t":"method"},"fs.fchown(fd, uid, gid, [callback])":{"p":"modules.0.methods.6","t":"method"},"fs.fchownSync(fd, uid, gid)":{"p":"modules.0.methods.7","t":"method"},"fs.lchown(path, uid, gid, [callback])":{"p":"modules.0.methods.8","t":"method"},"fs.lchownSync(path, uid, gid)":{"p":"modules.0.methods.9","t":"method"},"fs.chmod(path, mode, [callback])":{"p":"modules.0.methods.10","t":"method"},"fs.chmodSync(path, mode)":{"p":"modules.0.methods.11","t":"method"},"fs.fchmod(fd, mode, [callback])":{"p":"modules.0.methods.12","t":"method"},"fs.fchmodSync(fd, mode)":{"p":"modules.0.methods.13","t":"method"},"fs.lchmod(path, mode, [callback])":{"p":"modules.0.methods.14","t":"method"},"fs.lchmodSync(path, mode)":{"p":"modules.0.methods.15","t":"method"},"fs.stat(path, [callback])":{"p":"modules.0.methods.16","t":"method"},"fs.lstat(path, [callback])":{"p":"modules.0.methods.17","t":"method"},"fs.fstat(fd, [callback])":{"p":"modules.0.methods.18","t":"method"},"fs.statSync(path)":{"p":"modules.0.methods.19","t":"method"},"fs.lstatSync(path)":{"p":"modules.0.methods.20","t":"method"},"fs.fstatSync(fd)":{"p":"modules.0.methods.21","t":"method"},"fs.link(srcpath, dstpath, [callback])":{"p":"modules.0.methods.22","t":"method"},"fs.linkSync(srcpath, dstpath)":{"p":"modules.0.methods.23","t":"method"},"fs.symlink(destination, path, [type], [callback])":{"p":"modules.0.methods.24","t":"method"},"fs.symlinkSync(destination, path, [type])":{"p":"modules.0.methods.25","t":"method"},"fs.readlink(path, [callback])":{"p":"modules.0.methods.26","t":"method"},"fs.readlinkSync(path)":{"p":"modules.0.methods.27","t":"method"},"fs.realpath(path, [cache], callback)":{"p":"modules.0.methods.28","t":"method"},"fs.realpathSync(path, [cache])":{"p":"modules.0.methods.29","t":"method"},"fs.unlink(path, [callback])":{"p":"modules.0.methods.30","t":"method"},"fs.unlinkSync(path)":{"p":"modules.0.methods.31","t":"method"},"fs.rmdir(path, [callback])":{"p":"modules.0.methods.32","t":"method"},"fs.rmdirSync(path)":{"p":"modules.0.methods.33","t":"method"},"fs.mkdir(path, [mode], [callback])":{"p":"modules.0.methods.34","t":"method"},"fs.mkdirSync(path, [mode])":{"p":"modules.0.methods.35","t":"method"},"fs.readdir(path, [callback])":{"p":"modules.0.methods.36","t":"method"},"fs.readdirSync(path)":{"p":"modules.0.methods.37","t":"method"},"fs.close(fd, [callback])":{"p":"modules.0.methods.38","t":"method"},"fs.closeSync(fd)":{"p":"modules.0.methods.39","t":"method"},"fs.open(path, flags, [mode], [callback])":{"p":"modules.0.methods.40","t":"method"},"fs.openSync(path, flags, [mode])":{"p":"modules.0.methods.41","t":"method"},"fs.utimes(path, atime, mtime, [callback])":{"p":"modules.0.methods.42","t":"method"},"fs.utimesSync(path, atime, mtime)":{"p":"modules.0.methods.43","t":"method"},"fs.futimes(fd, atime, mtime, [callback])":{"p":"modules.0.methods.44","t":"method"},"fs.futimesSync(fd, atime, mtime)":{"p":"modules.0.methods.45","t":"method"},"fs.fsync(fd, [callback])":{"p":"modules.0.methods.46","t":"method"},"fs.fsyncSync(fd)":{"p":"modules.0.methods.47","t":"method"},"fs.write(fd, buffer, offset, length, position, [callback])":{"p":"modules.0.methods.48","t":"method"},"fs.writeSync(fd, buffer, offset, length, position)":{"p":"modules.0.methods.49","t":"method"},"fs.read(fd, buffer, offset, length, position, [callback])":{"p":"modules.0.methods.50","t":"method"},"fs.readSync(fd, buffer, offset, length, position)":{"p":"modules.0.methods.51","t":"method"},"fs.readFile(filename, [encoding], [callback])":{"p":"modules.0.methods.52","t":"method"},"fs.readFileSync(filename, [encoding])":{"p":"modules.0.methods.53","t":"method"},"fs.writeFile(filename, data, [encoding], [callback])":{"p":"modules.0.methods.54","t":"method"},"fs.writeFileSync(filename, data, [encoding])":{"p":"modules.0.methods.55","t":"method"},"fs.appendFile(filename, data, encoding='utf8', [callback])":{"p":"modules.0.methods.56","t":"method"},"fs.appendFileSync(filename, data, encoding='utf8')":{"p":"modules.0.methods.57","t":"method"},"fs.watchFile(filename, [options], listener)":{"p":"modules.0.methods.58","t":"method"},"fs.unwatchFile(filename)":{"p":"modules.0.methods.59","t":"method"},"fs.watch(filename, [options], [listener])":{"p":"modules.0.methods.60","t":"method"},"Caveats":{"p":"modules.0.methods.60.miscs.0","t":"misc"},"Availability":{"p":"modules.0.methods.60.miscs.0.miscs.0","t":"misc"},"Filename Argument":{"p":"modules.0.methods.60.miscs.0.miscs.1","t":"misc"},"fs.exists(path, [callback])":{"p":"modules.0.methods.61","t":"method"},"fs.existsSync(path)":{"p":"modules.0.methods.62","t":"method"},"fs.createReadStream(path, [options])":{"p":"modules.0.methods.63","t":"method"},"fs.createWriteStream(path, [options])":{"p":"modules.0.methods.64","t":"method"},"Class: fs.Stats":{"p":"modules.0.classes.0","t":"class"},"Class: fs.ReadStream":{"p":"modules.0.classes.1","t":"class"},"Event: 'open'":{"p":"modules.0.properties.0.events.0","t":"event"},"Class: fs.FSWatcher":{"p":"modules.0.classes.2","t":"class"},"watcher.close()":{"p":"modules.0.classes.2.methods.0","t":"method"},"Event: 'change'":{"p":"modules.0.classes.2.events.0","t":"event"},"Event: 'error'":{"p":"modules.0.classes.2.events.1","t":"event"},"fs.WriteStream":{"p":"modules.0.properties.0"},"file.bytesWritten":{"p":"modules.0.properties.0.properties.0"}},"dns.json":{"DNS":{"p":"modules.0","t":"module"},"dns.lookup(domain, [family], callback)":{"p":"modules.0.methods.0","t":"method"},"dns.resolve(domain, [rrtype], callback)":{"p":"modules.0.methods.1","t":"method"},"dns.resolve4(domain, callback)":{"p":"modules.0.methods.2","t":"method"},"dns.resolve6(domain, callback)":{"p":"modules.0.methods.3","t":"method"},"dns.resolveMx(domain, callback)":{"p":"modules.0.methods.4","t":"method"},"dns.resolveTxt(domain, callback)":{"p":"modules.0.methods.5","t":"method"},"dns.resolveSrv(domain, callback)":{"p":"modules.0.methods.6","t":"method"},"dns.resolveNs(domain, callback)":{"p":"modules.0.methods.7","t":"method"},"dns.resolveCname(domain, callback)":{"p":"modules.0.methods.8","t":"method"},"dns.reverse(ip, callback)":{"p":"modules.0.methods.9","t":"method"},"Error codes":{"p":"modules.0.modules.0","t":"module"}},"dgram.json":{"UDP / Datagram Sockets":{"p":"modules.0","t":"module"},"dgram.createSocket(type, [callback])":{"p":"modules.0.methods.0","t":"method"},"Returns: Socket object ":{"p":"modules.0.methods.0.signatures.0.return"},"`type` String. Either 'udp4' or 'udp6' ":{"p":"modules.0.methods.0.signatures.0.params.0"},"`callback` Function. Attached as a listener to `message` events. Optional ":{"p":"modules.0.methods.0.signatures.0.params.1"},"Class: Socket":{"p":"modules.0.classes.0","t":"class"},"Event: 'message'":{"p":"modules.0.classes.0.events.0","t":"event"},"Event: 'listening'":{"p":"modules.0.classes.0.events.1","t":"event"},"Event: 'close'":{"p":"modules.0.classes.0.events.2","t":"event"},"Event: 'error'":{"p":"modules.0.classes.0.events.3","t":"event"},"dgram.send(buf, offset, length, port, address, [callback])":{"p":"modules.0.classes.0.methods.0","t":"method"},"`buf` Buffer object. Message to be sent ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.0"},"`offset` Integer. Offset in the buffer where the message starts. ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.1"},"`length` Integer. Number of bytes in the message. ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.2"},"`port` Integer. destination port ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.3"},"`address` String. destination IP ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.4"},"`callback` Function. Callback when message is done being delivered. Optional. ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.5"},"dgram.bind(port, [address])":{"p":"modules.0.classes.0.methods.1","t":"method"},"`port` Integer ":{"p":"modules.0.classes.0.methods.1.signatures.0.params.0"},"`address` String, Optional ":{"p":"modules.0.classes.0.methods.1.signatures.0.params.1"},"dgram.close()":{"p":"modules.0.classes.0.methods.2","t":"method"},"dgram.address()":{"p":"modules.0.classes.0.methods.3","t":"method"},"dgram.setBroadcast(flag)":{"p":"modules.0.classes.0.methods.4","t":"method"},"`flag` Boolean ":{"p":"modules.0.classes.0.methods.7.signatures.0.params.0"},"dgram.setTTL(ttl)":{"p":"modules.0.classes.0.methods.5","t":"method"},"`ttl` Integer ":{"p":"modules.0.classes.0.methods.6.signatures.0.params.0"},"dgram.setMulticastTTL(ttl)":{"p":"modules.0.classes.0.methods.6","t":"method"},"dgram.setMulticastLoopback(flag)":{"p":"modules.0.classes.0.methods.7","t":"method"},"dgram.addMembership(multicastAddress, [multicastInterface])":{"p":"modules.0.classes.0.methods.8","t":"method"},"`multicastAddress` String ":{"p":"modules.0.classes.0.methods.9.signatures.0.params.0"},"`multicastInterface` String, Optional ":{"p":"modules.0.classes.0.methods.9.signatures.0.params.1"},"dgram.dropMembership(multicastAddress, [multicastInterface])":{"p":"modules.0.classes.0.methods.9","t":"method"}},"http.json":{"HTTP":{"p":"modules.0","t":"module"},"`STATUS_CODES` {Object} ":{"p":"modules.0.properties.0"},"http.globalAgent":{"p":"modules.0.properties.1"},"http.ClientResponse":{"p":"modules.0.properties.2"},"Event: 'data'":{"p":"modules.0.classes.1.events.0","t":"event"},"Event: 'end'":{"p":"modules.0.classes.1.events.1","t":"event"},"Event: 'close'":{"p":"modules.0.classes.2.events.0","t":"event"},"response.statusCode":{"p":"modules.0.classes.2.properties.0"},"response.httpVersion":{"p":"modules.0.properties.2.properties.1"},"response.headers":{"p":"modules.0.properties.2.properties.2"},"response.trailers":{"p":"modules.0.properties.2.properties.3"},"response.setEncoding([encoding])":{"p":"modules.0.properties.2.methods.0","t":"method"},"response.pause()":{"p":"modules.0.properties.2.methods.1","t":"method"},"response.resume()":{"p":"modules.0.properties.2.methods.2","t":"method"},"http.createServer([requestListener])":{"p":"modules.0.methods.0","t":"method"},"http.createClient([port], [host])":{"p":"modules.0.methods.1","t":"method"},"http.request(options, callback)":{"p":"modules.0.methods.2","t":"method"},"http.get(options, callback)":{"p":"modules.0.methods.3","t":"method"},"Class: http.Server":{"p":"modules.0.classes.0","t":"class"},"Event: 'request'":{"p":"modules.0.classes.0.events.0","t":"event"},"Event: 'connection'":{"p":"modules.0.classes.0.events.1","t":"event"},"Event: 'checkContinue'":{"p":"modules.0.classes.0.events.3","t":"event"},"Event: 'connect'":{"p":"modules.0.classes.4.events.2","t":"event"},"Event: 'upgrade'":{"p":"modules.0.classes.4.events.3","t":"event"},"Event: 'clientError'":{"p":"modules.0.classes.0.events.6","t":"event"},"server.listen(port, [hostname], [backlog], [callback])":{"p":"modules.0.classes.0.methods.0","t":"method"},"server.listen(path, [callback])":{"p":"modules.0.classes.0.methods.1","t":"method"},"server.listen(handle, [listeningListener])":{"p":"modules.0.classes.0.methods.2","t":"method"},"`handle` {Object} ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.0","t":"Object"},"`listeningListener` {Function} ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.1","t":"Function"},"server.close([cb])":{"p":"modules.0.classes.0.methods.3","t":"method"},"server.maxHeadersCount":{"p":"modules.0.classes.0.properties.0"},"Class: http.ServerRequest":{"p":"modules.0.classes.1","t":"class"},"request.method":{"p":"modules.0.classes.1.properties.0"},"request.url":{"p":"modules.0.classes.1.properties.1"},"request.headers":{"p":"modules.0.classes.1.properties.2"},"request.trailers":{"p":"modules.0.classes.1.properties.3"},"request.httpVersion":{"p":"modules.0.classes.1.properties.4"},"request.connection":{"p":"modules.0.classes.1.properties.5"},"request.setEncoding([encoding])":{"p":"modules.0.classes.1.methods.0","t":"method"},"request.pause()":{"p":"modules.0.classes.1.methods.1","t":"method"},"request.resume()":{"p":"modules.0.classes.1.methods.2","t":"method"},"Class: http.ServerResponse":{"p":"modules.0.classes.2","t":"class"},"response.writeContinue()":{"p":"modules.0.classes.2.methods.0","t":"method"},"response.writeHead(statusCode, [reasonPhrase], [headers])":{"p":"modules.0.classes.2.methods.1","t":"method"},"response.setHeader(name, value)":{"p":"modules.0.classes.2.methods.2","t":"method"},"response.getHeader(name)":{"p":"modules.0.classes.2.methods.3","t":"method"},"response.removeHeader(name)":{"p":"modules.0.classes.2.methods.4","t":"method"},"response.write(chunk, [encoding])":{"p":"modules.0.classes.2.methods.5","t":"method"},"response.addTrailers(headers)":{"p":"modules.0.classes.2.methods.6","t":"method"},"response.end([data], [encoding])":{"p":"modules.0.classes.2.methods.7","t":"method"},"response.sendDate":{"p":"modules.0.classes.2.properties.1"},"Class: http.Agent":{"p":"modules.0.classes.3","t":"class"},"agent.maxSockets":{"p":"modules.0.classes.3.properties.0"},"agent.sockets":{"p":"modules.0.classes.3.properties.1"},"agent.requests":{"p":"modules.0.classes.3.properties.2"},"Class: http.ClientRequest":{"p":"modules.0.classes.4","t":"class"},"Event 'response'":{"p":"modules.0.classes.4.events.0","t":"event"},"Event: 'socket'":{"p":"modules.0.classes.4.events.1","t":"event"},"Event: 'continue'":{"p":"modules.0.classes.4.events.4","t":"event"},"request.write(chunk, [encoding])":{"p":"modules.0.classes.4.methods.0","t":"method"},"request.end([data], [encoding])":{"p":"modules.0.classes.4.methods.1","t":"method"},"request.abort()":{"p":"modules.0.classes.4.methods.2","t":"method"},"request.setTimeout(timeout, [callback])":{"p":"modules.0.classes.4.methods.3","t":"method"},"request.setNoDelay([noDelay])":{"p":"modules.0.classes.4.methods.4","t":"method"},"request.setSocketKeepAlive([enable], [initialDelay])":{"p":"modules.0.classes.4.methods.5","t":"method"}},"https.json":{"HTTPS":{"p":"modules.0","t":"module"},"Class: https.Server":{"p":"modules.0.classes.0","t":"class"},"Class: https.Agent":{"p":"modules.0.classes.1","t":"class"},"https.createServer(options, [requestListener])":{"p":"modules.0.methods.0","t":"method"},"https.request(options, callback)":{"p":"modules.0.methods.1","t":"method"},"https.get(options, callback)":{"p":"modules.0.methods.2","t":"method"},"https.globalAgent":{"p":"modules.0.properties.0"}},"url.json":{"URL":{"p":"modules.0","t":"module"},"url.parse(urlStr, [parseQueryString], [slashesDenoteHost])":{"p":"modules.0.methods.0","t":"method"},"url.format(urlObj)":{"p":"modules.0.methods.1","t":"method"},"url.resolve(from, to)":{"p":"modules.0.methods.2","t":"method"}},"querystring.json":{"Query String":{"p":"modules.0","t":"module"},"querystring.stringify(obj, [sep], [eq])":{"p":"modules.0.methods.0","t":"method"},"querystring.parse(str, [sep], [eq], [options])":{"p":"modules.0.methods.1","t":"method"},"querystring.escape":{"p":"modules.0.properties.0"},"querystring.unescape":{"p":"modules.0.properties.1"}},"punycode.json":{"punycode":{"p":"modules.0","t":"module"},"punycode.decode(string)":{"p":"modules.0.methods.0","t":"method"},"punycode.encode(string)":{"p":"modules.0.methods.1","t":"method"},"punycode.toUnicode(domain)":{"p":"modules.0.methods.2","t":"method"},"punycode.toASCII(domain)":{"p":"modules.0.methods.3","t":"method"},"punycode.ucs2":{"p":"modules.0.properties.0"},"punycode.ucs2.decode(string)":{"p":"modules.0.properties.0.modules.0","t":"module"},"punycode.ucs2.encode(codePoints)":{"p":"modules.0.properties.0.modules.1","t":"module"},"punycode.version":{"p":"modules.0.properties.1"}},"net.json":{"net":{"p":"modules.0","t":"module"},"net.createServer([options], [connectionListener])":{"p":"modules.0.methods.0","t":"method"},"net.connect(options, [connectionListener])":{"p":"modules.0.methods.1","t":"method"},"net.createConnection(options, [connectionListener])":{"p":"modules.0.methods.2","t":"method"},"net.connect(port, [host], [connectListener])":{"p":"modules.0.methods.3","t":"method"},"net.createConnection(port, [host], [connectListener])":{"p":"modules.0.methods.4","t":"method"},"net.connect(path, [connectListener])":{"p":"modules.0.methods.5","t":"method"},"net.createConnection(path, [connectListener])":{"p":"modules.0.methods.6","t":"method"},"net.isIP(input)":{"p":"modules.0.methods.7","t":"method"},"net.isIPv4(input)":{"p":"modules.0.methods.8","t":"method"},"net.isIPv6(input)":{"p":"modules.0.methods.9","t":"method"},"Class: net.Server":{"p":"modules.0.classes.0","t":"class"},"server.listen(port, [host], [backlog], [listeningListener])":{"p":"modules.0.classes.0.methods.0","t":"method"},"server.listen(path, [listeningListener])":{"p":"modules.0.classes.0.methods.1","t":"method"},"server.listen(handle, [listeningListener])":{"p":"modules.0.classes.0.methods.2","t":"method"},"`handle` {Object} ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.0","t":"Object"},"`listeningListener` {Function} ":{"p":"modules.0.classes.0.methods.2.signatures.0.params.1","t":"Function"},"server.close([cb])":{"p":"modules.0.classes.0.methods.3","t":"method"},"server.address()":{"p":"modules.0.classes.0.methods.4","t":"method"},"server.maxConnections":{"p":"modules.0.classes.0.properties.0"},"server.connections":{"p":"modules.0.classes.0.properties.1"},"Event: 'listening'":{"p":"modules.0.classes.0.events.0","t":"event"},"Event: 'connection'":{"p":"modules.0.classes.0.events.1","t":"event"},"Event: 'close'":{"p":"modules.0.classes.1.events.6","t":"event"},"Event: 'error'":{"p":"modules.0.classes.1.events.5","t":"event"},"Class: net.Socket":{"p":"modules.0.classes.1","t":"class"},"new net.Socket([options])":{"p":"modules.0.classes.1.methods.0","t":"method"},"socket.connect(port, [host], [connectListener])":{"p":"modules.0.classes.1.methods.1","t":"method"},"socket.connect(path, [connectListener])":{"p":"modules.0.classes.1.methods.2","t":"method"},"socket.setEncoding([encoding])":{"p":"modules.0.classes.1.methods.3","t":"method"},"socket.write(data, [encoding], [callback])":{"p":"modules.0.classes.1.methods.4","t":"method"},"socket.end([data], [encoding])":{"p":"modules.0.classes.1.methods.5","t":"method"},"socket.destroy()":{"p":"modules.0.classes.1.methods.6","t":"method"},"socket.pause()":{"p":"modules.0.classes.1.methods.7","t":"method"},"socket.resume()":{"p":"modules.0.classes.1.methods.8","t":"method"},"socket.setTimeout(timeout, [callback])":{"p":"modules.0.classes.1.methods.9","t":"method"},"socket.setNoDelay([noDelay])":{"p":"modules.0.classes.1.methods.10","t":"method"},"socket.setKeepAlive([enable], [initialDelay])":{"p":"modules.0.classes.1.methods.11","t":"method"},"socket.address()":{"p":"modules.0.classes.1.methods.12","t":"method"},"socket.bufferSize":{"p":"modules.0.classes.1.properties.0"},"socket.remoteAddress":{"p":"modules.0.classes.1.properties.1"},"socket.remotePort":{"p":"modules.0.classes.1.properties.2"},"socket.bytesRead":{"p":"modules.0.classes.1.properties.3"},"socket.bytesWritten":{"p":"modules.0.classes.1.properties.4"},"Event: 'connect'":{"p":"modules.0.classes.1.events.0","t":"event"},"Event: 'data'":{"p":"modules.0.classes.1.events.1","t":"event"},"Event: 'end'":{"p":"modules.0.classes.1.events.2","t":"event"},"Event: 'timeout'":{"p":"modules.0.classes.1.events.3","t":"event"},"Event: 'drain'":{"p":"modules.0.classes.1.events.4","t":"event"}},"repl.json":{"REPL":{"p":"modules.0","t":"module"},"repl.start(options)":{"p":"modules.0.methods.0","t":"method"},"Event: 'exit'":{"p":"modules.0.methods.0.events.0","t":"event"},"REPL Features":{"p":"modules.0.miscs.0","t":"misc"}},"vm.json":{"Executing JavaScript":{"p":"modules.0","t":"module"},"Caveats":{"p":"modules.0.modules.0","t":"module"},"Sandboxes":{"p":"modules.0.modules.0.modules.0","t":"module"},"Globals":{"p":"modules.0.modules.0.modules.1","t":"module"},"vm.runInThisContext(code, [filename])":{"p":"modules.0.methods.0","t":"method"},"vm.runInNewContext(code, [sandbox], [filename])":{"p":"modules.0.methods.1","t":"method"},"vm.runInContext(code, context, [filename])":{"p":"modules.0.methods.2","t":"method"},"vm.createContext([initSandbox])":{"p":"modules.0.methods.3","t":"method"},"vm.createScript(code, [filename])":{"p":"modules.0.methods.4","t":"method"},"Class: Script":{"p":"modules.0.classes.0","t":"class"},"script.runInThisContext()":{"p":"modules.0.classes.0.methods.0","t":"method"},"script.runInNewContext([sandbox])":{"p":"modules.0.classes.0.methods.1","t":"method"}},"assert.json":{"Assert":{"p":"modules.0","t":"module"},"assert.fail(actual, expected, message, operator)":{"p":"modules.0.methods.0","t":"method"},"assert(value, message), assert.ok(value, [message])":{"p":"modules.0.methods.1","t":"method"},"assert.equal(actual, expected, [message])":{"p":"modules.0.methods.2","t":"method"},"assert.notEqual(actual, expected, [message])":{"p":"modules.0.methods.3","t":"method"},"assert.deepEqual(actual, expected, [message])":{"p":"modules.0.methods.4","t":"method"},"assert.notDeepEqual(actual, expected, [message])":{"p":"modules.0.methods.5","t":"method"},"assert.strictEqual(actual, expected, [message])":{"p":"modules.0.methods.6","t":"method"},"assert.notStrictEqual(actual, expected, [message])":{"p":"modules.0.methods.7","t":"method"},"assert.throws(block, [error], [message])":{"p":"modules.0.methods.8","t":"method"},"assert.doesNotThrow(block, [error], [message])":{"p":"modules.0.methods.9","t":"method"},"assert.ifError(value)":{"p":"modules.0.methods.10","t":"method"}},"tty.json":{"TTY":{"p":"modules.0","t":"module"},"tty.isatty(fd)":{"p":"modules.0.methods.0","t":"method"},"tty.setRawMode(mode)":{"p":"modules.0.methods.1","t":"method"},"Class: ReadStream":{"p":"modules.0.classes.0","t":"class"},"rs.isRaw":{"p":"modules.0.classes.0.properties.0"},"rs.setRawMode(mode)":{"p":"modules.0.classes.0.methods.0","t":"method"},"Class WriteStream":{"p":"modules.0.modules.0","t":"module"},"ws.columns":{"p":"modules.0.modules.0.properties.0"},"ws.rows":{"p":"modules.0.modules.0.properties.1"},"Event: 'resize'":{"p":"modules.0.modules.0.events.0","t":"event"}},"addons.json":{"Addons":{"p":"modules.0","t":"module"},"Hello world":{"p":"modules.0.modules.0","t":"module"},"Addon patterns":{"p":"modules.0.modules.1","t":"module"},"Function arguments":{"p":"modules.0.modules.1.modules.0","t":"module"},"Callbacks":{"p":"modules.0.modules.1.modules.1","t":"module"},"Object factory":{"p":"modules.0.modules.1.modules.2","t":"module"},"Function factory":{"p":"modules.0.modules.1.modules.3","t":"module"},"Wrapping C++ objects":{"p":"modules.0.modules.1.modules.4","t":"module"},"Factory of wrapped objects":{"p":"modules.0.modules.1.modules.5","t":"module"},"Passing wrapped objects around":{"p":"modules.0.modules.1.modules.6","t":"module"}},"readline.json":{"Readline":{"p":"modules.0","t":"module"},"readline.createInterface(options)":{"p":"modules.0.methods.0","t":"method"},"Class: Interface":{"p":"modules.0.classes.0","t":"class"},"rl.setPrompt(prompt, length)":{"p":"modules.0.classes.0.methods.0","t":"method"},"rl.prompt([preserveCursor])":{"p":"modules.0.classes.0.methods.1","t":"method"},"rl.question(query, callback)":{"p":"modules.0.classes.0.methods.2","t":"method"},"rl.pause()":{"p":"modules.0.classes.0.methods.3","t":"method"},"rl.resume()":{"p":"modules.0.classes.0.methods.4","t":"method"},"rl.close()":{"p":"modules.0.classes.0.methods.5","t":"method"},"rl.write(data, [key])":{"p":"modules.0.classes.0.methods.6","t":"method"},"Events":{"p":"modules.0.modules.0","t":"module"},"Event: 'line'":{"p":"modules.0.modules.0.events.0","t":"event"},"Event: 'pause'":{"p":"modules.0.modules.0.events.1","t":"event"},"Event: 'resume'":{"p":"modules.0.modules.0.events.2","t":"event"},"Event: 'close'":{"p":"modules.0.modules.0.events.3","t":"event"},"Event: 'SIGINT'":{"p":"modules.0.modules.0.events.4","t":"event"},"Event: 'SIGTSTP'":{"p":"modules.0.modules.0.events.5","t":"event"},"Event: 'SIGCONT'":{"p":"modules.0.modules.0.events.6","t":"event"}},"zlib.json":{"Zlib":{"p":"modules.0","t":"module"},"zlib.createGzip([options])":{"p":"modules.0.methods.0","t":"method"},"zlib.createGunzip([options])":{"p":"modules.0.methods.1","t":"method"},"zlib.createDeflate([options])":{"p":"modules.0.methods.2","t":"method"},"zlib.createInflate([options])":{"p":"modules.0.methods.3","t":"method"},"zlib.createDeflateRaw([options])":{"p":"modules.0.methods.4","t":"method"},"zlib.createInflateRaw([options])":{"p":"modules.0.methods.5","t":"method"},"zlib.createUnzip([options])":{"p":"modules.0.methods.6","t":"method"},"zlib.deflate(buf, callback)":{"p":"modules.0.methods.7","t":"method"},"zlib.deflateRaw(buf, callback)":{"p":"modules.0.methods.8","t":"method"},"zlib.gzip(buf, callback)":{"p":"modules.0.methods.9","t":"method"},"zlib.gunzip(buf, callback)":{"p":"modules.0.methods.10","t":"method"},"zlib.inflate(buf, callback)":{"p":"modules.0.methods.11","t":"method"},"zlib.inflateRaw(buf, callback)":{"p":"modules.0.methods.12","t":"method"},"zlib.unzip(buf, callback)":{"p":"modules.0.methods.13","t":"method"},"Class: zlib.Gzip":{"p":"modules.0.classes.0","t":"class"},"Class: zlib.Gunzip":{"p":"modules.0.classes.1","t":"class"},"Class: zlib.Deflate":{"p":"modules.0.classes.2","t":"class"},"Class: zlib.Inflate":{"p":"modules.0.classes.3","t":"class"},"Class: zlib.DeflateRaw":{"p":"modules.0.classes.4","t":"class"},"Class: zlib.InflateRaw":{"p":"modules.0.classes.5","t":"class"},"Class: zlib.Unzip":{"p":"modules.0.classes.6","t":"class"},"Convenience Methods":{"p":"modules.0.miscs.0","t":"misc"},"Options":{"p":"modules.0.miscs.1","t":"misc"},"Memory Usage Tuning":{"p":"modules.0.miscs.2","t":"misc"},"Constants":{"p":"modules.0.miscs.3","t":"misc"}},"os.json":{"os":{"p":"modules.0","t":"module"},"os.tmpDir()":{"p":"modules.0.methods.0","t":"method"},"os.hostname()":{"p":"modules.0.methods.1","t":"method"},"os.type()":{"p":"modules.0.methods.2","t":"method"},"os.platform()":{"p":"modules.0.methods.3","t":"method"},"os.arch()":{"p":"modules.0.methods.4","t":"method"},"os.release()":{"p":"modules.0.methods.5","t":"method"},"os.uptime()":{"p":"modules.0.methods.6","t":"method"},"os.loadavg()":{"p":"modules.0.methods.7","t":"method"},"os.totalmem()":{"p":"modules.0.methods.8","t":"method"},"os.freemem()":{"p":"modules.0.methods.9","t":"method"},"os.cpus()":{"p":"modules.0.methods.10","t":"method"},"os.networkInterfaces()":{"p":"modules.0.methods.11","t":"method"},"os.EOL":{"p":"modules.0.properties.0"}},"appendix_1.json":{"Appendix 1 - Third Party Modules":{"p":"modules.0","t":"module"}},"debugger.json":{"Debugger":{"p":"miscs.0","t":"misc"},"Watchers":{"p":"miscs.0.miscs.0","t":"misc"},"Commands reference":{"p":"miscs.0.miscs.1","t":"misc"},"Execution control":{"p":"miscs.0.miscs.1.modules.0","t":"module"},"Various":{"p":"miscs.0.miscs.1.modules.1","t":"module"},"Advanced Usage":{"p":"miscs.0.miscs.2","t":"misc"}},"child_process.json":{"Child Process":{"p":"modules.0","t":"module"},"Class: ChildProcess":{"p":"modules.0.classes.0","t":"class"},"Event: 'exit'":{"p":"modules.0.classes.0.events.0","t":"event"},"Event: 'close'":{"p":"modules.0.classes.0.events.1","t":"event"},"Event: 'disconnect'":{"p":"modules.0.classes.0.events.2","t":"event"},"Event: 'message'":{"p":"modules.0.classes.0.events.3","t":"event"},"`stdin` {Stream object} ":{"p":"modules.0.classes.0.properties.0"},"`stdout` {Stream object} ":{"p":"modules.0.classes.0.properties.1"},"`stderr` {Stream object} ":{"p":"modules.0.classes.0.properties.2"},"`pid` {Integer} ":{"p":"modules.0.classes.0.properties.3"},"child.kill([signal])":{"p":"modules.0.classes.0.methods.0","t":"method"},"`signal` {String} ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.0","t":"String"},"child.send(message, [sendHandle])":{"p":"modules.0.classes.0.methods.1","t":"method"},"`message` {Object} ":{"p":"modules.0.classes.0.methods.1.signatures.0.params.0","t":"Object"},"`sendHandle` {Handle object} ":{"p":"modules.0.classes.0.methods.1.signatures.0.params.1","t":"Handle object"},"child.disconnect()":{"p":"modules.0.classes.0.methods.2","t":"method"},"child_process.spawn(command, [args], [options])":{"p":"modules.0.methods.0","t":"method"},"return: {ChildProcess object} ":{"p":"modules.0.methods.0.signatures.0.return","t":"ChildProcess object"},"`command` {String} The command to run ":{"p":"modules.0.methods.0.signatures.0.params.0","t":"String"},"`args` {Array} List of string arguments ":{"p":"modules.0.methods.3.signatures.0.params.1","t":"Array"},"`options` {Object} ":{"p":"modules.0.methods.3.signatures.0.params.2","t":"Object"},"`cwd` {String} Current working directory of the child process ":{"p":"modules.0.methods.3.signatures.0.params.2.options.0","t":"String"},"`stdio` {Array|String} Child's stdio configuration. (See below) ":{"p":"modules.0.methods.0.signatures.0.params.2.options.1","t":"Array|String"},"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See below) ":{"p":"modules.0.methods.0.signatures.0.params.2.options.2","t":"Array"},"`env` {Object} Environment key-value pairs ":{"p":"modules.0.methods.3.signatures.0.params.2.options.1","t":"Object"},"`detached` {Boolean} The child will be a process group leader. (See below) ":{"p":"modules.0.methods.0.signatures.0.params.2.options.4","t":"Boolean"},"child_process.exec(command, [options], callback)":{"p":"modules.0.methods.1","t":"method"},"Return: ChildProcess object ":{"p":"modules.0.methods.3.signatures.0.return"},"`command` {String} The command to run, with space-separated arguments ":{"p":"modules.0.methods.1.signatures.0.params.0","t":"String"},"`stdio` {Array|String} Child's stdio configuration. (See above) ":{"p":"modules.0.methods.2.signatures.0.params.2.options.1","t":"Array|String"},"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See above) ":{"p":"modules.0.methods.2.signatures.0.params.2.options.2","t":"Array"},"`encoding` {String} (Default: 'utf8') ":{"p":"modules.0.methods.3.signatures.0.params.2.options.2","t":"String"},"`timeout` {Number} (Default: 0) ":{"p":"modules.0.methods.3.signatures.0.params.2.options.3","t":"Number"},"`maxBuffer` {Number} (Default: 200*1024) ":{"p":"modules.0.methods.1.signatures.0.params.1.options.6","t":"Number"},"`killSignal` {String} (Default: 'SIGTERM') ":{"p":"modules.0.methods.2.signatures.0.params.2.options.7","t":"String"},"`callback` {Function} called with the output when process terminates ":{"p":"modules.0.methods.2.signatures.0.params.3","t":"Function"},"`error` {Error} ":{"p":"modules.0.methods.2.signatures.0.params.3.options.0","t":"Error"},"`stdout` {Buffer} ":{"p":"modules.0.methods.2.signatures.0.params.3.options.1","t":"Buffer"},"`stderr` {Buffer} ":{"p":"modules.0.methods.2.signatures.0.params.3.options.2","t":"Buffer"},"child_process.execFile(file, args, options, callback)":{"p":"modules.0.methods.2","t":"method"},"`file` {String} The filename of the program to run ":{"p":"modules.0.methods.2.signatures.0.params.0","t":"String"},"`maxBuffer` {Number} (Default: 200\\*1024) ":{"p":"modules.0.methods.2.signatures.0.params.2.options.6","t":"Number"},"child\\_process.fork(modulePath, [args], [options])":{"p":"modules.0.methods.3","t":"method"},"`modulePath` {String} The module to run in the child ":{"p":"modules.0.methods.3.signatures.0.params.0","t":"String"}},"cluster.json":{"Cluster":{"p":"modules.0","t":"module"},"How It Works":{"p":"modules.0.miscs.0","t":"misc"},"`settings` {Object} ":{"p":"modules.0.methods.0.signatures.0.params.0","t":"Object"},"`exec` {String} file path to worker file. (Default=`__filename`) ":{"p":"modules.0.methods.0.signatures.0.params.0.options.0","t":"String"},"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ":{"p":"modules.0.methods.0.signatures.0.params.0.options.1","t":"Array"},"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ":{"p":"modules.0.methods.0.signatures.0.params.0.options.2","t":"Boolean"},"`isMaster` {Boolean} ":{"p":"modules.0.properties.1"},"`isWorker` {Boolean} ":{"p":"modules.0.properties.2"},"`exec` {String} file path to worker file. Default: `__filename` ":{"p":"modules.0.properties.3.options.0","t":"String"},"`workers` {Object} ":{"p":"modules.0.properties.4"},"Event: 'fork'":{"p":"modules.0.events.0","t":"event"},"Event: 'online'":{"p":"modules.0.classes.0.events.1","t":"event"},"Event: 'listening'":{"p":"modules.0.classes.0.events.2","t":"event"},"Event: 'disconnect'":{"p":"modules.0.classes.0.events.3","t":"event"},"Event: 'exit'":{"p":"modules.0.classes.0.events.4","t":"event"},"Event: 'setup'":{"p":"modules.0.events.5","t":"event"},"cluster.setupMaster([settings])":{"p":"modules.0.methods.0","t":"method"},"cluster.fork([env])":{"p":"modules.0.methods.1","t":"method"},"return {Worker object} ":{"p":"modules.0.methods.1.signatures.0.return","t":"Worker object"},"`env` {Object} Key/value pairs to add to child process environment. ":{"p":"modules.0.methods.1.signatures.0.params.0","t":"Object"},"cluster.disconnect([callback])":{"p":"modules.0.methods.2","t":"method"},"`callback` {Function} called when all workers are disconnected and handlers are closed ":{"p":"modules.0.methods.2.signatures.0.params.0","t":"Function"},"Class: Worker":{"p":"modules.0.classes.0","t":"class"},"`id` {String} ":{"p":"modules.0.classes.0.properties.0"},"`process` {ChildProcess object} ":{"p":"modules.0.classes.0.properties.1"},"`suicide` {Boolean} ":{"p":"modules.0.classes.0.properties.2"},"worker.send(message, [sendHandle])":{"p":"modules.0.classes.0.methods.0","t":"method"},"`message` {Object} ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.0","t":"Object"},"`sendHandle` {Handle object} ":{"p":"modules.0.classes.0.methods.0.signatures.0.params.1","t":"Handle object"},"worker.destroy()":{"p":"modules.0.classes.0.methods.1","t":"method"},"worker.disconnect()":{"p":"modules.0.classes.0.methods.2","t":"method"},"Event: 'message'":{"p":"modules.0.classes.0.events.0","t":"event"}}}
View
1 public/json/0.8.1/net.json
@@ -1 +0,0 @@
-{"source":"doc/api/net.markdown","modules":[{"textRaw":"net","name":"net","stability":3,"stabilityText":"Stable","desc":"<p>The <code>net</code> module provides you with an asynchronous network wrapper. It contains\nmethods for creating both servers and clients (called streams). You can include\nthis module with <code>require(&apos;net&apos;);</code>\n\n</p>\n","methods":[{"textRaw":"net.createServer([options], [connectionListener])","type":"method","name":"createServer","desc":"<p>Creates a new TCP server. The <code>connectionListener</code> argument is\nautomatically set as a listener for the [&apos;connection&apos;][] event.\n\n</p>\n<p><code>options</code> is an object with the following defaults:\n\n</p>\n<pre><code>{ allowHalfOpen: false\n}</code></pre>\n<p>If <code>allowHalfOpen</code> is <code>true</code>, then the socket won&apos;t automatically send a 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 <code>end()</code> method explicitly.\nSee [&apos;end&apos;][] event for more information.\n\n</p>\n<p>Here is an example of a echo server which listens for connections\non port 8124:\n\n</p>\n<pre><code>var net = require(&apos;net&apos;);\nvar server = net.createServer(function(c) { //&apos;connection&apos; listener\n console.log(&apos;server connected&apos;);\n c.on(&apos;end&apos;, function() {\n console.log(&apos;server disconnected&apos;);\n });\n c.write(&apos;hello\\r\\n&apos;);\n c.pipe(c);\n});\nserver.listen(8124, function() { //&apos;listening&apos; listener\n console.log(&apos;server bound&apos;);\n});</code></pre>\n<p>Test this by using <code>telnet</code>:\n\n</p>\n<pre><code>telnet localhost 8124</code></pre>\n<p>To listen on the socket <code>/tmp/echo.sock</code> the third line from the last would\njust be changed to\n\n</p>\n<pre><code>server.listen(&apos;/tmp/echo.sock&apos;, function() { //&apos;listening&apos; listener</code></pre>\n<p>Use <code>nc</code> to connect to a UNIX domain socket server:\n\n</p>\n<pre><code>nc -U /tmp/echo.sock</code></pre>\n","signatures":[{"params":[{"name":"options","optional":true},{"name":"connectionListener","optional":true}]}]},{"textRaw":"net.connect(options, [connectionListener])","type":"method","name":"connect","desc":"<p>Constructs a new socket object and opens the socket to the given location.\nWhen the socket is established, the [&apos;connect&apos;][] event will be emitted.\n\n</p>\n<p>For TCP sockets, <code>options</code> argument should be an object which specifies:\n\n</p>\n<ul>\n<li><p><code>port</code>: Port the client should connect to (Required).</p>\n</li>\n<li><p><code>host</code>: Host the client should connect to. Defaults to <code>&apos;localhost&apos;</code>.</p>\n</li>\n<li><p><code>localAddress</code>: Local interface to bind to for network connections.</p>\n</li>\n</ul>\n<p>For UNIX domain sockets, <code>options</code> argument should be an object which specifies:\n\n</p>\n<ul>\n<li><code>path</code>: Path the client should connect to (Required).</li>\n</ul>\n<p>Common options are:\n\n</p>\n<ul>\n<li><code>allowHalfOpen</code>: if <code>true</code>, the socket won&apos;t automatically send\na FIN packet when the other end of the socket sends a FIN packet.\nDefaults to <code>false</code>. See [&apos;end&apos;][] event for more information.</li>\n</ul>\n<p>The <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n</p>\n<p>Here is an example of a client of echo server as described previously:\n\n</p>\n<pre><code>var net = require(&apos;net&apos;);\nvar client = net.connect({port: 8124},\n function() { //&apos;connect&apos; listener\n console.log(&apos;client connected&apos;);\n client.write(&apos;world!\\r\\n&apos;);\n});\nclient.on(&apos;data&apos;, function(data) {\n console.log(data.toString());\n client.end();\n});\nclient.on(&apos;end&apos;, function() {\n console.log(&apos;client disconnected&apos;);\n});</code></pre>\n<p>To connect on the socket <code>/tmp/echo.sock</code> the second line would just be\nchanged to\n\n</p>\n<pre><code>var client = net.connect({path: &apos;/tmp/echo.sock&apos;},</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"connectionListener","optional":true}]},{"params":[{"name":"options"},{"name":"connectionListener","optional":true}]}]},{"textRaw":"net.createConnection(options, [connectionListener])","type":"method","name":"createConnection","desc":"<p>Constructs a new socket object and opens the socket to the given location.\nWhen the socket is established, the [&apos;connect&apos;][] event will be emitted.\n\n</p>\n<p>For TCP sockets, <code>options</code> argument should be an object which specifies:\n\n</p>\n<ul>\n<li><p><code>port</code>: Port the client should connect to (Required).</p>\n</li>\n<li><p><code>host</code>: Host the client should connect to. Defaults to <code>&apos;localhost&apos;</code>.</p>\n</li>\n<li><p><code>localAddress</code>: Local interface to bind to for network connections.</p>\n</li>\n</ul>\n<p>For UNIX domain sockets, <code>options</code> argument should be an object which specifies:\n\n</p>\n<ul>\n<li><code>path</code>: Path the client should connect to (Required).</li>\n</ul>\n<p>Common options are:\n\n</p>\n<ul>\n<li><code>allowHalfOpen</code>: if <code>true</code>, the socket won&apos;t automatically send\na FIN packet when the other end of the socket sends a FIN packet.\nDefaults to <code>false</code>. See [&apos;end&apos;][] event for more information.</li>\n</ul>\n<p>The <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n</p>\n<p>Here is an example of a client of echo server as described previously:\n\n</p>\n<pre><code>var net = require(&apos;net&apos;);\nvar client = net.connect({port: 8124},\n function() { //&apos;connect&apos; listener\n console.log(&apos;client connected&apos;);\n client.write(&apos;world!\\r\\n&apos;);\n});\nclient.on(&apos;data&apos;, function(data) {\n console.log(data.toString());\n client.end();\n});\nclient.on(&apos;end&apos;, function() {\n console.log(&apos;client disconnected&apos;);\n});</code></pre>\n<p>To connect on the socket <code>/tmp/echo.sock</code> the second line would just be\nchanged to\n\n</p>\n<pre><code>var client = net.connect({path: &apos;/tmp/echo.sock&apos;},</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"connectionListener","optional":true}]}]},{"textRaw":"net.connect(port, [host], [connectListener])","type":"method","name":"connect","desc":"<p>Creates a TCP connection to <code>port</code> on <code>host</code>. If <code>host</code> is omitted,\n<code>&apos;localhost&apos;</code> will be assumed.\nThe <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n</p>\n","signatures":[{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"connectListener","optional":true}]},{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"connectListener","optional":true}]}]},{"textRaw":"net.createConnection(port, [host], [connectListener])","type":"method","name":"createConnection","desc":"<p>Creates a TCP connection to <code>port</code> on <code>host</code>. If <code>host</code> is omitted,\n<code>&apos;localhost&apos;</code> will be assumed.\nThe <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n</p>\n","signatures":[{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"connectListener","optional":true}]}]},{"textRaw":"net.connect(path, [connectListener])","type":"method","name":"connect","desc":"<p>Creates unix socket connection to <code>path</code>.\nThe <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"connectListener","optional":true}]},{"params":[{"name":"path"},{"name":"connectListener","optional":true}]}]},{"textRaw":"net.createConnection(path, [connectListener])","type":"method","name":"createConnection","desc":"<p>Creates unix socket connection to <code>path</code>.\nThe <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"connectListener","optional":true}]}]},{"textRaw":"net.isIP(input)","type":"method","name":"isIP","desc":"<p>Tests if input is an IP address. Returns 0 for invalid strings,\nreturns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.\n\n\n</p>\n","signatures":[{"params":[{"name":"input"}]}]},{"textRaw":"net.isIPv4(input)","type":"method","name":"isIPv4","desc":"<p>Returns true if input is a version 4 IP address, otherwise returns false.\n\n\n</p>\n","signatures":[{"params":[{"name":"input"}]}]},{"textRaw":"net.isIPv6(input)","type":"method","name":"isIPv6","desc":"<p>Returns true if input is a version 6 IP address, otherwise returns false.\n\n</p>\n","signatures":[{"params":[{"name":"input"}]}]}],"classes":[{"textRaw":"Class: net.Server","type":"class","name":"net.Server","desc":"<p>This class is used to create a TCP or UNIX server.\nA server is a <code>net.Socket</code> that can listen for new incoming connections.\n\n</p>\n","methods":[{"textRaw":"server.listen(port, [host], [backlog], [listeningListener])","type":"method","name":"listen","desc":"<p>Begin accepting connections on the specified <code>port</code> and <code>host</code>. If the\n<code>host</code> is omitted, the server will accept connections directed to any\nIPv4 address (<code>INADDR_ANY</code>). A port value of zero will assign a random port.\n\n</p>\n<p>Backlog is the maximum length of the queue of pending connections.\nThe actual length will be determined by your OS through sysctl settings such as\n<code>tcp_max_syn_backlog</code> and <code>somaxconn</code> on linux. The default value of this\nparameter is 511 (not 512).\n\n</p>\n<p>This function is asynchronous. When the server has been bound,\n[&apos;listening&apos;][] event will be emitted. The last parameter <code>listeningListener</code>\nwill be added as an listener for the [&apos;listening&apos;][] event.\n\n</p>\n<p>One issue some users run into is getting <code>EADDRINUSE</code> errors. This means that\nanother server is already running on the requested port. One way of handling this\nwould be to wait a second and then try again. This can be done with\n\n</p>\n<pre><code>server.on(&apos;error&apos;, function (e) {\n if (e.code == &apos;EADDRINUSE&apos;) {\n console.log(&apos;Address in use, retrying...&apos;);\n setTimeout(function () {\n server.close();\n server.listen(PORT, HOST);\n }, 1000);\n }\n});</code></pre>\n<p>(Note: All sockets in Node set <code>SO_REUSEADDR</code> already)\n\n\n</p>\n","signatures":[{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"backlog","optional":true},{"name":"listeningListener","optional":true}]}]},{"textRaw":"server.listen(path, [listeningListener])","type":"method","name":"listen","desc":"<p>Start a UNIX socket server listening for connections on the given <code>path</code>.\n\n</p>\n<p>This function is asynchronous. When the server has been bound,\n[&apos;listening&apos;][] event will be emitted. The last parameter <code>listeningListener</code>\nwill be added as an listener for the [&apos;listening&apos;][] event.\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"listeningListener","optional":true}]}]},{"textRaw":"server.listen(handle, [listeningListener])","type":"method","name":"listen","signatures":[{"params":[{"textRaw":"`handle` {Object} ","name":"handle","type":"Object"},{"textRaw":"`listeningListener` {Function} ","name":"listeningListener","type":"Function","optional":true}]},{"params":[{"name":"handle"},{"name":"listeningListener","optional":true}]}],"desc":"<p>The <code>handle</code> object can be set to either a server or socket (anything\nwith an underlying <code>_handle</code> member), or a <code>{fd: &lt;n&gt;}</code> object.\n\n</p>\n<p>This will cause the server to accept connections on the specified\nhandle, but it is presumed that the file descriptor or handle has\nalready been bound to a port or domain socket.\n\n</p>\n<p>Listening on a file descriptor is not supported on Windows.\n\n</p>\n<p>This function is asynchronous. When the server has been bound,\n<a href=\"#event_listening_\">&apos;listening&apos;</a> event will be emitted.\nthe last parameter <code>listeningListener</code> will be added as an listener for the\n<a href=\"#event_listening_\">&apos;listening&apos;</a> event.\n\n</p>\n"},{"textRaw":"server.close([cb])","type":"method","name":"close","desc":"<p>Stops the server from accepting new connections and keeps existing\nconnections. This function is asynchronous, the server is finally\nclosed when all connections are ended and the server emits a <code>&apos;close&apos;</code>\nevent. Optionally, you can pass a callback to listen for the <code>&apos;close&apos;</code>\nevent.\n\n</p>\n","signatures":[{"params":[{"name":"cb","optional":true}]}]},{"textRaw":"server.address()","type":"method","name":"address","desc":"<p>Returns the bound address, the address family name and port of the server\nas reported by the operating system.\nUseful to find which port was assigned when giving getting an OS-assigned address.\nReturns an object with three properties, e.g.\n<code>{ port: 12346, family: &apos;IPv4&apos;, address: &apos;127.0.0.1&apos; }</code>\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var server = net.createServer(function (socket) {\n socket.end(&quot;goodbye\\n&quot;);\n});\n\n// grab a random port.\nserver.listen(function() {\n address = server.address();\n console.log(&quot;opened server on %j&quot;, address);\n});</code></pre>\n<p>Don&apos;t call <code>server.address()</code> until the <code>&apos;listening&apos;</code> event has been emitted.\n\n</p>\n","signatures":[{"params":[]}]}],"properties":[{"textRaw":"server.maxConnections","name":"maxConnections","desc":"<p>Set this property to reject connections when the server&apos;s connection count gets\nhigh.\n\n</p>\n<p>It is not recommended to use this option once a socket has been sent to a child\nwith <code>child_process.fork()</code>.\n\n</p>\n"},{"textRaw":"server.connections","name":"connections","desc":"<p>The number of concurrent connections on the server.\n\n</p>\n<p>This becomes <code>null</code> when sending a socket to a child with <code>child_process.fork()</code>.\n\n</p>\n<p><code>net.Server</code> is an [EventEmitter][] with the following events:\n\n</p>\n"}],"events":[{"textRaw":"Event: 'listening'","type":"event","name":"listening","desc":"<p>Emitted when the server has been bound after calling <code>server.listen</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'connection'","type":"event","name":"connection","params":[],"desc":"<p>Emitted when a new connection is made. <code>socket</code> is an instance of\n<code>net.Socket</code>.\n\n</p>\n"},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p>Emitted when the server closes. Note that if connections exist, this\nevent is not emitted until all connections are ended.\n\n</p>\n","params":[]},{"textRaw":"Event: 'error'","type":"event","name":"error","params":[],"desc":"<p>Emitted when an error occurs. The <code>&apos;close&apos;</code> event will be called directly\nfollowing this event. See example in discussion of <code>server.listen</code>.\n\n</p>\n"}]},{"textRaw":"Class: net.Socket","type":"class","name":"net.Socket","desc":"<p>This object is an abstraction of a TCP or UNIX socket. <code>net.Socket</code>\ninstances implement a duplex Stream interface. They can be created by the\nuser and used as a client (with <code>connect()</code>) or they can be created by Node\nand passed to the user through the <code>&apos;connection&apos;</code> event of a server.\n\n</p>\n","methods":[{"textRaw":"new net.Socket([options])","type":"method","name":"Socket","desc":"<p>Construct a new socket object.\n\n</p>\n<p><code>options</code> is an object with the following defaults:\n\n</p>\n<pre><code>{ fd: null\n type: null\n allowHalfOpen: false\n}</code></pre>\n<p><code>fd</code> allows you to specify the existing file descriptor of socket. <code>type</code>\nspecified underlying protocol. It can be <code>&apos;tcp4&apos;</code>, <code>&apos;tcp6&apos;</code>, or <code>&apos;unix&apos;</code>.\nAbout <code>allowHalfOpen</code>, refer to <code>createServer()</code> and <code>&apos;end&apos;</code> event.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"socket.connect(port, [host], [connectListener])","type":"method","name":"connect","desc":"<p>Opens the connection for a given socket. If <code>port</code> and <code>host</code> are given,\nthen the socket will be opened as a TCP socket, if <code>host</code> is omitted,\n<code>localhost</code> will be assumed. If a <code>path</code> is given, the socket will be\nopened as a unix socket to that path.\n\n</p>\n<p>Normally this method is not needed, as <code>net.createConnection</code> opens the\nsocket. Use this only if you are implementing a custom Socket or if a\nSocket is closed and you want to reuse it to connect to another server.\n\n</p>\n<p>This function is asynchronous. When the [&apos;connect&apos;][] event is emitted the\nsocket is established. If there is a problem connecting, the <code>&apos;connect&apos;</code> event\nwill not be emitted, the <code>&apos;error&apos;</code> event will be emitted with the exception.\n\n</p>\n<p>The <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"connectListener","optional":true}]},{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"connectListener","optional":true}]}]},{"textRaw":"socket.connect(path, [connectListener])","type":"method","name":"connect","desc":"<p>Opens the connection for a given socket. If <code>port</code> and <code>host</code> are given,\nthen the socket will be opened as a TCP socket, if <code>host</code> is omitted,\n<code>localhost</code> will be assumed. If a <code>path</code> is given, the socket will be\nopened as a unix socket to that path.\n\n</p>\n<p>Normally this method is not needed, as <code>net.createConnection</code> opens the\nsocket. Use this only if you are implementing a custom Socket or if a\nSocket is closed and you want to reuse it to connect to another server.\n\n</p>\n<p>This function is asynchronous. When the [&apos;connect&apos;][] event is emitted the\nsocket is established. If there is a problem connecting, the <code>&apos;connect&apos;</code> event\nwill not be emitted, the <code>&apos;error&apos;</code> event will be emitted with the exception.\n\n</p>\n<p>The <code>connectListener</code> parameter will be added as an listener for the\n[&apos;connect&apos;][] event.\n\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"connectListener","optional":true}]}]},{"textRaw":"socket.setEncoding([encoding])","type":"method","name":"setEncoding","desc":"<p>Set the encoding for the socket as a Readable Stream. See\n[stream.setEncoding()][] for more information.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"socket.write(data, [encoding], [callback])","type":"method","name":"write","desc":"<p>Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string--it defaults to UTF8 encoding.\n\n</p>\n<p>Returns <code>true</code> if the entire data was flushed successfully to the kernel\nbuffer. Returns <code>false</code> if all or part of the data was queued in user memory.\n<code>&apos;drain&apos;</code> will be emitted when the buffer is again free.\n\n</p>\n<p>The optional <code>callback</code> parameter will be executed when the data is finally\nwritten out - this may not be immediately.\n\n</p>\n","signatures":[{"params":[{"name":"data"},{"name":"encoding","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"socket.end([data], [encoding])","type":"method","name":"end","desc":"<p>Half-closes the socket. i.e., it sends a FIN packet. It is possible the\nserver will still send some data.\n\n</p>\n<p>If <code>data</code> is specified, it is equivalent to calling\n<code>socket.write(data, encoding)</code> followed by <code>socket.end()</code>.\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"encoding","optional":true}]}]},{"textRaw":"socket.destroy()","type":"method","name":"destroy","desc":"<p>Ensures that no more I/O activity happens on this socket. Only necessary in\ncase of errors (parse error or so).\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"socket.pause()","type":"method","name":"pause","desc":"<p>Pauses the reading of data. That is, <code>&apos;data&apos;</code> events will not be emitted.\nUseful to throttle back an upload.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"socket.resume()","type":"method","name":"resume","desc":"<p>Resumes reading after a call to <code>pause()</code>.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"socket.setTimeout(timeout, [callback])","type":"method","name":"setTimeout","desc":"<p>Sets the socket to timeout after <code>timeout</code> milliseconds of inactivity on\nthe socket. By default <code>net.Socket</code> do not have a timeout.\n\n</p>\n<p>When an idle timeout is triggered the socket will receive a <code>&apos;timeout&apos;</code>\nevent but the connection will not be severed. The user must manually <code>end()</code>\nor <code>destroy()</code> the socket.\n\n</p>\n<p>If <code>timeout</code> is 0, then the existing idle timeout is disabled.\n\n</p>\n<p>The optional <code>callback</code> parameter will be added as a one time listener for the\n<code>&apos;timeout&apos;</code> event.\n\n</p>\n","signatures":[{"params":[{"name":"timeout"},{"name":"callback","optional":true}]}]},{"textRaw":"socket.setNoDelay([noDelay])","type":"method","name":"setNoDelay","desc":"<p>Disables the Nagle algorithm. By default TCP connections use the Nagle\nalgorithm, they buffer data before sending it off. Setting <code>true</code> for\n<code>noDelay</code> will immediately fire off data each time <code>socket.write()</code> is called.\n<code>noDelay</code> defaults to <code>true</code>.\n\n</p>\n","signatures":[{"params":[{"name":"noDelay","optional":true}]}]},{"textRaw":"socket.setKeepAlive([enable], [initialDelay])","type":"method","name":"setKeepAlive","desc":"<p>Enable/disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.\n<code>enable</code> defaults to <code>false</code>.\n\n</p>\n<p>Set <code>initialDelay</code> (in milliseconds) to set the delay between the last\ndata packet received and the first keepalive probe. Setting 0 for\ninitialDelay will leave the value unchanged from the default\n(or previous) setting. Defaults to <code>0</code>.\n\n</p>\n","signatures":[{"params":[{"name":"enable","optional":true},{"name":"initialDelay","optional":true}]}]},{"textRaw":"socket.address()","type":"method","name":"address","desc":"<p>Returns the bound address, the address family name and port of the\nsocket as reported by the operating system. Returns an object with\nthree properties, e.g.\n<code>{ port: 12346, family: &apos;IPv4&apos;, address: &apos;127.0.0.1&apos; }</code>\n\n</p>\n","signatures":[{"params":[]}]}],"properties":[{"textRaw":"socket.bufferSize","name":"bufferSize","desc":"<p><code>net.Socket</code> has the property that <code>socket.write()</code> always works. This is to\nhelp users get up and running quickly. The computer cannot always keep up\nwith the amount of data that is written to a socket - the network connection\nsimply might be too slow. Node will internally queue up the data written to a\nsocket and send it out over the wire when it is possible. (Internally it is\npolling on the socket&apos;s file descriptor for being writable).\n\n</p>\n<p>The consequence of this internal buffering is that memory may grow. This\nproperty shows the number of characters currently buffered to be written.\n(Number of characters is approximately equal to the number of bytes to be\nwritten, but the buffer may contain strings, and the strings are lazily\nencoded, so the exact number of bytes is not known.)\n\n</p>\n<p>Users who experience large or growing <code>bufferSize</code> should attempt to\n&quot;throttle&quot; the data flows in their program with <code>pause()</code> and <code>resume()</code>.\n\n\n</p>\n"},{"textRaw":"socket.remoteAddress","name":"remoteAddress","desc":"<p>The string representation of the remote IP address. For example,\n<code>&apos;74.125.127.100&apos;</code> or <code>&apos;2001:4860:a005::68&apos;</code>.\n\n</p>\n"},{"textRaw":"socket.remotePort","name":"remotePort","desc":"<p>The numeric representation of the remote port. For example,\n<code>80</code> or <code>21</code>.\n\n</p>\n"},{"textRaw":"socket.bytesRead","name":"bytesRead","desc":"<p>The amount of received bytes.\n\n</p>\n"},{"textRaw":"socket.bytesWritten","name":"bytesWritten","desc":"<p>The amount of bytes sent.\n\n\n</p>\n<p><code>net.Socket</code> instances are [EventEmitter][] with the following events:\n\n</p>\n"}],"events":[{"textRaw":"Event: 'connect'","type":"event","name":"connect","desc":"<p>Emitted when a socket connection is successfully established.\nSee <code>connect()</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'data'","type":"event","name":"data","params":[],"desc":"<p>Emitted when data is received. The argument <code>data</code> will be a <code>Buffer</code> or\n<code>String</code>. Encoding of data is set by <code>socket.setEncoding()</code>.\n(See the [Readable Stream][] section for more information.)\n\n</p>\n<p>Note that the <strong>data will be lost</strong> if there is no listener when a <code>Socket</code>\nemits a <code>&apos;data&apos;</code> event.\n\n</p>\n"},{"textRaw":"Event: 'end'","type":"event","name":"end","desc":"<p>Emitted when the other end of the socket sends a FIN packet.\n\n</p>\n<p>By default (<code>allowHalfOpen == false</code>) the socket will destroy its file\ndescriptor once it has written out its pending write queue. However, by\nsetting <code>allowHalfOpen == true</code> the socket will not automatically <code>end()</code>\nits side allowing the user to write arbitrary amounts of data, with the\ncaveat that the user is required to <code>end()</code> their side now.\n\n\n</p>\n","params":[]},{"textRaw":"Event: 'timeout'","type":"event","name":"timeout","desc":"<p>Emitted if the socket times out from inactivity. This is only to notify that\nthe socket has been idle. The user must manually close the connection.\n\n</p>\n<p>See also: <code>socket.setTimeout()</code>\n\n\n</p>\n","params":[]},{"textRaw":"Event: 'drain'","type":"event","name":"drain","desc":"<p>Emitted when the write buffer becomes empty. Can be used to throttle uploads.\n\n</p>\n<p>See also: the return values of <code>socket.write()</code>\n\n</p>\n","params":[]},{"textRaw":"Event: 'error'","type":"event","name":"error","params":[],"desc":"<p>Emitted when an error occurs. The <code>&apos;close&apos;</code> event will be called directly\nfollowing this event.\n\n</p>\n"},{"textRaw":"Event: 'close'","type":"event","name":"close","params":[],"desc":"<p>Emitted once the socket is fully closed. The argument <code>had_error</code> is a boolean\nwhich says if the socket was closed due to a transmission error.\n\n</p>\n"}]}],"type":"module","displayName":"net"}]}
View
1 public/json/0.8.1/os.json
@@ -1 +0,0 @@
-{"source":"doc/api/os.markdown","modules":[{"textRaw":"os","name":"os","stability":4,"stabilityText":"API Frozen","desc":"<p>Provides a few basic operating-system related utility functions.\n\n</p>\n<p>Use <code>require(&apos;os&apos;)</code> to access this module.\n\n</p>\n","methods":[{"textRaw":"os.tmpDir()","type":"method","name":"tmpDir","desc":"<p>Returns the operating system&apos;s default directory for temp files.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.hostname()","type":"method","name":"hostname","desc":"<p>Returns the hostname of the operating system.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.type()","type":"method","name":"type","desc":"<p>Returns the operating system name.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.platform()","type":"method","name":"platform","desc":"<p>Returns the operating system platform.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.arch()","type":"method","name":"arch","desc":"<p>Returns the operating system CPU architecture.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.release()","type":"method","name":"release","desc":"<p>Returns the operating system release.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.uptime()","type":"method","name":"uptime","desc":"<p>Returns the system uptime in seconds.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.loadavg()","type":"method","name":"loadavg","desc":"<p>Returns an array containing the 1, 5, and 15 minute load averages.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.totalmem()","type":"method","name":"totalmem","desc":"<p>Returns the total amount of system memory in bytes.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.freemem()","type":"method","name":"freemem","desc":"<p>Returns the amount of free system memory in bytes.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"os.cpus()","type":"method","name":"cpus","desc":"<p>Returns an array of objects containing information about each CPU/core installed: model, speed (in MHz), and times (an object containing the number of CPU ticks spent in: user, nice, sys, idle, and irq).\n\n</p>\n<p>Example inspection of os.cpus:\n\n</p>\n<pre><code>[ { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 252020,\n nice: 0,\n sys: 30340,\n idle: 1070356870,\n irq: 0 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 306960,\n nice: 0,\n sys: 26980,\n idle: 1071569080,\n irq: 0 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 248450,\n nice: 0,\n sys: 21750,\n idle: 1070919370,\n irq: 0 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 256880,\n nice: 0,\n sys: 19430,\n idle: 1070905480,\n irq: 20 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 511580,\n nice: 20,\n sys: 40900,\n idle: 1070842510,\n irq: 0 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 291660,\n nice: 0,\n sys: 34360,\n idle: 1070888000,\n irq: 10 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 308260,\n nice: 0,\n sys: 55410,\n idle: 1071129970,\n irq: 880 } },\n { model: &apos;Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz&apos;,\n speed: 2926,\n times:\n { user: 266450,\n nice: 1480,\n sys: 34920,\n idle: 1072572010,\n irq: 30 } } ]</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"os.networkInterfaces()","type":"method","name":"networkInterfaces","desc":"<p>Get a list of network interfaces:\n\n</p>\n<pre><code>{ lo0: \n [ { address: &apos;::1&apos;, family: &apos;IPv6&apos;, internal: true },\n { address: &apos;fe80::1&apos;, family: &apos;IPv6&apos;, internal: true },\n { address: &apos;127.0.0.1&apos;, family: &apos;IPv4&apos;, internal: true } ],\n en1: \n [ { address: &apos;fe80::cabc:c8ff:feef:f996&apos;, family: &apos;IPv6&apos;,\n internal: false },\n { address: &apos;10.0.1.123&apos;, family: &apos;IPv4&apos;, internal: false } ],\n vmnet1: [ { address: &apos;10.99.99.254&apos;, family: &apos;IPv4&apos;, internal: false } ],\n vmnet8: [ { address: &apos;10.88.88.1&apos;, family: &apos;IPv4&apos;, internal: false } ],\n ppp0: [ { address: &apos;10.2.0.231&apos;, family: &apos;IPv4&apos;, internal: false } ] }</code></pre>\n","signatures":[{"params":[]}]}],"properties":[{"textRaw":"os.EOL","name":"EOL","desc":"<p>A constant defining the appropriate End-of-line marker for the operating system.\n</p>\n"}],"type":"module","displayName":"os"}]}
View
1 public/json/0.8.1/path.json
@@ -1 +0,0 @@
-{"source":"doc/api/path.markdown","modules":[{"textRaw":"Path","name":"path","stability":3,"stabilityText":"Stable","desc":"<p>This module contains utilities for handling and transforming file\npaths. Almost all these methods perform only string transformations.\nThe file system is not consulted to check whether paths are valid.\n\n</p>\n<p>Use <code>require(&apos;path&apos;)</code> to use this module. The following methods are provided:\n\n</p>\n","methods":[{"textRaw":"path.normalize(p)","type":"method","name":"normalize","desc":"<p>Normalize a string path, taking care of <code>&apos;..&apos;</code> and <code>&apos;.&apos;</code> parts.\n\n</p>\n<p>When multiple slashes are found, they&apos;re replaced by a single one;\nwhen the path contains a trailing slash, it is preserved.\nOn windows backslashes are used. \n\n</p>\n<p>Example:\n\n</p>\n<pre><code>path.normalize(&apos;/foo/bar//baz/asdf/quux/..&apos;)\n// returns\n&apos;/foo/bar/baz/asdf&apos;</code></pre>\n","signatures":[{"params":[{"name":"p"}]}]},{"textRaw":"path.join([path1], [path2], [...])","type":"method","name":"join","desc":"<p>Join all arguments together and normalize the resulting path.\nNon-string arguments are ignored.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>path.join(&apos;/foo&apos;, &apos;bar&apos;, &apos;baz/asdf&apos;, &apos;quux&apos;, &apos;..&apos;)\n// returns\n&apos;/foo/bar/baz/asdf&apos;\n\npath.join(&apos;foo&apos;, {}, &apos;bar&apos;)\n// returns\n&apos;foo/bar&apos;</code></pre>\n","signatures":[{"params":[{"name":"path1","optional":true},{"name":"path2","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"path.resolve([from ...], to)","type":"method","name":"resolve","desc":"<p>Resolves <code>to</code> to an absolute path.\n\n</p>\n<p>If <code>to</code> isn&apos;t already absolute <code>from</code> arguments are prepended in right to left\norder, until an absolute path is found. If after using all <code>from</code> paths still\nno absolute path is found, the current working directory is used as well. The\nresulting path is normalized, and trailing slashes are removed unless the path \ngets resolved to the root directory. Non-string arguments are ignored.\n\n</p>\n<p>Another way to think of it is as a sequence of <code>cd</code> commands in a shell.\n\n</p>\n<pre><code>path.resolve(&apos;foo/bar&apos;, &apos;/tmp/file/&apos;, &apos;..&apos;, &apos;a/../subfile&apos;)</code></pre>\n<p>Is similar to:\n\n</p>\n<pre><code>cd foo/bar\ncd /tmp/file/\ncd ..\ncd a/../subfile\npwd</code></pre>\n<p>The difference is that the different paths don&apos;t need to exist and may also be\nfiles.\n\n</p>\n<p>Examples:\n\n</p>\n<pre><code>path.resolve(&apos;/foo/bar&apos;, &apos;./baz&apos;)\n// returns\n&apos;/foo/bar/baz&apos;\n\npath.resolve(&apos;/foo/bar&apos;, &apos;/tmp/file/&apos;)\n// returns\n&apos;/tmp/file&apos;\n\npath.resolve(&apos;wwwroot&apos;, &apos;static_files/png/&apos;, &apos;../gif/image.gif&apos;)\n// if currently in /home/myself/node, it returns\n&apos;/home/myself/node/wwwroot/static_files/gif/image.gif&apos;</code></pre>\n","signatures":[{"params":[{"name":"from ...","optional":true},{"name":"to"}]}]},{"textRaw":"path.relative(from, to)","type":"method","name":"relative","desc":"<p>Solve the relative path from <code>from</code> to <code>to</code>.\n\n</p>\n<p>At times we have two absolute paths, and we need to derive the relative\npath from one to the other. This is actually the reverse transform of\n<code>path.resolve</code>, which means we see that:\n\n</p>\n<pre><code>path.resolve(from, path.relative(from, to)) == path.resolve(to)</code></pre>\n<p>Examples:\n\n</p>\n<pre><code>path.relative(&apos;C:\\\\orandea\\\\test\\\\aaa&apos;, &apos;C:\\\\orandea\\\\impl\\\\bbb&apos;)\n// returns\n&apos;..\\\\..\\\\impl\\\\bbb&apos;\n\npath.relative(&apos;/data/orandea/test/aaa&apos;, &apos;/data/orandea/impl/bbb&apos;)\n// returns\n&apos;../../impl/bbb&apos;</code></pre>\n","signatures":[{"params":[{"name":"from"},{"name":"to"}]}]},{"textRaw":"path.dirname(p)","type":"method","name":"dirname","desc":"<p>Return the directory name of a path. Similar to the Unix <code>dirname</code> command.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>path.dirname(&apos;/foo/bar/baz/asdf/quux&apos;)\n// returns\n&apos;/foo/bar/baz/asdf&apos;</code></pre>\n","signatures":[{"params":[{"name":"p"}]}]},{"textRaw":"path.basename(p, [ext])","type":"method","name":"basename","desc":"<p>Return the last portion of a path. Similar to the Unix <code>basename</code> command.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>path.basename(&apos;/foo/bar/baz/asdf/quux.html&apos;)\n// returns\n&apos;quux.html&apos;\n\npath.basename(&apos;/foo/bar/baz/asdf/quux.html&apos;, &apos;.html&apos;)\n// returns\n&apos;quux&apos;</code></pre>\n","signatures":[{"params":[{"name":"p"},{"name":"ext","optional":true}]}]},{"textRaw":"path.extname(p)","type":"method","name":"extname","desc":"<p>Return the extension of the path, from the last &apos;.&apos; to end of string\nin the last portion of the path. If there is no &apos;.&apos; in the last portion\nof the path or the first character of it is &apos;.&apos;, then it returns\nan empty string. Examples:\n\n</p>\n<pre><code>path.extname(&apos;index.html&apos;)\n// returns\n&apos;.html&apos;\n\npath.extname(&apos;index.&apos;)\n// returns\n&apos;.&apos;\n\npath.extname(&apos;index&apos;)\n// returns\n&apos;&apos;</code></pre>\n","signatures":[{"params":[{"name":"p"}]}]}],"properties":[{"textRaw":"path.sep","name":"sep","desc":"<p>The platform-specific file separator. <code>&apos;\\\\&apos;</code> or <code>&apos;/&apos;</code>.\n\n</p>\n<p>An example on linux:\n\n</p>\n<pre><code>&apos;foo/bar/baz&apos;.split(path.sep)\n// returns\n[&apos;foo&apos;, &apos;bar&apos;, &apos;baz&apos;]</code></pre>\n<p>An example on windows:\n\n</p>\n<pre><code>&apos;foo\\\\bar\\\\baz&apos;.split(path.sep)\n// returns\n[&apos;foo&apos;, &apos;bar&apos;, &apos;baz&apos;]</code></pre>\n"}],"type":"module","displayName":"Path"}]}
View
1 public/json/0.8.1/process.json
@@ -1 +0,0 @@
-{"source":"doc/api/process.markdown","globals":[{"textRaw":"process","name":"process","type":"global","desc":"<p>The <code>process</code> object is a global object and can be accessed from anywhere.\nIt is an instance of [EventEmitter][].\n\n\n</p>\n","events":[{"textRaw":"Event: 'exit'","type":"event","name":"exit","desc":"<p>Emitted when the process is about to exit. This is a good hook to perform\nconstant time checks of the module&apos;s state (like for unit tests). The main\nevent loop will no longer be run after the &apos;exit&apos; callback finishes, so\ntimers may not be scheduled.\n\n</p>\n<p>Example of listening for <code>exit</code>:\n\n</p>\n<pre><code>process.on(&apos;exit&apos;, function () {\n process.nextTick(function () {\n console.log(&apos;This will not run&apos;);\n });\n console.log(&apos;About to exit.&apos;);\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'uncaughtException'","type":"event","name":"uncaughtException","desc":"<p>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\na stack trace and exit) will not occur.\n\n</p>\n<p>Example of listening for <code>uncaughtException</code>:\n\n</p>\n<pre><code>process.on(&apos;uncaughtException&apos;, function (err) {\n console.log(&apos;Caught exception: &apos; + err);\n});\n\nsetTimeout(function () {\n console.log(&apos;This will still run.&apos;);\n}, 500);\n\n// Intentionally cause an exception, but don&apos;t catch it.\nnonexistentFunc();\nconsole.log(&apos;This will not run.&apos;);</code></pre>\n<p>Note that <code>uncaughtException</code> is a very crude mechanism for exception\nhandling. Using try / catch in your program will give you more control over\nyour program&apos;s flow. Especially for server programs that are designed to\nstay running forever, <code>uncaughtException</code> can be a useful safety mechanism.\n\n\n</p>\n","params":[]},{"textRaw":"Signal Events","name":"SIGINT, SIGUSR1, etc.","type":"event","desc":"<p>Emitted when the processes receives a signal. See sigaction(2) for a list of\nstandard POSIX signal names such as SIGINT, SIGUSR1, etc.\n\n</p>\n<p>Example of listening for <code>SIGINT</code>:\n\n</p>\n<pre><code>// Start reading from stdin so we don&apos;t exit.\nprocess.stdin.resume();\n\nprocess.on(&apos;SIGINT&apos;, function () {\n console.log(&apos;Got SIGINT. Press Control-D to exit.&apos;);\n});</code></pre>\n<p>An easy way to send the <code>SIGINT</code> signal is with <code>Control-C</code> in most terminal\nprograms.\n\n\n</p>\n","params":[]}],"properties":[{"textRaw":"process.stdout","name":"stdout","desc":"<p>A <code>Writable Stream</code> to <code>stdout</code>.\n\n</p>\n<p>Example: the definition of <code>console.log</code>\n\n</p>\n<pre><code>console.log = function (d) {\n process.stdout.write(d + &apos;\\n&apos;);\n};</code></pre>\n<p><code>process.stderr</code> and <code>process.stdout</code> are unlike other streams in Node in\nthat writes to them are usually blocking. They are blocking in the case\nthat they refer to regular files or TTY file descriptors. In the case they\nrefer to pipes, they are non-blocking like other streams.\n\n\n</p>\n"},{"textRaw":"process.stderr","name":"stderr","desc":"<p>A writable stream to stderr.\n\n</p>\n<p><code>process.stderr</code> and <code>process.stdout</code> are unlike other streams in Node in\nthat writes to them are usually blocking. They are blocking in the case\nthat they refer to regular files or TTY file descriptors. In the case they\nrefer to pipes, they are non-blocking like other streams.\n\n\n</p>\n"},{"textRaw":"process.stdin","name":"stdin","desc":"<p>A <code>Readable Stream</code> for stdin. The stdin stream is paused by default, so one\nmust call <code>process.stdin.resume()</code> to read from it.\n\n</p>\n<p>Example of opening standard input and listening for both events:\n\n</p>\n<pre><code>process.stdin.resume();\nprocess.stdin.setEncoding(&apos;utf8&apos;);\n\nprocess.stdin.on(&apos;data&apos;, function (chunk) {\n process.stdout.write(&apos;data: &apos; + chunk);\n});\n\nprocess.stdin.on(&apos;end&apos;, function () {\n process.stdout.write(&apos;end&apos;);\n});</code></pre>\n"},{"textRaw":"process.argv","name":"argv","desc":"<p>An array containing the command line arguments. The first element will be\n&apos;node&apos;, the second element will be the name of the JavaScript file. The\nnext elements will be any additional command line arguments.\n\n</p>\n<pre><code>// print process.argv\nprocess.argv.forEach(function (val, index, array) {\n console.log(index + &apos;: &apos; + val);\n});</code></pre>\n<p>This will generate:\n\n</p>\n<pre><code>$ node process-2.js one two=three four\n0: node\n1: /Users/mjr/work/node/process-2.js\n2: one\n3: two=three\n4: four</code></pre>\n"},{"textRaw":"process.execPath","name":"execPath","desc":"<p>This is the absolute pathname of the executable that started the process.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>/usr/local/bin/node</code></pre>\n"},{"textRaw":"process.env","name":"env","desc":"<p>An object containing the user environment. See environ(7).\n\n\n</p>\n"},{"textRaw":"process.version","name":"version","desc":"<p>A compiled-in property that exposes <code>NODE_VERSION</code>.\n\n</p>\n<pre><code>console.log(&apos;Version: &apos; + process.version);</code></pre>\n"},{"textRaw":"process.versions","name":"versions","desc":"<p>A property exposing version strings of node and its dependencies.\n\n</p>\n<pre><code>console.log(process.versions);</code></pre>\n<p>Will output:\n\n</p>\n<pre><code>{ node: &apos;0.4.12&apos;,\n v8: &apos;3.1.8.26&apos;,\n ares: &apos;1.7.4&apos;,\n ev: &apos;4.4&apos;,\n openssl: &apos;1.0.0e-fips&apos; }</code></pre>\n"},{"textRaw":"process.config","name":"config","desc":"<p>An Object containing the JavaScript representation of the configure options\nthat were used to compile the current node executable. This is the same as\nthe &quot;config.gypi&quot; file that was produced when running the <code>./configure</code> script.\n\n</p>\n<p>An example of the possible output looks like:\n\n</p>\n<pre><code>{ target_defaults:\n { cflags: [],\n default_configuration: &apos;Release&apos;,\n defines: [],\n include_dirs: [],\n libraries: [] },\n variables:\n { host_arch: &apos;x64&apos;,\n node_install_npm: &apos;true&apos;,\n node_install_waf: &apos;true&apos;,\n node_prefix: &apos;&apos;,\n node_shared_v8: &apos;false&apos;,\n node_shared_zlib: &apos;false&apos;,\n node_use_dtrace: &apos;false&apos;,\n node_use_openssl: &apos;true&apos;,\n node_shared_openssl: &apos;false&apos;,\n strict_aliasing: &apos;true&apos;,\n target_arch: &apos;x64&apos;,\n v8_use_snapshot: &apos;true&apos; } }</code></pre>\n"},{"textRaw":"process.pid","name":"pid","desc":"<p>The PID of the process.\n\n</p>\n<pre><code>console.log(&apos;This process is pid &apos; + process.pid);</code></pre>\n"},{"textRaw":"process.title","name":"title","desc":"<p>Getter/setter to set what is displayed in &apos;ps&apos;.\n\n\n</p>\n"},{"textRaw":"process.arch","name":"arch","desc":"<p>What processor architecture you&apos;re running on: <code>&apos;arm&apos;</code>, <code>&apos;ia32&apos;</code>, or <code>&apos;x64&apos;</code>.\n\n</p>\n<pre><code>console.log(&apos;This processor architecture is &apos; + process.arch);</code></pre>\n"},{"textRaw":"process.platform","name":"platform","desc":"<p>What platform you&apos;re running on:\n<code>&apos;darwin&apos;</code>, <code>&apos;freebsd&apos;</code>, <code>&apos;linux&apos;</code>, <code>&apos;solaris&apos;</code> or <code>&apos;win32&apos;</code>\n\n</p>\n<pre><code>console.log(&apos;This platform is &apos; + process.platform);</code></pre>\n"}],"methods":[{"textRaw":"process.abort()","type":"method","name":"abort","desc":"<p>This causes node to emit an abort. This will cause node to exit and\ngenerate a core file.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"process.chdir(directory)","type":"method","name":"chdir","desc":"<p>Changes the current working directory of the process or throws an exception if that fails.\n\n</p>\n<pre><code>console.log(&apos;Starting directory: &apos; + process.cwd());\ntry {\n process.chdir(&apos;/tmp&apos;);\n console.log(&apos;New directory: &apos; + process.cwd());\n}\ncatch (err) {\n console.log(&apos;chdir: &apos; + err);\n}</code></pre>\n","signatures":[{"params":[{"name":"directory"}]}]},{"textRaw":"process.cwd()","type":"method","name":"cwd","desc":"<p>Returns the current working directory of the process.\n\n</p>\n<pre><code>console.log(&apos;Current directory: &apos; + process.cwd());</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"process.exit([code])","type":"method","name":"exit","desc":"<p>Ends the process with the specified <code>code</code>. If omitted, exit uses the\n&apos;success&apos; code <code>0</code>.\n\n</p>\n<p>To exit with a &apos;failure&apos; code:\n\n</p>\n<pre><code>process.exit(1);</code></pre>\n<p>The shell that executed node should see the exit code as 1.\n\n\n</p>\n","signatures":[{"params":[{"name":"code","optional":true}]}]},{"textRaw":"process.getgid()","type":"method","name":"getgid","desc":"<p>Note: this function is only available on POSIX platforms (i.e. not Windows)\n\n</p>\n<p>Gets the group identity of the process. (See getgid(2).)\nThis is the numerical group id, not the group name.\n\n</p>\n<pre><code>if (process.getgid) {\n console.log(&apos;Current gid: &apos; + process.getgid());\n}</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"process.setgid(id)","type":"method","name":"setgid","desc":"<p>Note: this function is only available on POSIX platforms (i.e. not Windows)\n\n</p>\n<p>Sets the group identity of the process. (See setgid(2).) This accepts either\na numerical ID or a groupname string. If a groupname is specified, this method\nblocks while resolving it to a numerical ID.\n\n</p>\n<pre><code>if (process.getgid &amp;&amp; process.setgid) {\n console.log(&apos;Current gid: &apos; + process.getgid());\n try {\n process.setgid(501);\n console.log(&apos;New gid: &apos; + process.getgid());\n }\n catch (err) {\n console.log(&apos;Failed to set gid: &apos; + err);\n }\n}</code></pre>\n","signatures":[{"params":[{"name":"id"}]}]},{"textRaw":"process.getuid()","type":"method","name":"getuid","desc":"<p>Note: this function is only available on POSIX platforms (i.e. not Windows)\n\n</p>\n<p>Gets the user identity of the process. (See getuid(2).)\nThis is the numerical userid, not the username.\n\n</p>\n<pre><code>if (process.getuid) {\n console.log(&apos;Current uid: &apos; + process.getuid());\n}</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"process.setuid(id)","type":"method","name":"setuid","desc":"<p>Note: this function is only available on POSIX platforms (i.e. not Windows)\n\n</p>\n<p>Sets the user identity of the process. (See setuid(2).) This accepts either\na numerical ID or a username string. If a username is specified, this method\nblocks while resolving it to a numerical ID.\n\n</p>\n<pre><code>if (process.getuid &amp;&amp; process.setuid) {\n console.log(&apos;Current uid: &apos; + process.getuid());\n try {\n process.setuid(501);\n console.log(&apos;New uid: &apos; + process.getuid());\n }\n catch (err) {\n console.log(&apos;Failed to set uid: &apos; + err);\n }\n}</code></pre>\n","signatures":[{"params":[{"name":"id"}]}]},{"textRaw":"process.kill(pid, [signal])","type":"method","name":"kill","desc":"<p>Send a signal to a process. <code>pid</code> is the process id and <code>signal</code> is the\nstring describing the signal to send. Signal names are strings like\n&apos;SIGINT&apos; or &apos;SIGUSR1&apos;. If omitted, the signal will be &apos;SIGTERM&apos;.\nSee kill(2) for more information.\n\n</p>\n<p>Note that just because the name of this function is <code>process.kill</code>, it is\nreally just a signal sender, like the <code>kill</code> system call. The signal sent\nmay do something other than kill the target process.\n\n</p>\n<p>Example of sending a signal to yourself:\n\n</p>\n<pre><code>process.on(&apos;SIGHUP&apos;, function () {\n console.log(&apos;Got SIGHUP signal.&apos;);\n});\n\nsetTimeout(function () {\n console.log(&apos;Exiting.&apos;);\n process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, &apos;SIGHUP&apos;);</code></pre>\n","signatures":[{"params":[{"name":"pid"},{"name":"signal","optional":true}]}]},{"textRaw":"process.memoryUsage()","type":"method","name":"memoryUsage","desc":"<p>Returns an object describing the memory usage of the Node process\nmeasured in bytes.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;);\n\nconsole.log(util.inspect(process.memoryUsage()));</code></pre>\n<p>This will generate:\n\n</p>\n<pre><code>{ rss: 4935680,\n heapTotal: 1826816,\n heapUsed: 650472 }</code></pre>\n<p><code>heapTotal</code> and <code>heapUsed</code> refer to V8&apos;s memory usage.\n\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"process.nextTick(callback)","type":"method","name":"nextTick","desc":"<p>On the next loop around the event loop call this callback.\nThis is <em>not</em> a simple alias to <code>setTimeout(fn, 0)</code>, it&apos;s much more\nefficient.\n\n</p>\n<pre><code>process.nextTick(function () {\n console.log(&apos;nextTick callback&apos;);\n});</code></pre>\n","signatures":[{"params":[{"name":"callback"}]}]},{"textRaw":"process.umask([mask])","type":"method","name":"umask","desc":"<p>Sets or reads the process&apos;s file mode creation mask. Child processes inherit\nthe mask from the parent process. Returns the old mask if <code>mask</code> argument is\ngiven, otherwise returns the current mask.\n\n</p>\n<pre><code>var oldmask, newmask = 0644;\n\noldmask = process.umask(newmask);\nconsole.log(&apos;Changed umask from: &apos; + oldmask.toString(8) +\n &apos; to &apos; + newmask.toString(8));</code></pre>\n","signatures":[{"params":[{"name":"mask","optional":true}]}]},{"textRaw":"process.uptime()","type":"method","name":"uptime","desc":"<p>Number of seconds Node has been running.\n\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"process.hrtime()","type":"method","name":"hrtime","desc":"<p>Returns the current high-resolution real time in a <code>[seconds, nanoseconds]</code>\ntuple Array. It is relative to an arbitrary time in the past. It is not\nrelated to the time of day and therefore not subject to clock drift. The\nprimary use is for measuring performance between intervals.\n\n</p>\n<p>You may pass in the result of a previous call to <code>process.hrtime()</code> to get\na diff reading, useful for benchmarks and measuring intervals:\n\n</p>\n<pre><code>var t = process.hrtime();\n// [ 1800216, 927643717 ]\n\nsetTimeout(function () {\n t = process.hrtime(t);\n // [ 1, 6962306 ]\n\n console.log(&apos;benchmark took %d seconds and %d nanoseconds&apos;, t[0], t[1]);\n // benchmark took 1 seconds and 6962306 nanoseconds\n}, 1000);</code></pre>\n","signatures":[{"params":[]}]}]}]}
View
1 public/json/0.8.1/punycode.json
@@ -1 +0,0 @@
-{"source":"doc/api/punycode.markdown","modules":[{"textRaw":"punycode","name":"punycode","stability":2,"stabilityText":"Unstable","desc":"<p><a href=\"http://mths.be/punycode\">Punycode.js</a> is bundled with Node.js v0.6.2+. Use\n<code>require(&apos;punycode&apos;)</code> to access it. (To use it with other Node.js versions,\nuse npm to install the <code>punycode</code> module first.)\n\n</p>\n","methods":[{"textRaw":"punycode.decode(string)","type":"method","name":"decode","desc":"<p>Converts a Punycode string of ASCII code points to a string of Unicode code\npoints.\n\n</p>\n<pre><code>// decode domain name parts\npunycode.decode(&apos;maana-pta&apos;); // &apos;mañana&apos;\npunycode.decode(&apos;--dqo34k&apos;); // &apos;☃-⌘&apos;</code></pre>\n","signatures":[{"params":[{"name":"string"}]}]},{"textRaw":"punycode.encode(string)","type":"method","name":"encode","desc":"<p>Converts a string of Unicode code points to a Punycode string of ASCII code\npoints.\n\n</p>\n<pre><code>// encode domain name parts\npunycode.encode(&apos;mañana&apos;); // &apos;maana-pta&apos;\npunycode.encode(&apos;☃-⌘&apos;); // &apos;--dqo34k&apos;</code></pre>\n","signatures":[{"params":[{"name":"string"}]}]},{"textRaw":"punycode.toUnicode(domain)","type":"method","name":"toUnicode","desc":"<p>Converts a Punycode string representing a domain name to Unicode. Only the\nPunycoded parts of the domain name will be converted, i.e. it doesn&apos;t matter if\nyou call it on a string that has already been converted to Unicode.\n\n</p>\n<pre><code>// decode domain names\npunycode.toUnicode(&apos;xn--maana-pta.com&apos;); // &apos;mañana.com&apos;\npunycode.toUnicode(&apos;xn----dqo34k.com&apos;); // &apos;☃-⌘.com&apos;</code></pre>\n","signatures":[{"params":[{"name":"domain"}]}]},{"textRaw":"punycode.toASCII(domain)","type":"method","name":"toASCII","desc":"<p>Converts a Unicode string representing a domain name to Punycode. Only the\nnon-ASCII parts of the domain name will be converted, i.e. it doesn&apos;t matter if\nyou call it with a domain that&apos;s already in ASCII.\n\n</p>\n<pre><code>// encode domain names\npunycode.toASCII(&apos;mañana.com&apos;); // &apos;xn--maana-pta.com&apos;\npunycode.toASCII(&apos;☃-⌘.com&apos;); // &apos;xn----dqo34k.com&apos;</code></pre>\n","signatures":[{"params":[{"name":"domain"}]}]}],"properties":[{"textRaw":"punycode.ucs2","name":"ucs2","modules":[{"textRaw":"punycode.ucs2.decode(string)","name":"punycode.ucs2.decode(string)","desc":"<p>Creates an array containing the decimal code points of each Unicode character\nin the string. While <a href=\"http://mathiasbynens.be/notes/javascript-encoding\">JavaScript uses UCS-2\ninternally</a>, this function\nwill convert a pair of surrogate halves (each of which UCS-2 exposes as\nseparate characters) into a single code point, matching UTF-16.\n\n</p>\n<pre><code>punycode.ucs2.decode(&apos;abc&apos;); // [97, 98, 99]\n// surrogate pair for U+1D306 tetragram for centre:\npunycode.ucs2.decode(&apos;\\uD834\\uDF06&apos;); // [0x1D306]</code></pre>\n","type":"module","displayName":"punycode.ucs2.decode(string)"},{"textRaw":"punycode.ucs2.encode(codePoints)","name":"punycode.ucs2.encode(codepoints)","desc":"<p>Creates a string based on an array of decimal code points.\n\n</p>\n<pre><code>punycode.ucs2.encode([97, 98, 99]); // &apos;abc&apos;\npunycode.ucs2.encode([0x1D306]); // &apos;\\uD834\\uDF06&apos;</code></pre>\n","type":"module","displayName":"punycode.ucs2.encode(codePoints)"}]},{"textRaw":"punycode.version","name":"version","desc":"<p>A string representing the current Punycode.js version number.\n</p>\n"}],"type":"module","displayName":"punycode"}]}
View
1 public/json/0.8.1/querystring.json
@@ -1 +0,0 @@
-{"source":"doc/api/querystring.markdown","modules":[{"textRaw":"Query String","name":"querystring","stability":3,"stabilityText":"Stable","desc":"<p>This module provides utilities for dealing with query strings.\nIt provides the following methods:\n\n</p>\n","methods":[{"textRaw":"querystring.stringify(obj, [sep], [eq])","type":"method","name":"stringify","desc":"<p>Serialize an object to a query string.\nOptionally override the default separator (<code>&apos;&amp;&apos;</code>) and assignment (<code>&apos;=&apos;</code>)\ncharacters.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>querystring.stringify({ foo: &apos;bar&apos;, baz: [&apos;qux&apos;, &apos;quux&apos;], corge: &apos;&apos; })\n// returns\n&apos;foo=bar&amp;baz=qux&amp;baz=quux&amp;corge=&apos;\n\nquerystring.stringify({foo: &apos;bar&apos;, baz: &apos;qux&apos;}, &apos;;&apos;, &apos;:&apos;)\n// returns\n&apos;foo:bar;baz:qux&apos;</code></pre>\n","signatures":[{"params":[{"name":"obj"},{"name":"sep","optional":true},{"name":"eq","optional":true}]}]},{"textRaw":"querystring.parse(str, [sep], [eq], [options])","type":"method","name":"parse","desc":"<p>Deserialize a query string to an object.\nOptionally override the default separator (<code>&apos;&amp;&apos;</code>) and assignment (<code>&apos;=&apos;</code>)\ncharacters.\n\n</p>\n<p>Options object may contain <code>maxKeys</code> property (equal to 1000 by default), it&apos;ll\nbe used to limit processed keys. Set it to 0 to remove key count limitation.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>querystring.parse(&apos;foo=bar&amp;baz=qux&amp;baz=quux&amp;corge&apos;)\n// returns\n{ foo: &apos;bar&apos;, baz: [&apos;qux&apos;, &apos;quux&apos;], corge: &apos;&apos; }</code></pre>\n","signatures":[{"params":[{"name":"str"},{"name":"sep","optional":true},{"name":"eq","optional":true},{"name":"options","optional":true}]}]}],"properties":[{"textRaw":"querystring.escape","name":"escape","desc":"<p>The escape function used by <code>querystring.stringify</code>,\nprovided so that it could be overridden if necessary.\n\n</p>\n"},{"textRaw":"querystring.unescape","name":"unescape","desc":"<p>The unescape function used by <code>querystring.parse</code>,\nprovided so that it could be overridden if necessary.\n</p>\n"}],"type":"module","displayName":"querystring"}]}
View
1 public/json/0.8.1/readline.json
@@ -1 +0,0 @@
-{"source":"doc/api/readline.markdown","modules":[{"textRaw":"Readline","name":"readline","stability":2,"stabilityText":"Unstable","desc":"<p>To use this module, do <code>require(&apos;readline&apos;)</code>. Readline allows reading of a\nstream (such as <code>process.stdin</code>) on a line-by-line basis.\n\n</p>\n<p>Note that once you&apos;ve invoked this module, your node program will not\nterminate until you&apos;ve closed the interface. Here&apos;s how to allow your\nprogram to gracefully exit:\n\n</p>\n<pre><code>var readline = require(&apos;readline&apos;);\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question(&quot;What do you think of node.js? &quot;, function(answer) {\n // TODO: Log the answer in a database\n console.log(&quot;Thank you for your valuable feedback:&quot;, answer);\n\n rl.close();\n});</code></pre>\n","methods":[{"textRaw":"readline.createInterface(options)","type":"method","name":"createInterface","desc":"<p>Creates a readline <code>Interface</code> instance. Accepts an &quot;options&quot; Object that takes\nthe following values:\n\n</p>\n<ul>\n<li><p><code>input</code> - the readable stream to listen to (Required).</p>\n</li>\n<li><p><code>output</code> - the writable stream to write readline data to (Required).</p>\n</li>\n<li><p><code>completer</code> - an optional function that is used for Tab autocompletion. See\nbelow for an example of using this.</p>\n</li>\n<li><p><code>terminal</code> - pass <code>true</code> if the <code>input</code> and <code>output</code> streams should be\ntreated like a TTY, and have ANSI/VT100 escape codes written to it.\nDefaults to checking <code>isTTY</code> on the <code>output</code> stream upon instantiation.</p>\n</li>\n</ul>\n<p>The <code>completer</code> function is given a the current line entered by the user, and\nis supposed to return an Array with 2 entries:\n\n</p>\n<ol>\n<li><p>An Array with matching entries for the completion.</p>\n</li>\n<li><p>The substring that was used for the matching.</p>\n</li>\n</ol>\n<p>Which ends up looking something like:\n<code>[[substr1, substr2, ...], originalsubstring]</code>.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>function completer(line) {\n var completions = &apos;.help .error .exit .quit .q&apos;.split(&apos; &apos;)\n var hits = completions.filter(function(c) { return c.indexOf(line) == 0 })\n // show all completions if none found\n return [hits.length ? hits : completions, line]\n}</code></pre>\n<p>Also <code>completer</code> can be run in async mode if it accepts two arguments:\n\n</p>\n<pre><code>function completer(linePartial, callback) {\n callback(null, [[&apos;123&apos;], linePartial]);\n}</code></pre>\n<p><code>createInterface</code> is commonly used with <code>process.stdin</code> and\n<code>process.stdout</code> in order to accept user input:\n\n</p>\n<pre><code>var readline = require(&apos;readline&apos;);\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});</code></pre>\n<p>Once you have a readline instance, you most commonly listen for the\n<code>&quot;line&quot;</code> event.\n\n</p>\n<p>If <code>terminal</code> is <code>true</code> for this instance then the <code>output</code> stream will get\nthe best compatibility if it defines an <code>output.columns</code> property, and fires\na <code>&quot;resize&quot;</code> event on the <code>output</code> if/when the columns ever change\n(<code>process.stdout</code> does this automatically when it is a TTY).\n\n</p>\n","signatures":[{"params":[{"name":"options"}]}]}],"classes":[{"textRaw":"Class: Interface","type":"class","name":"Interface","desc":"<p>The class that represents a readline interface with an input and output\nstream.\n\n</p>\n","methods":[{"textRaw":"rl.setPrompt(prompt, length)","type":"method","name":"setPrompt","desc":"<p>Sets the prompt, for example when you run <code>node</code> on the command line, you see\n<code>&gt; </code>, which is node&apos;s prompt.\n\n</p>\n","signatures":[{"params":[{"name":"prompt"},{"name":"length"}]}]},{"textRaw":"rl.prompt([preserveCursor])","type":"method","name":"prompt","desc":"<p>Readies readline for input from the user, putting the current <code>setPrompt</code>\noptions on a new line, giving the user a new spot to write. Set <code>preserveCursor</code>\nto <code>true</code> to prevent the cursor placement being reset to <code>0</code>.\n\n</p>\n<p>This will also resume the <code>input</code> stream used with <code>createInterface</code> if it has\nbeen paused.\n\n</p>\n","signatures":[{"params":[{"name":"preserveCursor","optional":true}]}]},{"textRaw":"rl.question(query, callback)","type":"method","name":"question","desc":"<p>Prepends the prompt with <code>query</code> and invokes <code>callback</code> with the user&apos;s\nresponse. Displays the query to the user, and then invokes <code>callback</code>\nwith the user&apos;s response after it has been typed.\n\n</p>\n<p>This will also resume the <code>input</code> stream used with <code>createInterface</code> if\nit has been paused.\n\n</p>\n<p>Example usage:\n\n</p>\n<pre><code>interface.question(&apos;What is your favorite food?&apos;, function(answer) {\n console.log(&apos;Oh, so your favorite food is &apos; + answer);\n});</code></pre>\n","signatures":[{"params":[{"name":"query"},{"name":"callback"}]}]},{"textRaw":"rl.pause()","type":"method","name":"pause","desc":"<p>Pauses the readline <code>input</code> stream, allowing it to be resumed later if needed.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"rl.resume()","type":"method","name":"resume","desc":"<p>Resumes the readline <code>input</code> stream.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"rl.close()","type":"method","name":"close","desc":"<p>Closes the <code>Interface</code> instance, relinquishing control on the <code>input</code> and\n<code>output</code> streams. The &quot;close&quot; event will also be emitted.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"rl.write(data, [key])","type":"method","name":"write","desc":"<p>Writes <code>data</code> to <code>output</code> stream. <code>key</code> is an object literal to represent a key\nsequence; available if the terminal is a TTY.\n\n</p>\n<p>This will also resume the <code>input</code> stream if it has been paused.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>rl.write(&apos;Delete me!&apos;);\n// Simulate ctrl+u to delete the line written previously\nrl.write(null, {ctrl: true, name: &apos;u&apos;});</code></pre>\n","signatures":[{"params":[{"name":"data"},{"name":"key","optional":true}]}]}]}],"modules":[{"textRaw":"Events","name":"events","events":[{"textRaw":"Event: 'line'","type":"event","name":"line","desc":"<p><code>function (line) {}</code>\n\n</p>\n<p>Emitted whenever the <code>input</code> stream receives a <code>\\n</code>, usually received when the\nuser hits enter, or return. This is a good hook to listen for user input.\n\n</p>\n<p>Example of listening for <code>line</code>:\n\n</p>\n<pre><code>rl.on(&apos;line&apos;, function (cmd) {\n console.log(&apos;You just typed: &apos;+cmd);\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'pause'","type":"event","name":"pause","desc":"<p><code>function () {}</code>\n\n</p>\n<p>Emitted whenever the <code>input</code> stream is paused.\n\n</p>\n<p>Also emitted whenever the <code>input</code> stream is not paused and receives the\n<code>SIGCONT</code> event. (See events <code>SIGTSTP</code> and <code>SIGCONT</code>)\n\n</p>\n<p>Example of listening for <code>pause</code>:\n\n</p>\n<pre><code>rl.on(&apos;pause&apos;, function() {\n console.log(&apos;Readline paused.&apos;);\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'resume'","type":"event","name":"resume","desc":"<p><code>function () {}</code>\n\n</p>\n<p>Emitted whenever the <code>input</code> stream is resumed.\n\n</p>\n<p>Example of listening for <code>resume</code>:\n\n</p>\n<pre><code>rl.on(&apos;resume&apos;, function() {\n console.log(&apos;Readline resumed.&apos;);\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function () {}</code>\n\n</p>\n<p>Emitted when <code>close()</code> is called.\n\n</p>\n<p>Also emitted when the <code>input</code> stream receives its &quot;end&quot; event. The <code>Interface</code>\ninstance should be considered &quot;finished&quot; once this is emitted. For example, when\nthe <code>input</code> stream receives <code>^D</code>, respectively known as <code>EOT</code>.\n\n</p>\n<p>This event is also called if there is no <code>SIGINT</code> event listener present when\nthe <code>input</code> stream receives a <code>^C</code>, respectively known as <code>SIGINT</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'SIGINT'","type":"event","name":"SIGINT","desc":"<p><code>function () {}</code>\n\n</p>\n<p>Emitted whenever the <code>input</code> stream receives a <code>^C</code>, respectively known as\n<code>SIGINT</code>. If there is no <code>SIGINT</code> event listener present when the <code>input</code>\nstream receives a <code>SIGINT</code>, <code>pause</code> will be triggered.\n\n</p>\n<p>Example of listening for <code>SIGINT</code>:\n\n</p>\n<pre><code>rl.on(&apos;SIGINT&apos;, function() {\n rl.question(&apos;Are you sure you want to exit?&apos;, function(answer) {\n if (answer.match(/^y(es)?$/i)) rl.pause();\n });\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'SIGTSTP'","type":"event","name":"SIGTSTP","desc":"<p><code>function () {}</code>\n\n</p>\n<p><strong>This does not work on Windows.</strong>\n\n</p>\n<p>Emitted whenever the <code>input</code> stream receives a <code>^Z</code>, respectively known as\n<code>SIGTSTP</code>. If there is no <code>SIGTSTP</code> event listener present when the <code>input</code>\nstream receives a <code>SIGTSTP</code>, the program will be sent to the background.\n\n</p>\n<p>When the program is resumed with <code>fg</code>, the <code>pause</code> and <code>SIGCONT</code> events will be\nemitted. You can use either to resume the stream.\n\n</p>\n<p>The <code>pause</code> and <code>SIGCONT</code> events will not be triggered if the stream was paused\nbefore the program was sent to the background.\n\n</p>\n<p>Example of listening for <code>SIGTSTP</code>:\n\n</p>\n<pre><code>rl.on(&apos;SIGTSTP&apos;, function() {\n // This will override SIGTSTP and prevent the program from going to the\n // background.\n console.log(&apos;Caught SIGTSTP.&apos;);\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'SIGCONT'","type":"event","name":"SIGCONT","desc":"<p><code>function () {}</code>\n\n</p>\n<p><strong>This does not work on Windows.</strong>\n\n</p>\n<p>Emitted whenever the <code>input</code> stream is sent to the background with <code>^Z</code>,\nrespectively known as <code>SIGTSTP</code>, and then continued with <code>fg(1)</code>. This event\nonly emits if the stream was not paused before sending the program to the\nbackground.\n\n</p>\n<p>Example of listening for <code>SIGCONT</code>:\n\n</p>\n<pre><code>rl.on(&apos;SIGCONT&apos;, function() {\n // `prompt` will automatically resume the stream\n rl.prompt();\n});</code></pre>\n<h2>Example: Tiny CLI</h2>\n<p>Here&apos;s an example of how to use all these together to craft a tiny command\nline interface:\n\n</p>\n<pre><code>var readline = require(&apos;readline&apos;),\n rl = readline.createInterface(process.stdin, process.stdout);\n\nrl.setPrompt(&apos;OHAI&gt; &apos;);\nrl.prompt();\n\nrl.on(&apos;line&apos;, function(line) {\n switch(line.trim()) {\n case &apos;hello&apos;:\n console.log(&apos;world!&apos;);\n break;\n default:\n console.log(&apos;Say what? I might have heard `&apos; + line.trim() + &apos;`&apos;);\n break;\n }\n rl.prompt();\n}).on(&apos;close&apos;, function() {\n console.log(&apos;Have a great day!&apos;);\n process.exit(0);\n});</code></pre>\n","params":[]}],"type":"module","displayName":"Events"}],"type":"module","displayName":"Readline"}]}
View
1 public/json/0.8.1/repl.json
@@ -1 +0,0 @@
-{"source":"doc/api/repl.markdown","modules":[{"textRaw":"REPL","name":"repl","desc":"<p>A Read-Eval-Print-Loop (REPL) is available both as a standalone program and\neasily includable in other programs. The REPL provides a way to interactively\nrun JavaScript and see the results. It can be used for debugging, testing, or\njust trying things out.\n\n</p>\n<p>By executing <code>node</code> without any arguments from the command-line you will be\ndropped into the REPL. It has simplistic emacs line-editing.\n\n</p>\n<pre><code>mjr:~$ node\nType &apos;.help&apos; for options.\n&gt; a = [ 1, 2, 3];\n[ 1, 2, 3 ]\n&gt; a.forEach(function (v) {\n... console.log(v);\n... });\n1\n2\n3</code></pre>\n<p>For advanced line-editors, start node with the environmental variable\n<code>NODE_NO_READLINE=1</code>. This will start the main and debugger REPL in canonical\nterminal settings which will allow you to use with <code>rlwrap</code>.\n\n</p>\n<p>For example, you could add this to your bashrc file:\n\n</p>\n<pre><code>alias node=&quot;env NODE_NO_READLINE=1 rlwrap node&quot;</code></pre>\n","methods":[{"textRaw":"repl.start(options)","type":"method","name":"start","desc":"<p>Returns and starts a <code>REPLServer</code> instance. Accepts an &quot;options&quot; Object that\ntakes the following values:\n\n</p>\n<ul>\n<li><p><code>prompt</code> - the prompt and <code>stream</code> for all I/O. Defaults to <code>&gt; </code>.</p>\n</li>\n<li><p><code>input</code> - the readable stream to listen to. Defaults to <code>process.stdin</code>.</p>\n</li>\n<li><p><code>output</code> - the writable stream to write readline data to. Defaults to\n<code>process.stdout</code>.</p>\n</li>\n<li><p><code>terminal</code> - pass <code>true</code> if the <code>stream</code> should be treated like a TTY, and\nhave ANSI/VT100 escape codes written to it. Defaults to checking <code>isTTY</code>\non the <code>output</code> stream upon instantiation.</p>\n</li>\n<li><p><code>eval</code> - function that will be used to eval each given line. Defaults to\nan async wrapper for <code>eval()</code>. See below for an example of a custom <code>eval</code>.</p>\n</li>\n<li><p><code>useColors</code> - a boolean which specifies whether or not the <code>writer</code> function\nshould output colors. If a different <code>writer</code> function is set then this does\nnothing. Defaults to the repl&apos;s <code>terminal</code> value.</p>\n</li>\n<li><p><code>useGlobal</code> - if set to <code>true</code>, then the repl will use the <code>global</code> object,\ninstead of running scripts in a separate context. Defaults to <code>false</code>.</p>\n</li>\n<li><p><code>ignoreUndefined</code> - if set to <code>true</code>, then the repl will not output the\nreturn value of command if it&apos;s <code>undefined</code>. Defaults to <code>false</code>.</p>\n</li>\n<li><p><code>writer</code> - the function to invoke for each command that gets evaluated which\nreturns the formatting (including coloring) to display. Defaults to\n<code>util.inspect</code>.</p>\n</li>\n</ul>\n<p>You can use your own <code>eval</code> function if it has following signature:\n\n</p>\n<pre><code>function eval(cmd, context, filename, callback) {\n callback(null, result);\n}</code></pre>\n<p>Multiple REPLs may be started against the same running instance of node. Each\nwill share the same global object but will have unique I/O.\n\n</p>\n<p>Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket:\n\n</p>\n<pre><code>var net = require(&quot;net&quot;),\n repl = require(&quot;repl&quot;);\n\nconnections = 0;\n\nrepl.start({\n prompt: &quot;node via stdin&gt; &quot;,\n input: process.stdin,\n output: process.stdout\n});\n\nnet.createServer(function (socket) {\n connections += 1;\n repl.start({\n prompt: &quot;node via Unix socket&gt; &quot;,\n input: socket,\n output: socket\n }).on(&apos;exit&apos;, function() {\n socket.end();\n })\n}).listen(&quot;/tmp/node-repl-sock&quot;);\n\nnet.createServer(function (socket) {\n connections += 1;\n repl.start({\n prompt: &quot;node via TCP socket&gt; &quot;,\n input: socket,\n output: socket\n }).on(&apos;exit&apos;, function() {\n socket.end();\n });\n}).listen(5001);</code></pre>\n<p>Running this program from the command line will start a REPL on stdin. Other\nREPL clients may connect through the Unix socket or TCP socket. <code>telnet</code> is useful\nfor connecting to TCP sockets, and <code>socat</code> can be used to connect to both Unix and\nTCP sockets.\n\n</p>\n<p>By starting a REPL from a Unix socket-based server instead of stdin, you can\nconnect to a long-running node process without restarting it.\n\n</p>\n<p>For an example of running a &quot;full-featured&quot; (<code>terminal</code>) REPL over\na <code>net.Server</code> and <code>net.Socket</code> instance, see: <a href=\"https://gist.github.com/2209310\">https://gist.github.com/2209310</a>\n\n</p>\n<p>For an example of running a REPL instance over <code>curl(1)</code>,\nsee: <a href=\"https://gist.github.com/2053342\">https://gist.github.com/2053342</a>\n\n</p>\n","events":[{"textRaw":"Event: 'exit'","type":"event","name":"exit","desc":"<p><code>function () {}</code>\n\n</p>\n<p>Emitted when the user exits the REPL in any of the defined ways. Namely, typing\n<code>.exit</code> at the repl, pressing Ctrl+C twice to signal SIGINT, or pressing Ctrl+D\nto signal &quot;end&quot; on the <code>input</code> stream.\n\n</p>\n<p>Example of listening for <code>exit</code>:\n\n</p>\n<pre><code>r.on(&apos;exit&apos;, function () {\n console.log(&apos;Got &quot;exit&quot; event from repl!&apos;);\n process.exit();\n});</code></pre>\n","params":[]}],"signatures":[{"params":[{"name":"options"}]}]}],"miscs":[{"textRaw":"REPL Features","name":"REPL Features","type":"misc","desc":"<p>Inside the REPL, Control+D will exit. Multi-line expressions can be input.\nTab completion is supported for both global and local variables.\n\n</p>\n<p>The special variable <code>_</code> (underscore) contains the result of the last expression.\n\n</p>\n<pre><code>&gt; [ &quot;a&quot;, &quot;b&quot;, &quot;c&quot; ]\n[ &apos;a&apos;, &apos;b&apos;, &apos;c&apos; ]\n&gt; _.length\n3\n&gt; _ += 1\n4</code></pre>\n<p>The REPL provides access to any variables in the global scope. You can expose\na variable to the REPL explicitly by assigning it to the <code>context</code> object\nassociated with each <code>REPLServer</code>. For example:\n\n</p>\n<pre><code>// repl_test.js\nvar repl = require(&quot;repl&quot;),\n msg = &quot;message&quot;;\n\nrepl.start().context.m = msg;</code></pre>\n<p>Things in the <code>context</code> object appear as local within the REPL:\n\n</p>\n<pre><code>mjr:~$ node repl_test.js\n&gt; m\n&apos;message&apos;</code></pre>\n<p>There are a few special REPL commands:\n\n</p>\n<ul>\n<li><code>.break</code> - While inputting a multi-line expression, sometimes you get lost\nor just don&apos;t care about completing it. <code>.break</code> will start over.</li>\n<li><code>.clear</code> - Resets the <code>context</code> object to an empty object and clears any\nmulti-line expression.</li>\n<li><code>.exit</code> - Close the I/O stream, which will cause the REPL to exit.</li>\n<li><code>.help</code> - Show this list of special commands.</li>\n<li><code>.save</code> - Save the current REPL session to a file<blockquote>\n<p>.save ./file/to/save.js</p>\n</blockquote>\n</li>\n<li><code>.load</code> - Load a file into the current REPL session.<blockquote>\n<p>.load ./file/to/load.js</p>\n</blockquote>\n</li>\n</ul>\n<p>The following key combinations in the REPL have these special effects:\n\n</p>\n<ul>\n<li><code>&lt;ctrl&gt;C</code> - Similar to the <code>.break</code> keyword. Terminates the current\ncommand. Press twice on a blank line to forcibly exit.</li>\n<li><code>&lt;ctrl&gt;D</code> - Similar to the <code>.exit</code> keyword.</li>\n</ul>\n"}],"type":"module","displayName":"REPL"}]}
View
1 public/json/0.8.1/stdio.json
@@ -1 +0,0 @@
-{"source":"doc/api/stdio.markdown","globals":[{"textRaw":"console","name":"console","stability":4,"stabilityText":"API Frozen","type":"global","desc":"<p>For printing to stdout and stderr. Similar to the console object functions\nprovided by most web browsers, here the output is sent to stdout or stderr.\n\n</p>\n","methods":[{"textRaw":"console.log([data], [...])","type":"method","name":"log","desc":"<p>Prints to stdout with newline. This function can take multiple arguments in a\n<code>printf()</code>-like way. Example:\n\n</p>\n<pre><code>console.log(&apos;count: %d&apos;, count);</code></pre>\n<p>If formatting elements are not found in the first string then <code>util.inspect</code>\nis used on each argument. See [util.format()][] for more information.\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"console.info([data], [...])","type":"method","name":"info","desc":"<p>Same as <code>console.log</code>.\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"console.error([data], [...])","type":"method","name":"error","desc":"<p>Same as <code>console.log</code> but prints to stderr.\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"console.warn([data], [...])","type":"method","name":"warn","desc":"<p>Same as <code>console.error</code>.\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"console.dir(obj)","type":"method","name":"dir","desc":"<p>Uses <code>util.inspect</code> on <code>obj</code> and prints resulting string to stdout.\n\n</p>\n","signatures":[{"params":[{"name":"obj"}]}]},{"textRaw":"console.time(label)","type":"method","name":"time","desc":"<p>Mark a time.\n\n</p>\n","signatures":[{"params":[{"name":"label"}]}]},{"textRaw":"console.timeEnd(label)","type":"method","name":"timeEnd","desc":"<p>Finish timer, record output. Example:\n\n</p>\n<pre><code>console.time(&apos;100-elements&apos;);\nfor (var i = 0; i &lt; 100; i++) {\n ;\n}\nconsole.timeEnd(&apos;100-elements&apos;);</code></pre>\n","signatures":[{"params":[{"name":"label"}]}]},{"textRaw":"console.trace(label)","type":"method","name":"trace","desc":"<p>Print a stack trace to stderr of the current position.\n\n</p>\n","signatures":[{"params":[{"name":"label"}]}]},{"textRaw":"console.assert(expression, [message])","type":"method","name":"assert","desc":"<p>Same as [assert.ok()][] where if the <code>expression</code> evaluates as <code>false</code> throw an\nAssertionError with <code>message</code>.\n\n</p>\n","signatures":[{"params":[{"name":"expression"},{"name":"message","optional":true}]}]}]}]}
View
1 public/json/0.8.1/stream.json
@@ -1 +0,0 @@
-{"source":"doc/api/stream.markdown","modules":[{"textRaw":"Stream","name":"stream","stability":2,"stabilityText":"Unstable","desc":"<p>A stream is an abstract interface implemented by various objects in Node.\nFor example a request to an HTTP server is a stream, as is stdout. Streams\nare readable, writable, or both. All streams are instances of [EventEmitter][]\n\n</p>\n<p>You can load up the Stream base class by doing <code>require(&apos;stream&apos;)</code>.\n\n</p>\n","classes":[{"textRaw":"Readable Stream","name":"Readable Stream","type":"class","desc":"<p>A <code>Readable Stream</code> has the following methods, members, and events.\n\n</p>\n","events":[{"textRaw":"Event: 'data'","type":"event","name":"data","desc":"<p><code>function (data) { }</code>\n\n</p>\n<p>The <code>&apos;data&apos;</code> event emits either a <code>Buffer</code> (by default) or a string if\n<code>setEncoding()</code> was used.\n\n</p>\n<p>Note that the <strong>data will be lost</strong> if there is no listener when a\n<code>Readable Stream</code> emits a <code>&apos;data&apos;</code> event.\n\n</p>\n","params":[]},{"textRaw":"Event: 'end'","type":"event","name":"end","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Emitted when the stream has received an EOF (FIN in TCP terminology).\nIndicates that no more <code>&apos;data&apos;</code> events will happen. If the stream is also\nwritable, it may be possible to continue writing.\n\n</p>\n","params":[]},{"textRaw":"Event: 'error'","type":"event","name":"error","desc":"<p><code>function (exception) { }</code>\n\n</p>\n<p>Emitted if there was an error receiving data.\n\n</p>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Emitted when the underlying resource (for example, the backing file descriptor)\nhas been closed. Not all streams will emit this.\n\n</p>\n","params":[]}],"properties":[{"textRaw":"stream.readable","name":"readable","desc":"<p>A boolean that is <code>true</code> by default, but turns <code>false</code> after an <code>&apos;error&apos;</code>\noccurred, the stream came to an <code>&apos;end&apos;</code>, or <code>destroy()</code> was called.\n\n</p>\n"}],"methods":[{"textRaw":"stream.setEncoding([encoding])","type":"method","name":"setEncoding","desc":"<p>Makes the <code>&apos;data&apos;</code> event emit a string instead of a <code>Buffer</code>. <code>encoding</code> can be\n<code>&apos;utf8&apos;</code>, <code>&apos;utf16le&apos;</code> (<code>&apos;ucs2&apos;</code>), <code>&apos;ascii&apos;</code>, or <code>&apos;hex&apos;</code>. Defaults to <code>&apos;utf8&apos;</code>.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"stream.pause()","type":"method","name":"pause","desc":"<p>Issues an advisory signal to the underlying communication layer, requesting\nthat no further data be sent until <code>resume()</code> is called.\n\n</p>\n<p>Note that, due to the advisory nature, certain streams will not be paused\nimmediately, and so <code>&apos;data&apos;</code> events may be emitted for some indeterminate\nperiod of time even after <code>pause()</code> is called. You may wish to buffer such\n<code>&apos;data&apos;</code> events.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"stream.resume()","type":"method","name":"resume","desc":"<p>Resumes the incoming <code>&apos;data&apos;</code> events after a <code>pause()</code>.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"stream.destroy()","type":"method","name":"destroy","desc":"<p>Closes the underlying file descriptor. Stream will not emit any more events.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"stream.pipe(destination, [options])","type":"method","name":"pipe","desc":"<p>This is a <code>Stream.prototype</code> method available on all <code>Stream</code>s.\n\n</p>\n<p>Connects this read stream to <code>destination</code> WriteStream. Incoming\ndata on this stream gets written to <code>destination</code>. The destination and source\nstreams are kept in sync by pausing and resuming as necessary.\n\n</p>\n<p>This function returns the <code>destination</code> stream.\n\n</p>\n<p>Emulating the Unix <code>cat</code> command:\n\n</p>\n<pre><code>process.stdin.resume();\nprocess.stdin.pipe(process.stdout);</code></pre>\n<p>By default <code>end()</code> is called on the destination when the source stream emits\n<code>end</code>, so that <code>destination</code> is no longer writable. Pass <code>{ end: false }</code> as\n<code>options</code> to keep the destination stream open.\n\n</p>\n<p>This keeps <code>process.stdout</code> open so that &quot;Goodbye&quot; can be written at the end.\n\n</p>\n<pre><code>process.stdin.resume();\n\nprocess.stdin.pipe(process.stdout, { end: false });\n\nprocess.stdin.on(&quot;end&quot;, function() {\n process.stdout.write(&quot;Goodbye\\n&quot;);\n});</code></pre>\n","signatures":[{"params":[{"name":"destination"},{"name":"options","optional":true}]}]}]},{"textRaw":"Writable Stream","name":"Writable Stream","type":"class","desc":"<p>A <code>Writable Stream</code> has the following methods, members, and events.\n\n</p>\n","events":[{"textRaw":"Event: 'drain'","type":"event","name":"drain","desc":"<p><code>function () { }</code>\n\n</p>\n<p>After a <code>write()</code> method returned <code>false</code>, this event is emitted to\nindicate that it is safe to write again.\n\n</p>\n","params":[]},{"textRaw":"Event: 'error'","type":"event","name":"error","desc":"<p><code>function (exception) { }</code>\n\n</p>\n<p>Emitted on error with the exception <code>exception</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Emitted when the underlying file descriptor has been closed.\n\n</p>\n","params":[]},{"textRaw":"Event: 'pipe'","type":"event","name":"pipe","desc":"<p><code>function (src) { }</code>\n\n</p>\n<p>Emitted when the stream is passed to a readable stream&apos;s pipe method.\n\n</p>\n","params":[]}],"properties":[{"textRaw":"stream.writable","name":"writable","desc":"<p>A boolean that is <code>true</code> by default, but turns <code>false</code> after an <code>&apos;error&apos;</code>\noccurred or <code>end()</code> / <code>destroy()</code> was called.\n\n</p>\n"}],"methods":[{"textRaw":"stream.write(string, [encoding], [fd])","type":"method","name":"write","desc":"<p>Writes <code>string</code> with the given <code>encoding</code> to the stream. Returns <code>true</code> if\nthe string has been flushed to the kernel buffer. Returns <code>false</code> to\nindicate that the kernel buffer is full, and the data will be sent out in\nthe future. The <code>&apos;drain&apos;</code> event will indicate when the kernel buffer is\nempty again. The <code>encoding</code> defaults to <code>&apos;utf8&apos;</code>.\n\n</p>\n<p>If the optional <code>fd</code> parameter is specified, it is interpreted as an integral\nfile descriptor to be sent over the stream. This is only supported for UNIX\nstreams, and is silently ignored otherwise. When writing a file descriptor in\nthis manner, closing the descriptor before the stream drains risks sending an\ninvalid (closed) FD.\n\n</p>\n","signatures":[{"params":[{"name":"string"},{"name":"encoding","optional":true},{"name":"fd","optional":true}]}]},{"textRaw":"stream.write(buffer)","type":"method","name":"write","desc":"<p>Same as the above except with a raw buffer.\n\n</p>\n","signatures":[{"params":[{"name":"buffer"}]}]},{"textRaw":"stream.end()","type":"method","name":"end","desc":"<p>Terminates the stream with EOF or FIN.\nThis call will allow queued write data to be sent before closing the stream.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"stream.end(string, encoding)","type":"method","name":"end","desc":"<p>Sends <code>string</code> with the given <code>encoding</code> and terminates the stream with EOF\nor FIN. This is useful to reduce the number of packets sent.\n\n</p>\n","signatures":[{"params":[{"name":"string"},{"name":"encoding"}]}]},{"textRaw":"stream.end(buffer)","type":"method","name":"end","desc":"<p>Same as above but with a <code>buffer</code>.\n\n</p>\n","signatures":[{"params":[{"name":"buffer"}]}]},{"textRaw":"stream.destroy()","type":"method","name":"destroy","desc":"<p>Closes the underlying file descriptor. Stream will not emit any more events.\nAny queued write data will not be sent.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"stream.destroySoon()","type":"method","name":"destroySoon","desc":"<p>After the write queue is drained, close the file descriptor. <code>destroySoon()</code>\ncan still destroy straight away, as long as there is no data left in the queue\nfor writes.\n\n</p>\n","signatures":[{"params":[]}]}]}],"type":"module","displayName":"Stream"}]}
View
1 public/json/0.8.1/string_decoder.json
@@ -1 +0,0 @@
-{"source":"doc/api/string_decoder.markdown","modules":[{"textRaw":"StringDecoder","name":"stringdecoder","stability":3,"stabilityText":"Stable","desc":"<p>To use this module, do <code>require(&apos;string_decoder&apos;)</code>. StringDecoder decodes a\nbuffer to a string. It is a simple interface to <code>buffer.toString()</code> but provides\nadditional support for utf8.\n\n</p>\n<pre><code>var StringDecoder = require(&apos;string_decoder&apos;).StringDecoder;\nvar decoder = new StringDecoder(&apos;utf8&apos;);\n\nvar cent = new Buffer([0xC2, 0xA2]);\nconsole.log(decoder.write(cent));\n\nvar euro = new Buffer([0xE2, 0x82, 0xAC]);\nconsole.log(decoder.write(euro));</code></pre>\n","classes":[{"textRaw":"Class: StringDecoder","type":"class","name":"StringDecoder","desc":"<p>Accepts a single argument, <code>encoding</code> which defaults to <code>utf8</code>.\n\n</p>\n","methods":[{"textRaw":"StringDecoder.write(buffer)","type":"method","name":"write","desc":"<p>Returns a decoded string.</p>\n","signatures":[{"params":[{"name":"buffer"}]}]}]}],"type":"module","displayName":"StringDecoder"}]}
View
1 public/json/0.8.1/synopsis.json
@@ -1 +0,0 @@
-{"source":"doc/api/synopsis.markdown","miscs":[{"textRaw":"Synopsis","name":"Synopsis","type":"misc","desc":"<p>An example of a <a href=\"http.html\">web server</a> written with Node which responds with &apos;Hello\nWorld&apos;:\n\n</p>\n<pre><code>var http = require(&apos;http&apos;);\n\nhttp.createServer(function (request, response) {\n response.writeHead(200, {&apos;Content-Type&apos;: &apos;text/plain&apos;});\n response.end(&apos;Hello World\\n&apos;);\n}).listen(8124);\n\nconsole.log(&apos;Server running at http://127.0.0.1:8124/&apos;);</code></pre>\n<p>To run the server, put the code into a file called <code>example.js</code> and execute\nit with the node program\n\n</p>\n<pre><code>&gt; node example.js\nServer running at http://127.0.0.1:8124/</code></pre>\n<p>All of the examples in the documentation can be run similarly.\n</p>\n"}]}
View
1 public/json/0.8.1/timers.json
@@ -1 +0,0 @@
-{"source":"doc/api/timers.markdown","modules":[{"textRaw":"Timers","name":"timers","stability":5,"stabilityText":"Locked","desc":"<p>All of the timer functions are globals. You do not need to <code>require()</code>\nthis module in order to use them.\n\n</p>\n","methods":[{"textRaw":"setTimeout(callback, delay, [arg], [...])","type":"method","name":"setTimeout","desc":"<p>To schedule execution of a one-time <code>callback</code> after <code>delay</code> milliseconds. Returns a\n<code>timeoutId</code> for possible use with <code>clearTimeout()</code>. Optionally you can\nalso pass arguments to the callback.\n\n</p>\n<p>It is important to note that your callback will probably not be called in exactly\n<code>delay</code> milliseconds - Node.js makes no guarantees about the exact timing of when\nthe callback will fire, nor of the ordering things will fire in. The callback will\nbe called as close as possible to the time specified.\n\n</p>\n","signatures":[{"params":[{"name":"callback"},{"name":"delay"},{"name":"arg","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"clearTimeout(timeoutId)","type":"method","name":"clearTimeout","desc":"<p>Prevents a timeout from triggering.\n\n</p>\n","signatures":[{"params":[{"name":"timeoutId"}]}]},{"textRaw":"setInterval(callback, delay, [arg], [...])","type":"method","name":"setInterval","desc":"<p>To schedule the repeated execution of <code>callback</code> every <code>delay</code> milliseconds.\nReturns a <code>intervalId</code> for possible use with <code>clearInterval()</code>. Optionally\nyou can also pass arguments to the callback.\n\n</p>\n","signatures":[{"params":[{"name":"callback"},{"name":"delay"},{"name":"arg","optional":true},{"name":"...","optional":true}]}]},{"textRaw":"clearInterval(intervalId)","type":"method","name":"clearInterval","desc":"<p>Stops a interval from triggering.\n</p>\n","signatures":[{"params":[{"name":"intervalId"}]}]}],"type":"module","displayName":"Timers"}]}
View
1 public/json/0.8.1/tls.json
@@ -1 +0,0 @@
-{"source":"doc/api/tls.markdown","modules":[{"textRaw":"TLS (SSL)","name":"tls_(ssl)","stability":3,"stabilityText":"Stable","desc":"<p>Use <code>require(&apos;tls&apos;)</code> to access this module.\n\n</p>\n<p>The <code>tls</code> module uses OpenSSL to provide Transport Layer Security and/or\nSecure Socket Layer: encrypted stream communication.\n\n</p>\n<p>TLS/SSL is a public/private key infrastructure. Each client and each\nserver must have a private key. A private key is created like this\n\n</p>\n<pre><code>openssl genrsa -out ryans-key.pem 1024</code></pre>\n<p>All severs and some clients need to have a certificate. Certificates are public\nkeys signed by a Certificate Authority or self-signed. The first step to\ngetting a certificate is to create a &quot;Certificate Signing Request&quot; (CSR)\nfile. This is done with:\n\n</p>\n<pre><code>openssl req -new -key ryans-key.pem -out ryans-csr.pem</code></pre>\n<p>To create a self-signed certificate with the CSR, do this:\n\n</p>\n<pre><code>openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem</code></pre>\n<p>Alternatively you can send the CSR to a Certificate Authority for signing.\n\n</p>\n<p>(TODO: docs on creating a CA, for now interested users should just look at\n<code>test/fixtures/keys/Makefile</code> in the Node source code)\n\n</p>\n<p>To create .pfx or .p12, do this:\n\n</p>\n<pre><code>openssl pkcs12 -export -in agent5-cert.pem -inkey agent5-key.pem \\\n -certfile ca-cert.pem -out agent5.pfx</code></pre>\n<ul>\n<li><code>in</code>: certificate</li>\n<li><code>inkey</code>: private key</li>\n<li><code>certfile</code>: all CA certs concatenated in one file like\n<code>cat ca1-cert.pem ca2-cert.pem &gt; ca-cert.pem</code></li>\n</ul>\n","miscs":[{"textRaw":"Client-initiated renegotiation attack mitigation","name":"Client-initiated renegotiation attack mitigation","type":"misc","desc":"<p>The TLS protocol lets the client renegotiate certain aspects of the TLS session.\nUnfortunately, session renegotiation requires a disproportional amount of\nserver-side resources, which makes it a potential vector for denial-of-service\nattacks.\n\n</p>\n<p>To mitigate this, renegotiations are limited to three times every 10 minutes. An\nerror is emitted on the [CleartextStream][] instance when the threshold is\nexceeded. The limits are configurable:\n\n</p>\n<ul>\n<li><p><code>tls.CLIENT_RENEG_LIMIT</code>: renegotiation limit, default is 3.</p>\n</li>\n<li><p><code>tls.CLIENT_RENEG_WINDOW</code>: renegotiation window in seconds, default is</p>\n<pre><code> 10 minutes.</code></pre>\n</li>\n</ul>\n<p>Don&apos;t change the defaults unless you know what you are doing.\n\n</p>\n<p>To test your server, connect to it with <code>openssl s_client -connect address:port</code>\nand tap <code>R&lt;CR&gt;</code> (that&apos;s the letter <code>R</code> followed by a carriage return) a few\ntimes.\n\n\n</p>\n"},{"textRaw":"NPN and SNI","name":"NPN and SNI","type":"misc","desc":"<p>NPN (Next Protocol Negotiation) and SNI (Server Name Indication) are TLS\nhandshake extensions allowing you:\n\n</p>\n<ul>\n<li>NPN - to use one TLS server for multiple protocols (HTTP, SPDY)</li>\n<li>SNI - to use one TLS server for multiple hostnames with different SSL\ncertificates.</li>\n</ul>\n"}],"methods":[{"textRaw":"tls.createServer(options, [secureConnectionListener])","type":"method","name":"createServer","desc":"<p>Creates a new [tls.Server][]. The <code>connectionListener</code> argument is\nautomatically set as a listener for the [secureConnection][] event. The\n<code>options</code> object has these possibilities:\n\n</p>\n<ul>\n<li><p><code>pfx</code>: A string or <code>Buffer</code> containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\nthe <code>key</code>, <code>cert</code> and <code>ca</code> options.)</p>\n</li>\n<li><p><code>key</code>: A string or <code>Buffer</code> containing the private key of the server in\nPEM format. (Required)</p>\n</li>\n<li><p><code>passphrase</code>: A string of passphrase for the private key or pfx.</p>\n</li>\n<li><p><code>cert</code>: A string or <code>Buffer</code> containing the certificate key of the server in\nPEM format. (Required)</p>\n</li>\n<li><p><code>ca</code>: An array of strings or <code>Buffer</code>s of trusted certificates. If this is\nomitted several well known &quot;root&quot; CAs will be used, like VeriSign.\nThese are used to authorize connections.</p>\n</li>\n<li><p><code>crl</code> : Either a string or list of strings of PEM encoded CRLs (Certificate\nRevocation List)</p>\n</li>\n<li><p><code>ciphers</code>: A string describing the ciphers to use or exclude. Consult\n<a href=\"http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT\">http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT</a> for\ndetails on the format.\nTo mitigate [BEAST attacks]\n(<a href=\"http://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html\">http://blog.ivanristic.com/2011/10/mitigating-the-beast-attack-on-tls.html</a>),\nit is recommended that you use this option in conjunction with the\n<code>honorCipherOrder</code> option described below to prioritize the RC4 algorithm,\nsince it is a non-CBC cipher. A recommended cipher list follows:\n<code>ECDHE-RSA-AES256-SHA:AES256-SHA:RC4-SHA:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM</code></p>\n</li>\n<li><p><code>honorCipherOrder</code> :\nWhen choosing a cipher, use the server&apos;s preferences instead of the client\npreferences.\nNote that if SSLv2 is used, the server will send its list of preferences\nto the client, and the client chooses the cipher.\nAlthough, this option is disabled by default, it is <em>recommended</em> that you\nuse this option in conjunction with the <code>ciphers</code> option to mitigate\nBEAST attacks.</p>\n</li>\n<li><p><code>requestCert</code>: If <code>true</code> the server will request a certificate from\nclients that connect and attempt to verify that certificate. Default:\n<code>false</code>.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: If <code>true</code> the server will reject any connection\nwhich is not authorized with the list of supplied CAs. This option only\nhas an effect if <code>requestCert</code> is <code>true</code>. Default: <code>false</code>.</p>\n</li>\n<li><p><code>NPNProtocols</code>: An array or <code>Buffer</code> of possible NPN protocols. (Protocols\nshould be ordered by their priority).</p>\n</li>\n<li><p><code>SNICallback</code>: A function that will be called if client supports SNI TLS\nextension. Only one argument will be passed to it: <code>servername</code>. And\n<code>SNICallback</code> should return SecureContext instance.\n(You can use <code>crypto.createCredentials(...).context</code> to get proper\nSecureContext). If <code>SNICallback</code> wasn&apos;t provided - default callback with\nhigh-level API will be used (see below).</p>\n</li>\n<li><p><code>sessionIdContext</code>: A string containing a opaque identifier for session\nresumption. If <code>requestCert</code> is <code>true</code>, the default is MD5 hash value\ngenerated from command-line. Otherwise, the default is not provided.</p>\n</li>\n</ul>\n<p>Here is a simple example echo server:\n\n</p>\n<pre><code>var tls = require(&apos;tls&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n key: fs.readFileSync(&apos;server-key.pem&apos;),\n cert: fs.readFileSync(&apos;server-cert.pem&apos;),\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(&apos;client-cert.pem&apos;) ]\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n console.log(&apos;server connected&apos;,\n cleartextStream.authorized ? &apos;authorized&apos; : &apos;unauthorized&apos;);\n cleartextStream.write(&quot;welcome!\\n&quot;);\n cleartextStream.setEncoding(&apos;utf8&apos;);\n cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n console.log(&apos;server bound&apos;);\n});</code></pre>\n<p>Or\n\n</p>\n<pre><code>var tls = require(&apos;tls&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n pfx: fs.readFileSync(&apos;server.pfx&apos;),\n\n // This is necessary only if using the client certificate authentication.\n requestCert: true,\n\n};\n\nvar server = tls.createServer(options, function(cleartextStream) {\n console.log(&apos;server connected&apos;,\n cleartextStream.authorized ? &apos;authorized&apos; : &apos;unauthorized&apos;);\n cleartextStream.write(&quot;welcome!\\n&quot;);\n cleartextStream.setEncoding(&apos;utf8&apos;);\n cleartextStream.pipe(cleartextStream);\n});\nserver.listen(8000, function() {\n console.log(&apos;server bound&apos;);\n});</code></pre>\n<p>You can test this server by connecting to it with <code>openssl s_client</code>:\n\n\n</p>\n<pre><code>openssl s_client -connect 127.0.0.1:8000</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"secureConnectionListener","optional":true}]}]},{"textRaw":"tls.connect(options, [secureConnectListener])","type":"method","name":"connect","desc":"<p>Creates a new client connection to the given <code>port</code> and <code>host</code> (old API) or\n<code>options.port</code> and <code>options.host</code>. (If <code>host</code> is omitted, it defaults to\n<code>localhost</code>.) <code>options</code> should be an object which specifies:\n\n</p>\n<ul>\n<li><p><code>host</code>: Host the client should connect to</p>\n</li>\n<li><p><code>port</code>: Port the client should connect to</p>\n</li>\n<li><p><code>socket</code>: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, <code>host</code> and <code>port</code>\nare ignored.</p>\n</li>\n<li><p><code>pfx</code>: A string or <code>Buffer</code> containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.</p>\n</li>\n<li><p><code>key</code>: A string or <code>Buffer</code> containing the private key of the client in\nPEM format.</p>\n</li>\n<li><p><code>passphrase</code>: A string of passphrase for the private key or pfx.</p>\n</li>\n<li><p><code>cert</code>: A string or <code>Buffer</code> containing the certificate key of the client in\nPEM format.</p>\n</li>\n<li><p><code>ca</code>: An array of strings or <code>Buffer</code>s of trusted certificates. If this is\nomitted several well known &quot;root&quot; CAs will be used, like VeriSign.\nThese are used to authorize connections.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: If <code>true</code>, the server certificate is verified against\nthe list of supplied CAs. An <code>&apos;error&apos;</code> event is emitted if verification\nfails. Default: <code>false</code>.</p>\n</li>\n<li><p><code>NPNProtocols</code>: An array of string or <code>Buffer</code> containing supported NPN\nprotocols. <code>Buffer</code> should have following format: <code>0x05hello0x05world</code>,\nwhere first byte is next protocol name&apos;s length. (Passing array should\nusually be much simpler: <code>[&apos;hello&apos;, &apos;world&apos;]</code>.)</p>\n</li>\n<li><p><code>servername</code>: Servername for SNI (Server Name Indication) TLS extension.</p>\n</li>\n</ul>\n<p>The <code>secureConnectListener</code> parameter will be added as a listener for the\n[&apos;secureConnect&apos;][] event.\n\n</p>\n<p><code>tls.connect()</code> returns a [CleartextStream][] object.\n\n</p>\n<p>Here is an example of a client of echo server as described previously:\n\n</p>\n<pre><code>var tls = require(&apos;tls&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n // These are necessary only if using the client certificate authentication\n key: fs.readFileSync(&apos;client-key.pem&apos;),\n cert: fs.readFileSync(&apos;client-cert.pem&apos;),\n\n // This is necessary only if the server uses the self-signed certificate\n ca: [ fs.readFileSync(&apos;server-cert.pem&apos;) ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n console.log(&apos;client connected&apos;,\n cleartextStream.authorized ? &apos;authorized&apos; : &apos;unauthorized&apos;);\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n});\ncleartextStream.setEncoding(&apos;utf8&apos;);\ncleartextStream.on(&apos;data&apos;, function(data) {\n console.log(data);\n});\ncleartextStream.on(&apos;end&apos;, function() {\n server.close();\n});</code></pre>\n<p>Or\n\n</p>\n<pre><code>var tls = require(&apos;tls&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n pfx: fs.readFileSync(&apos;client.pfx&apos;)\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n console.log(&apos;client connected&apos;,\n cleartextStream.authorized ? &apos;authorized&apos; : &apos;unauthorized&apos;);\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n});\ncleartextStream.setEncoding(&apos;utf8&apos;);\ncleartextStream.on(&apos;data&apos;, function(data) {\n console.log(data);\n});\ncleartextStream.on(&apos;end&apos;, function() {\n server.close();\n});</code></pre>\n","signatures":[{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"options","optional":true},{"name":"secureConnectListener","optional":true}]},{"params":[{"name":"options"},{"name":"secureConnectListener","optional":true}]}]},{"textRaw":"tls.connect(port, [host], [options], [secureConnectListener])","type":"method","name":"connect","desc":"<p>Creates a new client connection to the given <code>port</code> and <code>host</code> (old API) or\n<code>options.port</code> and <code>options.host</code>. (If <code>host</code> is omitted, it defaults to\n<code>localhost</code>.) <code>options</code> should be an object which specifies:\n\n</p>\n<ul>\n<li><p><code>host</code>: Host the client should connect to</p>\n</li>\n<li><p><code>port</code>: Port the client should connect to</p>\n</li>\n<li><p><code>socket</code>: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, <code>host</code> and <code>port</code>\nare ignored.</p>\n</li>\n<li><p><code>pfx</code>: A string or <code>Buffer</code> containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format.</p>\n</li>\n<li><p><code>key</code>: A string or <code>Buffer</code> containing the private key of the client in\nPEM format.</p>\n</li>\n<li><p><code>passphrase</code>: A string of passphrase for the private key or pfx.</p>\n</li>\n<li><p><code>cert</code>: A string or <code>Buffer</code> containing the certificate key of the client in\nPEM format.</p>\n</li>\n<li><p><code>ca</code>: An array of strings or <code>Buffer</code>s of trusted certificates. If this is\nomitted several well known &quot;root&quot; CAs will be used, like VeriSign.\nThese are used to authorize connections.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: If <code>true</code>, the server certificate is verified against\nthe list of supplied CAs. An <code>&apos;error&apos;</code> event is emitted if verification\nfails. Default: <code>false</code>.</p>\n</li>\n<li><p><code>NPNProtocols</code>: An array of string or <code>Buffer</code> containing supported NPN\nprotocols. <code>Buffer</code> should have following format: <code>0x05hello0x05world</code>,\nwhere first byte is next protocol name&apos;s length. (Passing array should\nusually be much simpler: <code>[&apos;hello&apos;, &apos;world&apos;]</code>.)</p>\n</li>\n<li><p><code>servername</code>: Servername for SNI (Server Name Indication) TLS extension.</p>\n</li>\n</ul>\n<p>The <code>secureConnectListener</code> parameter will be added as a listener for the\n[&apos;secureConnect&apos;][] event.\n\n</p>\n<p><code>tls.connect()</code> returns a [CleartextStream][] object.\n\n</p>\n<p>Here is an example of a client of echo server as described previously:\n\n</p>\n<pre><code>var tls = require(&apos;tls&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n // These are necessary only if using the client certificate authentication\n key: fs.readFileSync(&apos;client-key.pem&apos;),\n cert: fs.readFileSync(&apos;client-cert.pem&apos;),\n\n // This is necessary only if the server uses the self-signed certificate\n ca: [ fs.readFileSync(&apos;server-cert.pem&apos;) ]\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n console.log(&apos;client connected&apos;,\n cleartextStream.authorized ? &apos;authorized&apos; : &apos;unauthorized&apos;);\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n});\ncleartextStream.setEncoding(&apos;utf8&apos;);\ncleartextStream.on(&apos;data&apos;, function(data) {\n console.log(data);\n});\ncleartextStream.on(&apos;end&apos;, function() {\n server.close();\n});</code></pre>\n<p>Or\n\n</p>\n<pre><code>var tls = require(&apos;tls&apos;);\nvar fs = require(&apos;fs&apos;);\n\nvar options = {\n pfx: fs.readFileSync(&apos;client.pfx&apos;)\n};\n\nvar cleartextStream = tls.connect(8000, options, function() {\n console.log(&apos;client connected&apos;,\n cleartextStream.authorized ? &apos;authorized&apos; : &apos;unauthorized&apos;);\n process.stdin.pipe(cleartextStream);\n process.stdin.resume();\n});\ncleartextStream.setEncoding(&apos;utf8&apos;);\ncleartextStream.on(&apos;data&apos;, function(data) {\n console.log(data);\n});\ncleartextStream.on(&apos;end&apos;, function() {\n server.close();\n});</code></pre>\n","signatures":[{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"options","optional":true},{"name":"secureConnectListener","optional":true}]}]},{"textRaw":"tls.createSecurePair([credentials], [isServer], [requestCert], [rejectUnauthorized])","type":"method","name":"createSecurePair","desc":"<p>Creates a new secure pair object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data.\nGenerally the encrypted one is piped to/from an incoming encrypted data stream,\nand the cleartext one is used as a replacement for the initial encrypted stream.\n\n</p>\n<ul>\n<li><p><code>credentials</code>: A credentials object from crypto.createCredentials( ... )</p>\n</li>\n<li><p><code>isServer</code>: A boolean indicating whether this tls connection should be\nopened as a server or a client.</p>\n</li>\n<li><p><code>requestCert</code>: A boolean indicating whether a server should request a\ncertificate from a connecting client. Only applies to server connections.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: A boolean indicating whether a server should\nautomatically reject clients with invalid certificates. Only applies to\nservers with <code>requestCert</code> enabled.</p>\n</li>\n</ul>\n<p><code>tls.createSecurePair()</code> returns a SecurePair object with [cleartext][] and\n<code>encrypted</code> stream properties.\n\n</p>\n","signatures":[{"params":[{"name":"credentials","optional":true},{"name":"isServer","optional":true},{"name":"requestCert","optional":true},{"name":"rejectUnauthorized","optional":true}]}]}],"classes":[{"textRaw":"Class: SecurePair","type":"class","name":"SecurePair","desc":"<p>Returned by tls.createSecurePair.\n\n</p>\n","events":[{"textRaw":"Event: 'secure'","type":"event","name":"secure","desc":"<p>The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n\n</p>\n<p>Similarly to the checking for the server &apos;secureConnection&apos; event,\npair.cleartext.authorized should be checked to confirm whether the certificate\nused properly authorized.\n\n</p>\n","params":[]}]},{"textRaw":"Class: tls.Server","type":"class","name":"tls.Server","desc":"<p>This class is a subclass of <code>net.Server</code> and has the same methods on it.\nInstead of accepting just raw TCP connections, this accepts encrypted\nconnections using TLS or SSL.\n\n</p>\n","events":[{"textRaw":"Event: 'secureConnection'","type":"event","name":"secureConnection","desc":"<p><code>function (cleartextStream) {}</code>\n\n</p>\n<p>This event is emitted after a new connection has been successfully\nhandshaked. The argument is a instance of [CleartextStream][]. It has all the\ncommon stream methods and events.\n\n</p>\n<p><code>cleartextStream.authorized</code> is a boolean value which indicates if the\nclient has verified by one of the supplied certificate authorities for the\nserver. If <code>cleartextStream.authorized</code> is false, then\n<code>cleartextStream.authorizationError</code> is set to describe how authorization\nfailed. Implied but worth mentioning: depending on the settings of the TLS\nserver, you unauthorized connections may be accepted.\n<code>cleartextStream.npnProtocol</code> is a string containing selected NPN protocol.\n<code>cleartextStream.servername</code> is a string containing servername requested with\nSNI.\n\n\n</p>\n","params":[]},{"textRaw":"Event: 'clientError'","type":"event","name":"clientError","desc":"<p><code>function (exception) { }</code>\n\n</p>\n<p>When a client connection emits an &apos;error&apos; event before secure connection is\nestablished - it will be forwarded here.\n\n\n</p>\n","params":[]}],"methods":[{"textRaw":"server.listen(port, [host], [callback])","type":"method","name":"listen","desc":"<p>Begin accepting connections on the specified <code>port</code> and <code>host</code>. If the\n<code>host</code> is omitted, the server will accept connections directed to any\nIPv4 address (<code>INADDR_ANY</code>).\n\n</p>\n<p>This function is asynchronous. The last parameter <code>callback</code> will be called\nwhen the server has been bound.\n\n</p>\n<p>See <code>net.Server</code> for more information.\n\n\n</p>\n","signatures":[{"params":[{"name":"port"},{"name":"host","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"server.close()","type":"method","name":"close","desc":"<p>Stops the server from accepting new connections. This function is\nasynchronous, the server is finally closed when the server emits a <code>&apos;close&apos;</code>\nevent.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"server.address()","type":"method","name":"address","desc":"<p>Returns the bound address, the address family name and port of the\nserver as reported by the operating system. See [net.Server.address()][] for\nmore information.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"server.addContext(hostname, credentials)","type":"method","name":"addContext","desc":"<p>Add secure context that will be used if client request&apos;s SNI hostname is\nmatching passed <code>hostname</code> (wildcards can be used). <code>credentials</code> can contain\n<code>key</code>, <code>cert</code> and <code>ca</code>.\n\n</p>\n","signatures":[{"params":[{"name":"hostname"},{"name":"credentials"}]}]}],"properties":[{"textRaw":"server.maxConnections","name":"maxConnections","desc":"<p>Set this property to reject connections when the server&apos;s connection count\ngets high.\n\n</p>\n"},{"textRaw":"server.connections","name":"connections","desc":"<p>The number of concurrent connections on the server.\n\n\n</p>\n"}]},{"textRaw":"Class: tls.CleartextStream","type":"class","name":"tls.CleartextStream","desc":"<p>This is a stream on top of the <em>Encrypted</em> stream that makes it possible to\nread/write an encrypted data as a cleartext data.\n\n</p>\n<p>This instance implements a duplex [Stream][] interfaces. It has all the\ncommon stream methods and events.\n\n</p>\n<p>A ClearTextStream is the <code>clear</code> member of a SecurePair object.\n\n</p>\n","events":[{"textRaw":"Event: 'secureConnect'","type":"event","name":"secureConnect","desc":"<p>This event is emitted after a new connection has been successfully handshaked. \nThe listener will be called no matter if the server&apos;s certificate was\nauthorized or not. It is up to the user to test <code>cleartextStream.authorized</code>\nto see if the server certificate was signed by one of the specified CAs.\nIf <code>cleartextStream.authorized === false</code> then the error can be found in\n<code>cleartextStream.authorizationError</code>. Also if NPN was used - you can check\n<code>cleartextStream.npnProtocol</code> for negotiated protocol.\n\n</p>\n","params":[]}],"properties":[{"textRaw":"cleartextStream.authorized","name":"authorized","desc":"<p>A boolean that is <code>true</code> if the peer certificate was signed by one of the\nspecified CAs, otherwise <code>false</code>\n\n</p>\n"},{"textRaw":"cleartextStream.authorizationError","name":"authorizationError","desc":"<p>The reason why the peer&apos;s certificate has not been verified. This property\nbecomes available only when <code>cleartextStream.authorized === false</code>.\n\n</p>\n"},{"textRaw":"cleartextStream.remoteAddress","name":"remoteAddress","desc":"<p>The string representation of the remote IP address. For example,\n<code>&apos;74.125.127.100&apos;</code> or <code>&apos;2001:4860:a005::68&apos;</code>.\n\n</p>\n"},{"textRaw":"cleartextStream.remotePort","name":"remotePort","desc":"<p>The numeric representation of the remote port. For example, <code>443</code>.\n\n</p>\n"}],"methods":[{"textRaw":"cleartextStream.getPeerCertificate()","type":"method","name":"getPeerCertificate","desc":"<p>Returns an object representing the peer&apos;s certificate. The returned object has\nsome properties corresponding to the field of the certificate.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>{ subject: \n { C: &apos;UK&apos;,\n ST: &apos;Acknack Ltd&apos;,\n L: &apos;Rhys Jones&apos;,\n O: &apos;node.js&apos;,\n OU: &apos;Test TLS Certificate&apos;,\n CN: &apos;localhost&apos; },\n issuer: \n { C: &apos;UK&apos;,\n ST: &apos;Acknack Ltd&apos;,\n L: &apos;Rhys Jones&apos;,\n O: &apos;node.js&apos;,\n OU: &apos;Test TLS Certificate&apos;,\n CN: &apos;localhost&apos; },\n valid_from: &apos;Nov 11 09:52:22 2009 GMT&apos;,\n valid_to: &apos;Nov 6 09:52:22 2029 GMT&apos;,\n fingerprint: &apos;2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF&apos; }</code></pre>\n<p>If the peer does not provide a certificate, it returns <code>null</code> or an empty\nobject.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"cleartextStream.getCipher()","type":"method","name":"getCipher","desc":"<p>Returns an object representing the cipher name and the SSL/TLS\nprotocol version of the current connection.\n\n</p>\n<p>Example:\n{ name: &apos;AES256-SHA&apos;, version: &apos;TLSv1/SSLv3&apos; }\n\n</p>\n<p>See SSL_CIPHER_get_name() and SSL_CIPHER_get_version() in\n<a href=\"http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_CIPHERS\">http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_CIPHERS</a> for more\ninformation.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"cleartextStream.address()","type":"method","name":"address","desc":"<p>Returns the bound address, the address family name and port of the\nunderlying socket as reported by the operating system. Returns an\nobject with three properties, e.g.\n<code>{ port: 12346, family: &apos;IPv4&apos;, address: &apos;127.0.0.1&apos; }</code>\n\n</p>\n","signatures":[{"params":[]}]}]}],"type":"module","displayName":"TLS (SSL)"}]}
View
1 public/json/0.8.1/tty.json
@@ -1 +0,0 @@
-{"source":"doc/api/tty.markdown","modules":[{"textRaw":"TTY","name":"tty","stability":2,"stabilityText":"Unstable","desc":"<p>The <code>tty</code> module houses the <code>tty.ReadStream</code> and <code>tty.WriteStream</code> classes. In\nmost cases, you will not need to use this module directly.\n\n</p>\n<p>When node detects that it is being run inside a TTY context, then <code>process.stdin</code>\nwill be a <code>tty.ReadStream</code> instance and <code>process.stdout</code> will be\na <code>tty.WriteStream</code> instance. The preferred way to check if node is being run in\na TTY context is to check <code>process.stdout.isTTY</code>:\n\n</p>\n<pre><code>$ node -p -e &quot;Boolean(process.stdout.isTTY)&quot;\ntrue\n$ node -p -e &quot;Boolean(process.stdout.isTTY)&quot; | cat\nfalse</code></pre>\n","methods":[{"textRaw":"tty.isatty(fd)","type":"method","name":"isatty","desc":"<p>Returns <code>true</code> or <code>false</code> depending on if the <code>fd</code> is associated with a\nterminal.\n\n\n</p>\n","signatures":[{"params":[{"name":"fd"}]}]},{"textRaw":"tty.setRawMode(mode)","type":"method","name":"setRawMode","desc":"<p>Deprecated. Use <code>tty.ReadStream#setRawMode()</code>\n(i.e. <code>process.stdin.setRawMode()</code>) instead.\n\n\n</p>\n","signatures":[{"params":[{"name":"mode"}]}]}],"classes":[{"textRaw":"Class: ReadStream","type":"class","name":"ReadStream","desc":"<p>A <code>net.Socket</code> subclass that represents the readable portion of a tty. In normal\ncircumstances, <code>process.stdin</code> will be the only <code>tty.ReadStream</code> instance in any\nnode program (only when <code>isatty(0)</code> is true).\n\n</p>\n","properties":[{"textRaw":"rs.isRaw","name":"isRaw","desc":"<p>A <code>Boolean</code> that is initialized to <code>false</code>. It represents the current &quot;raw&quot; state\nof the <code>tty.ReadStream</code> instance.\n\n</p>\n"}],"methods":[{"textRaw":"rs.setRawMode(mode)","type":"method","name":"setRawMode","desc":"<p><code>mode</code> should be <code>true</code> or <code>false</code>. This sets the properties of the\n<code>tty.ReadStream</code> to act either as a raw device or default. <code>isRaw</code> will be set\nto the resulting mode.\n\n\n</p>\n","signatures":[{"params":[{"name":"mode"}]}]}]}],"modules":[{"textRaw":"Class WriteStream","name":"class_writestream","desc":"<p>A <code>net.Socket</code> subclass that represents the writable portion of a tty. In normal\ncircumstances, <code>process.stdout</code> will be the only <code>tty.WriteStream</code> instance\never created (and only when <code>isatty(1)</code> is true).\n\n</p>\n","properties":[{"textRaw":"ws.columns","name":"columns","desc":"<p>A <code>Number</code> that gives the number of columns the TTY currently has. This property\ngets updated on &quot;resize&quot; events.\n\n</p>\n"},{"textRaw":"ws.rows","name":"rows","desc":"<p>A <code>Number</code> that gives the number of rows the TTY currently has. This property\ngets updated on &quot;resize&quot; events.\n\n</p>\n"}],"events":[{"textRaw":"Event: 'resize'","type":"event","name":"resize","desc":"<p><code>function () {}</code>\n\n</p>\n<p>Emitted by <code>refreshSize()</code> when either of the <code>columns</code> or <code>rows</code> properties\nhas changed.\n\n</p>\n<pre><code>process.stdout.on(&apos;resize&apos;, function() {\n console.log(&apos;screen size has changed!&apos;);\n console.log(process.stdout.columns + &apos;x&apos; + process.stdout.rows);\n});</code></pre>\n","params":[]}],"type":"module","displayName":"Class WriteStream"}],"type":"module","displayName":"TTY"}]}
View
1 public/json/0.8.1/url.json
@@ -1 +0,0 @@
-{"source":"doc/api/url.markdown","modules":[{"textRaw":"URL","name":"url","stability":3,"stabilityText":"Stable","desc":"<p>This module has utilities for URL resolution and parsing.\nCall <code>require(&apos;url&apos;)</code> to use it.\n\n</p>\n<p>Parsed 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 will not be in the parsed object. Examples are shown for the URL\n\n</p>\n<p><code>&apos;http://user:pass@host.com:8080/p/a/t/h?query=string#hash&apos;</code>\n\n</p>\n<ul>\n<li><p><code>href</code>: The full URL that was originally parsed. Both the protocol and host are lowercased.</p>\n<p> Example: <code>&apos;http://user:pass@host.com:8080/p/a/t/h?query=string#hash&apos;</code></p>\n</li>\n<li><p><code>protocol</code>: The request protocol, lowercased.</p>\n<p> Example: <code>&apos;http:&apos;</code></p>\n</li>\n<li><p><code>host</code>: The full lowercased host portion of the URL, including port\ninformation.</p>\n<p> Example: <code>&apos;host.com:8080&apos;</code></p>\n</li>\n<li><p><code>auth</code>: The authentication information portion of a URL.</p>\n<p> Example: <code>&apos;user:pass&apos;</code></p>\n</li>\n<li><p><code>hostname</code>: Just the lowercased hostname portion of the host.</p>\n<p> Example: <code>&apos;host.com&apos;</code></p>\n</li>\n<li><p><code>port</code>: The port number portion of the host.</p>\n<p> Example: <code>&apos;8080&apos;</code></p>\n</li>\n<li><p><code>pathname</code>: The path section of the URL, that comes after the host and\nbefore the query, including the initial slash if present.</p>\n<p> Example: <code>&apos;/p/a/t/h&apos;</code></p>\n</li>\n<li><p><code>search</code>: The &apos;query string&apos; portion of the URL, including the leading\nquestion mark.</p>\n<p> Example: <code>&apos;?query=string&apos;</code></p>\n</li>\n<li><p><code>path</code>: Concatenation of <code>pathname</code> and <code>search</code>.</p>\n<p> Example: <code>&apos;/p/a/t/h?query=string&apos;</code></p>\n</li>\n<li><p><code>query</code>: Either the &apos;params&apos; portion of the query string, or a\nquerystring-parsed object.</p>\n<p> Example: <code>&apos;query=string&apos;</code> or <code>{&apos;query&apos;:&apos;string&apos;}</code></p>\n</li>\n<li><p><code>hash</code>: The &apos;fragment&apos; portion of the URL including the pound-sign.</p>\n<p> Example: <code>&apos;#hash&apos;</code></p>\n</li>\n</ul>\n<p>The following methods are provided by the URL module:\n\n</p>\n","methods":[{"textRaw":"url.parse(urlStr, [parseQueryString], [slashesDenoteHost])","type":"method","name":"parse","desc":"<p>Take a URL string, and return an object.\n\n</p>\n<p>Pass <code>true</code> as the second argument to also parse\nthe query string using the <code>querystring</code> module.\nDefaults to <code>false</code>.\n\n</p>\n<p>Pass <code>true</code> as the third argument to treat <code>//foo/bar</code> as\n<code>{ host: &apos;foo&apos;, pathname: &apos;/bar&apos; }</code> rather than\n<code>{ pathname: &apos;//foo/bar&apos; }</code>. Defaults to <code>false</code>.\n\n</p>\n","signatures":[{"params":[{"name":"urlStr"},{"name":"parseQueryString","optional":true},{"name":"slashesDenoteHost","optional":true}]}]},{"textRaw":"url.format(urlObj)","type":"method","name":"format","desc":"<p>Take a parsed URL object, and return a formatted URL string.\n\n</p>\n<ul>\n<li><code>href</code> will be ignored.</li>\n<li><code>protocol</code>is treated the same with or without the trailing <code>:</code> (colon).<ul>\n<li>The protocols <code>http</code>, <code>https</code>, <code>ftp</code>, <code>gopher</code>, <code>file</code> will be\npostfixed with <code>://</code> (colon-slash-slash).</li>\n<li>All other protocols <code>mailto</code>, <code>xmpp</code>, <code>aim</code>, <code>sftp</code>, <code>foo</code>, etc will\nbe postfixed with <code>:</code> (colon)</li>\n</ul>\n</li>\n<li><code>auth</code> will be used if present.</li>\n<li><code>hostname</code> will only be used if <code>host</code> is absent.</li>\n<li><code>port</code> will only be used if <code>host</code> is absent.</li>\n<li><code>host</code> will be used in place of <code>hostname</code> and <code>port</code></li>\n<li><code>pathname</code> is treated the same with or without the leading <code>/</code> (slash)</li>\n<li><code>search</code> will be used in place of <code>query</code></li>\n<li><code>query</code> (object; see <code>querystring</code>) will only be used if <code>search</code> is absent.</li>\n<li><code>search</code> is treated the same with or without the leading <code>?</code> (question mark)</li>\n<li><code>hash</code> is treated the same with or without the leading <code>#</code> (pound sign, anchor)</li>\n</ul>\n","signatures":[{"params":[{"name":"urlObj"}]}]},{"textRaw":"url.resolve(from, to)","type":"method","name":"resolve","desc":"<p>Take a base URL, and a href URL, and resolve them as a browser would for\nan anchor tag.\n</p>\n","signatures":[{"params":[{"name":"from"},{"name":"to"}]}]}],"type":"module","displayName":"URL"}]}
View
1 public/json/0.8.1/util.json
@@ -1 +0,0 @@
-{"source":"doc/api/util.markdown","modules":[{"textRaw":"util","name":"util","stability":5,"stabilityText":"Locked","desc":"<p>These functions are in the module <code>&apos;util&apos;</code>. Use <code>require(&apos;util&apos;)</code> to access\nthem.\n\n\n</p>\n","methods":[{"textRaw":"util.format(format, [...])","type":"method","name":"format","desc":"<p>Returns a formatted string using the first argument as a <code>printf</code>-like format.\n\n</p>\n<p>The first argument is a string that contains zero or more <em>placeholders</em>.\nEach placeholder is replaced with the converted value from its corresponding\nargument. Supported placeholders are:\n\n</p>\n<ul>\n<li><code>%s</code> - String.</li>\n<li><code>%d</code> - Number (both integer and float).</li>\n<li><code>%j</code> - JSON.</li>\n<li><code>%</code> - single percent sign (<code>&apos;%&apos;</code>). This does not consume an argument.</li>\n</ul>\n<p>If the placeholder does not have a corresponding argument, the placeholder is\nnot replaced.\n\n</p>\n<pre><code>util.format(&apos;%s:%s&apos;, &apos;foo&apos;); // &apos;foo:%s&apos;</code></pre>\n<p>If there are more arguments than placeholders, the extra arguments are\nconverted to strings with <code>util.inspect()</code> and these strings are concatenated,\ndelimited by a space.\n\n</p>\n<pre><code>util.format(&apos;%s:%s&apos;, &apos;foo&apos;, &apos;bar&apos;, &apos;baz&apos;); // &apos;foo:bar baz&apos;</code></pre>\n<p>If the first argument is not a format string then <code>util.format()</code> returns\na string that is the concatenation of all its arguments separated by spaces.\nEach argument is converted to a string with <code>util.inspect()</code>.\n\n</p>\n<pre><code>util.format(1, 2, 3); // &apos;1 2 3&apos;</code></pre>\n","signatures":[{"params":[{"name":"format"},{"name":"...","optional":true}]}]},{"textRaw":"util.debug(string)","type":"method","name":"debug","desc":"<p>A synchronous output function. Will block the process and\noutput <code>string</code> immediately to <code>stderr</code>.\n\n</p>\n<pre><code>require(&apos;util&apos;).debug(&apos;message on stderr&apos;);</code></pre>\n","signatures":[{"params":[{"name":"string"}]}]},{"textRaw":"util.error([...])","type":"method","name":"error","desc":"<p>Same as <code>util.debug()</code> except this will output all arguments immediately to\n<code>stderr</code>.\n\n</p>\n","signatures":[{"params":[{"name":"...","optional":true}]}]},{"textRaw":"util.puts([...])","type":"method","name":"puts","desc":"<p>A synchronous output function. Will block the process and output all arguments\nto <code>stdout</code> with newlines after each argument.\n\n</p>\n","signatures":[{"params":[{"name":"...","optional":true}]}]},{"textRaw":"util.print([...])","type":"method","name":"print","desc":"<p>A synchronous output function. Will block the process, cast each argument to a\nstring then output to <code>stdout</code>. Does not place newlines after each argument.\n\n</p>\n","signatures":[{"params":[{"name":"...","optional":true}]}]},{"textRaw":"util.log(string)","type":"method","name":"log","desc":"<p>Output with timestamp on <code>stdout</code>.\n\n</p>\n<pre><code>require(&apos;util&apos;).log(&apos;Timestamped message.&apos;);</code></pre>\n","signatures":[{"params":[{"name":"string"}]}]},{"textRaw":"util.inspect(object, [showHidden], [depth], [colors])","type":"method","name":"inspect","desc":"<p>Return a string representation of <code>object</code>, which is useful for debugging.\n\n</p>\n<p>If <code>showHidden</code> is <code>true</code>, then the object&apos;s non-enumerable properties will be\nshown too. Defaults to <code>false</code>.\n\n</p>\n<p>If <code>depth</code> is provided, it tells <code>inspect</code> how many times to recurse while\nformatting the object. This is useful for inspecting large complicated objects.\n\n</p>\n<p>The default is to only recurse twice. To make it recurse indefinitely, pass\nin <code>null</code> for <code>depth</code>.\n\n</p>\n<p>If <code>colors</code> is <code>true</code>, the output will be styled with ANSI color codes.\nDefaults to <code>false</code>.\n\n</p>\n<p>Example of inspecting all properties of the <code>util</code> object:\n\n</p>\n<pre><code>var util = require(&apos;util&apos;);\n\nconsole.log(util.inspect(util, true, null));</code></pre>\n","signatures":[{"params":[{"name":"object"},{"name":"showHidden","optional":true},{"name":"depth","optional":true},{"name":"colors","optional":true}]}]},{"textRaw":"util.isArray(object)","type":"method","name":"isArray","desc":"<p>Returns <code>true</code> if the given &quot;object&quot; is an <code>Array</code>. <code>false</code> otherwise.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;);\n\nutil.isArray([])\n // true\nutil.isArray(new Array)\n // true\nutil.isArray({})\n // false</code></pre>\n","signatures":[{"params":[{"name":"object"}]}]},{"textRaw":"util.isRegExp(object)","type":"method","name":"isRegExp","desc":"<p>Returns <code>true</code> if the given &quot;object&quot; is a <code>RegExp</code>. <code>false</code> otherwise.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;);\n\nutil.isRegExp(/some regexp/)\n // true\nutil.isRegExp(new RegExp(&apos;another regexp&apos;))\n // true\nutil.isRegExp({})\n // false</code></pre>\n","signatures":[{"params":[{"name":"object"}]}]},{"textRaw":"util.isDate(object)","type":"method","name":"isDate","desc":"<p>Returns <code>true</code> if the given &quot;object&quot; is a <code>Date</code>. <code>false</code> otherwise.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;);\n\nutil.isDate(new Date())\n // true\nutil.isDate(Date())\n // false (without &apos;new&apos; returns a String)\nutil.isDate({})\n // false</code></pre>\n","signatures":[{"params":[{"name":"object"}]}]},{"textRaw":"util.isError(object)","type":"method","name":"isError","desc":"<p>Returns <code>true</code> if the given &quot;object&quot; is an <code>Error</code>. <code>false</code> otherwise.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;);\n\nutil.isError(new Error())\n // true\nutil.isError(new TypeError())\n // true\nutil.isError({ name: &apos;Error&apos;, message: &apos;an error occurred&apos; })\n // false</code></pre>\n","signatures":[{"params":[{"name":"object"}]}]},{"textRaw":"util.pump(readableStream, writableStream, [callback])","type":"method","name":"pump","desc":"<p>Experimental\n\n</p>\n<p>Read the data from <code>readableStream</code> and send it to the <code>writableStream</code>.\nWhen <code>writableStream.write(data)</code> returns <code>false</code> <code>readableStream</code> will be\npaused until the <code>drain</code> event occurs on the <code>writableStream</code>. <code>callback</code> gets\nan error as its only argument and is called when <code>writableStream</code> is closed or\nwhen an error occurs.\n\n\n</p>\n","signatures":[{"params":[{"name":"readableStream"},{"name":"writableStream"},{"name":"callback","optional":true}]}]},{"textRaw":"util.inherits(constructor, superConstructor)","type":"method","name":"inherits","desc":"<p>Inherit the prototype methods from one\n<a href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor\">constructor</a>\ninto another. The prototype of <code>constructor</code> will be set to a new\nobject created from <code>superConstructor</code>.\n\n</p>\n<p>As an additional convenience, <code>superConstructor</code> will be accessible\nthrough the <code>constructor.super_</code> property.\n\n</p>\n<pre><code>var util = require(&quot;util&quot;);\nvar events = require(&quot;events&quot;);\n\nfunction MyStream() {\n events.EventEmitter.call(this);\n}\n\nutil.inherits(MyStream, events.EventEmitter);\n\nMyStream.prototype.write = function(data) {\n this.emit(&quot;data&quot;, data);\n}\n\nvar stream = new MyStream();\n\nconsole.log(stream instanceof events.EventEmitter); // true\nconsole.log(MyStream.super_ === events.EventEmitter); // true\n\nstream.on(&quot;data&quot;, function(data) {\n console.log(&apos;Received data: &quot;&apos; + data + &apos;&quot;&apos;);\n})\nstream.write(&quot;It works!&quot;); // Received data: &quot;It works!&quot;</code></pre>\n","signatures":[{"params":[{"name":"constructor"},{"name":"superConstructor"}]}]}],"type":"module","displayName":"util"}]}
View
1 public/json/0.8.1/vm.json
@@ -1 +0,0 @@
-{"source":"doc/api/vm.markdown","modules":[{"textRaw":"Executing JavaScript","name":"vm","stability":2,"stabilityText":"Unstable. See Caveats, below.","desc":"<p>You can access this module with:\n\n</p>\n<pre><code>var vm = require(&apos;vm&apos;);</code></pre>\n<p>JavaScript code can be compiled and run immediately or compiled, saved, and run later.\n\n</p>\n","modules":[{"textRaw":"Caveats","name":"caveats","desc":"<p>The <code>vm</code> module has many known issues and edge cases. If you run into\nissues or unexpected behavior, please consult\n<a href=\"https://github.com/joyent/node/issues/search?q=vm\">the open issues on GitHub</a>.\nSome of the biggest problems are described below.\n\n</p>\n","modules":[{"textRaw":"Sandboxes","name":"sandboxes","desc":"<p>The <code>sandbox</code> argument to <code>vm.runInNewContext</code> and <code>vm.createContext</code>,\nalong with the <code>initSandbox</code> argument to <code>vm.createContext</code>, do not\nbehave as one might normally expect and their behavior varies\nbetween different versions of Node.\n\n</p>\n<p>The key issue to be aware of is that V8 provides no way to directly\ncontrol the global object used within a context. As a result, while\nproperties of your <code>sandbox</code> object will be available in the context,\nany properties from the <code>prototype</code>s of the <code>sandbox</code> may not be\navailable. Furthermore, the <code>this</code> expression within the global scope\nof the context evaluates to the empty object (<code>{}</code>) instead of to\nyour sandbox.\n\n</p>\n<p>Your sandbox&apos;s properties are also not shared directly with the script.\nInstead, the properties of the sandbox are copied into the context at\nthe beginning of execution, and then after execution, the properties\nare copied back out in an attempt to propagate any changes.\n\n</p>\n","type":"module","displayName":"Sandboxes"},{"textRaw":"Globals","name":"globals","desc":"<p>Properties of the global object, like <code>Array</code> and <code>String</code>, have\ndifferent values inside of a context. This means that common\nexpressions like <code>[] instanceof Array</code> or\n<code>Object.getPrototypeOf([]) === Array.prototype</code> may not produce\nexpected results when used inside of scripts evaluated via the <code>vm</code> module.\n\n</p>\n<p>Some of these problems have known workarounds listed in the issues for\n<code>vm</code> on GitHub. for example, <code>Array.isArray</code> works around\nthe example problem with <code>Array</code>.\n\n</p>\n","type":"module","displayName":"Globals"}],"type":"module","displayName":"Caveats"}],"methods":[{"textRaw":"vm.runInThisContext(code, [filename])","type":"method","name":"runInThisContext","desc":"<p><code>vm.runInThisContext()</code> compiles <code>code</code>, runs it and returns the result. Running\ncode does not have access to local scope. <code>filename</code> is optional, it&apos;s used only\nin stack traces.\n\n</p>\n<p>Example of using <code>vm.runInThisContext</code> and <code>eval</code> to run the same code:\n\n</p>\n<pre><code>var localVar = 123,\n usingscript, evaled,\n vm = require(&apos;vm&apos;);\n\nusingscript = vm.runInThisContext(&apos;localVar = 1;&apos;,\n &apos;myfile.vm&apos;);\nconsole.log(&apos;localVar: &apos; + localVar + &apos;, usingscript: &apos; +\n usingscript);\nevaled = eval(&apos;localVar = 1;&apos;);\nconsole.log(&apos;localVar: &apos; + localVar + &apos;, evaled: &apos; +\n evaled);\n\n// localVar: 123, usingscript: 1\n// localVar: 1, evaled: 1</code></pre>\n<p><code>vm.runInThisContext</code> does not have access to the local scope, so <code>localVar</code> is unchanged.\n<code>eval</code> does have access to the local scope, so <code>localVar</code> is changed.\n\n</p>\n<p>In case of syntax error in <code>code</code>, <code>vm.runInThisContext</code> emits the syntax error to stderr\nand throws an exception.\n\n\n</p>\n","signatures":[{"params":[{"name":"code"},{"name":"filename","optional":true}]}]},{"textRaw":"vm.runInNewContext(code, [sandbox], [filename])","type":"method","name":"runInNewContext","desc":"<p><code>vm.runInNewContext</code> compiles <code>code</code>, then runs it in <code>sandbox</code> and returns the\nresult. Running code does not have access to local scope. The object <code>sandbox</code>\nwill be used as the global object for <code>code</code>.\n<code>sandbox</code> and <code>filename</code> are optional, <code>filename</code> is only used in stack traces.\n\n</p>\n<p>Example: compile and execute code that increments a global variable and sets a new one.\nThese globals are contained in the sandbox.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n vm = require(&apos;vm&apos;),\n sandbox = {\n animal: &apos;cat&apos;,\n count: 2\n };\n\nvm.runInNewContext(&apos;count += 1; name = &quot;kitty&quot;&apos;, sandbox, &apos;myfile.vm&apos;);\nconsole.log(util.inspect(sandbox));\n\n// { animal: &apos;cat&apos;, count: 3, name: &apos;kitty&apos; }</code></pre>\n<p>Note that running untrusted code is a tricky business requiring great care. To prevent accidental\nglobal variable leakage, <code>vm.runInNewContext</code> is quite useful, but safely running untrusted code\nrequires a separate process.\n\n</p>\n<p>In case of syntax error in <code>code</code>, <code>vm.runInNewContext</code> emits the syntax error to stderr\nand throws an exception.\n\n</p>\n","signatures":[{"params":[{"name":"code"},{"name":"sandbox","optional":true},{"name":"filename","optional":true}]}]},{"textRaw":"vm.runInContext(code, context, [filename])","type":"method","name":"runInContext","desc":"<p><code>vm.runInContext</code> compiles <code>code</code>, then runs it in <code>context</code> and returns the\nresult. A (V8) context comprises a global object, together with a set of\nbuilt-in objects and functions. Running code does not have access to local scope\nand the global object held within <code>context</code> will be used as the global object\nfor <code>code</code>.\n<code>filename</code> is optional, it&apos;s used only in stack traces.\n\n</p>\n<p>Example: compile and execute code in a existing context.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n vm = require(&apos;vm&apos;),\n initSandbox = {\n animal: &apos;cat&apos;,\n count: 2\n },\n context = vm.createContext(initSandbox);\n\nvm.runInContext(&apos;count += 1; name = &quot;CATT&quot;&apos;, context, &apos;myfile.vm&apos;);\nconsole.log(util.inspect(context));\n\n// { animal: &apos;cat&apos;, count: 3, name: &apos;CATT&apos; }</code></pre>\n<p>Note that <code>createContext</code> will perform a shallow clone of the supplied sandbox object in order to\ninitialize the global object of the freshly constructed context.\n\n</p>\n<p>Note that running untrusted code is a tricky business requiring great care. To prevent accidental\nglobal variable leakage, <code>vm.runInContext</code> is quite useful, but safely running untrusted code\nrequires a separate process.\n\n</p>\n<p>In case of syntax error in <code>code</code>, <code>vm.runInContext</code> emits the syntax error to stderr\nand throws an exception.\n\n</p>\n","signatures":[{"params":[{"name":"code"},{"name":"context"},{"name":"filename","optional":true}]}]},{"textRaw":"vm.createContext([initSandbox])","type":"method","name":"createContext","desc":"<p><code>vm.createContext</code> creates a new context which is suitable for use as the 2nd argument of a subsequent\ncall to <code>vm.runInContext</code>. A (V8) context comprises a global object together with a set of\nbuild-in objects and functions. The optional argument <code>initSandbox</code> will be shallow-copied\nto seed the initial contents of the global object used by the context.\n\n</p>\n","signatures":[{"params":[{"name":"initSandbox","optional":true}]}]},{"textRaw":"vm.createScript(code, [filename])","type":"method","name":"createScript","desc":"<p><code>createScript</code> compiles <code>code</code> but does not run it. Instead, it returns a\n<code>vm.Script</code> object representing this compiled code. This script can be run\nlater many times using methods below. The returned script is not bound to any\nglobal object. It is bound before each run, just for that run. <code>filename</code> is\noptional, it&apos;s only used in stack traces.\n\n</p>\n<p>In case of syntax error in <code>code</code>, <code>createScript</code> prints the syntax error to stderr\nand throws an exception.\n\n\n</p>\n","signatures":[{"params":[{"name":"code"},{"name":"filename","optional":true}]}]}],"classes":[{"textRaw":"Class: Script","type":"class","name":"Script","desc":"<p>A class for running scripts. Returned by vm.createScript.\n\n</p>\n","methods":[{"textRaw":"script.runInThisContext()","type":"method","name":"runInThisContext","desc":"<p>Similar to <code>vm.runInThisContext</code> but a method of a precompiled <code>Script</code> object.\n<code>script.runInThisContext</code> runs the code of <code>script</code> and returns the result.\nRunning code does not have access to local scope, but does have access to the <code>global</code> object\n(v8: in actual context).\n\n</p>\n<p>Example of using <code>script.runInThisContext</code> to compile code once and run it multiple times:\n\n</p>\n<pre><code>var vm = require(&apos;vm&apos;);\n\nglobalVar = 0;\n\nvar script = vm.createScript(&apos;globalVar += 1&apos;, &apos;myfile.vm&apos;);\n\nfor (var i = 0; i &lt; 1000 ; i += 1) {\n script.runInThisContext();\n}\n\nconsole.log(globalVar);\n\n// 1000</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"script.runInNewContext([sandbox])","type":"method","name":"runInNewContext","desc":"<p>Similar to <code>vm.runInNewContext</code> a method of a precompiled <code>Script</code> object.\n<code>script.runInNewContext</code> runs the code of <code>script</code> with <code>sandbox</code> as the global object and returns the result.\nRunning code does not have access to local scope. <code>sandbox</code> is optional.\n\n</p>\n<p>Example: compile code that increments a global variable and sets one, then execute this code multiple times.\nThese globals are contained in the sandbox.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n vm = require(&apos;vm&apos;),\n sandbox = {\n animal: &apos;cat&apos;,\n count: 2\n };\n\nvar script = vm.createScript(&apos;count += 1; name = &quot;kitty&quot;&apos;, &apos;myfile.vm&apos;);\n\nfor (var i = 0; i &lt; 10 ; i += 1) {\n script.runInNewContext(sandbox);\n}\n\nconsole.log(util.inspect(sandbox));\n\n// { animal: &apos;cat&apos;, count: 12, name: &apos;kitty&apos; }</code></pre>\n<p>Note that running untrusted code is a tricky business requiring great care. To prevent accidental\nglobal variable leakage, <code>script.runInNewContext</code> is quite useful, but safely running untrusted code\nrequires a separate process.\n</p>\n","signatures":[{"params":[{"name":"sandbox","optional":true}]}]}]}],"type":"module","displayName":"vm"}]}
View
1 public/json/0.8.1/zlib.json
@@ -1 +0,0 @@
-{"source":"doc/api/zlib.markdown","modules":[{"textRaw":"Zlib","name":"zlib","stability":3,"stabilityText":"Stable","desc":"<p>You can access this module with:\n\n</p>\n<pre><code>var zlib = require(&apos;zlib&apos;);</code></pre>\n<p>This provides bindings to Gzip/Gunzip, Deflate/Inflate, and\nDeflateRaw/InflateRaw classes. Each class takes the same options, and\nis a readable/writable Stream.\n\n</p>\n<h2>Examples</h2>\n<p>Compressing or decompressing a file can be done by piping an\nfs.ReadStream into a zlib stream, then into an fs.WriteStream.\n\n</p>\n<pre><code>var gzip = zlib.createGzip();\nvar fs = require(&apos;fs&apos;);\nvar inp = fs.createReadStream(&apos;input.txt&apos;);\nvar out = fs.createWriteStream(&apos;input.txt.gz&apos;);\n\ninp.pipe(gzip).pipe(out);</code></pre>\n<p>Compressing or decompressing data in one step can be done by using\nthe convenience methods.\n\n</p>\n<pre><code>var input = &apos;.................................&apos;;\nzlib.deflate(input, function(err, buffer) {\n if (!err) {\n console.log(buffer.toString(&apos;base64&apos;));\n }\n});\n\nvar buffer = new Buffer(&apos;eJzT0yMAAGTvBe8=&apos;, &apos;base64&apos;);\nzlib.unzip(buffer, function(err, buffer) {\n if (!err) {\n console.log(buffer.toString());\n }\n});</code></pre>\n<p>To use this module in an HTTP client or server, use the\n<a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\">accept-encoding</a>\non requests, and the\n<a href=\"http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11\">content-encoding</a>\nheader on responses.\n\n</p>\n<p><strong>Note: these examples are drastically simplified to show\nthe basic concept.</strong> Zlib encoding can be expensive, and the results\nought to be cached. See <a href=\"#zlib_memory_usage_tuning\">Memory Usage Tuning</a>\nbelow for more information on the speed/memory/compression\ntradeoffs involved in zlib usage.\n\n</p>\n<pre><code>// client request example\nvar zlib = require(&apos;zlib&apos;);\nvar http = require(&apos;http&apos;);\nvar fs = require(&apos;fs&apos;);\nvar request = http.get({ host: &apos;izs.me&apos;,\n path: &apos;/&apos;,\n port: 80,\n headers: { &apos;accept-encoding&apos;: &apos;gzip,deflate&apos; } });\nrequest.on(&apos;response&apos;, function(response) {\n var output = fs.createWriteStream(&apos;izs.me_index.html&apos;);\n\n switch (response.headers[&apos;content-encoding&apos;]) {\n // or, just use zlib.createUnzip() to handle both cases\n case &apos;gzip&apos;:\n response.pipe(zlib.createGunzip()).pipe(output);\n break;\n case &apos;deflate&apos;:\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.\nvar zlib = require(&apos;zlib&apos;);\nvar http = require(&apos;http&apos;);\nvar fs = require(&apos;fs&apos;);\nhttp.createServer(function(request, response) {\n var raw = fs.createReadStream(&apos;index.html&apos;);\n var acceptEncoding = request.headers[&apos;accept-encoding&apos;];\n if (!acceptEncoding) {\n acceptEncoding = &apos;&apos;;\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, { &apos;content-encoding&apos;: &apos;deflate&apos; });\n raw.pipe(zlib.createDeflate()).pipe(response);\n } else if (acceptEncoding.match(/\\bgzip\\b/)) {\n response.writeHead(200, { &apos;content-encoding&apos;: &apos;gzip&apos; });\n raw.pipe(zlib.createGzip()).pipe(response);\n } else {\n response.writeHead(200, {});\n raw.pipe(response);\n }\n}).listen(1337);</code></pre>\n","methods":[{"textRaw":"zlib.createGzip([options])","type":"method","name":"createGzip","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_gzip\">Gzip</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.createGunzip([options])","type":"method","name":"createGunzip","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_gunzip\">Gunzip</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.createDeflate([options])","type":"method","name":"createDeflate","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_deflate\">Deflate</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.createInflate([options])","type":"method","name":"createInflate","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_inflate\">Inflate</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.createDeflateRaw([options])","type":"method","name":"createDeflateRaw","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_deflateraw\">DeflateRaw</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.createInflateRaw([options])","type":"method","name":"createInflateRaw","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_inflateraw\">InflateRaw</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.createUnzip([options])","type":"method","name":"createUnzip","desc":"<p>Returns a new <a href=\"#zlib_class_zlib_unzip\">Unzip</a> object with an\n<a href=\"#zlib_options\">options</a>.\n\n\n</p>\n","signatures":[{"params":[{"name":"options","optional":true}]}]},{"textRaw":"zlib.deflate(buf, callback)","type":"method","name":"deflate","desc":"<p>Compress a string with Deflate.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]},{"textRaw":"zlib.deflateRaw(buf, callback)","type":"method","name":"deflateRaw","desc":"<p>Compress a string with DeflateRaw.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]},{"textRaw":"zlib.gzip(buf, callback)","type":"method","name":"gzip","desc":"<p>Compress a string with Gzip.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]},{"textRaw":"zlib.gunzip(buf, callback)","type":"method","name":"gunzip","desc":"<p>Decompress a raw Buffer with Gunzip.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]},{"textRaw":"zlib.inflate(buf, callback)","type":"method","name":"inflate","desc":"<p>Decompress a raw Buffer with Inflate.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]},{"textRaw":"zlib.inflateRaw(buf, callback)","type":"method","name":"inflateRaw","desc":"<p>Decompress a raw Buffer with InflateRaw.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]},{"textRaw":"zlib.unzip(buf, callback)","type":"method","name":"unzip","desc":"<p>Decompress a raw Buffer with Unzip.\n\n</p>\n","signatures":[{"params":[{"name":"buf"},{"name":"callback"}]}]}],"classes":[{"textRaw":"Class: zlib.Gzip","type":"class","name":"zlib.Gzip","desc":"<p>Compress data using gzip.\n\n</p>\n"},{"textRaw":"Class: zlib.Gunzip","type":"class","name":"zlib.Gunzip","desc":"<p>Decompress a gzip stream.\n\n</p>\n"},{"textRaw":"Class: zlib.Deflate","type":"class","name":"zlib.Deflate","desc":"<p>Compress data using deflate.\n\n</p>\n"},{"textRaw":"Class: zlib.Inflate","type":"class","name":"zlib.Inflate","desc":"<p>Decompress a deflate stream.\n\n</p>\n"},{"textRaw":"Class: zlib.DeflateRaw","type":"class","name":"zlib.DeflateRaw","desc":"<p>Compress data using deflate, and do not append a zlib header.\n\n</p>\n"},{"textRaw":"Class: zlib.InflateRaw","type":"class","name":"zlib.InflateRaw","desc":"<p>Decompress a raw deflate stream.\n\n</p>\n"},{"textRaw":"Class: zlib.Unzip","type":"class","name":"zlib.Unzip","desc":"<p>Decompress either a Gzip- or Deflate-compressed stream by auto-detecting\nthe header.\n\n</p>\n"}],"miscs":[{"textRaw":"Convenience Methods","name":"Convenience Methods","type":"misc","desc":"<p>All of these take a string or buffer as the first argument, and call the\nsupplied callback with <code>callback(error, result)</code>. The\ncompression/decompression engine is created using the default settings\nin all convenience methods. To supply different options, use the\nzlib classes directly.\n\n</p>\n"},{"textRaw":"Options","name":"Options","type":"misc","desc":"<p>Each class takes an options object. All options are optional. (The\nconvenience methods use the default settings for all options.)\n\n</p>\n<p>Note that some options are only\nrelevant when compressing, and are ignored by the decompression classes.\n\n</p>\n<ul>\n<li>chunkSize (default: 16*1024)</li>\n<li>windowBits</li>\n<li>level (compression only)</li>\n<li>memLevel (compression only)</li>\n<li>strategy (compression only)</li>\n<li>dictionary (deflate/inflate only, empty dictionary by default)</li>\n</ul>\n<p>See the description of <code>deflateInit2</code> and <code>inflateInit2</code>\nat <a href=\"http://zlib.net/manual.html#Advanced\">http://zlib.net/manual.html#Advanced</a> for more information on these.\n\n</p>\n"},{"textRaw":"Memory Usage Tuning","name":"Memory Usage Tuning","type":"misc","desc":"<p>From <code>zlib/zconf.h</code>, modified to node&apos;s usage:\n\n</p>\n<p>The memory requirements for deflate are (in bytes):\n\n</p>\n<pre><code>(1 &lt;&lt; (windowBits+2)) + (1 &lt;&lt; (memLevel+9))</code></pre>\n<p>that is: 128K for windowBits=15 + 128K for memLevel = 8\n(default values) plus a few kilobytes for small objects.\n\n</p>\n<p>For example, if you want to reduce\nthe default memory requirements from 256K to 128K, set the options to:\n\n</p>\n<pre><code>{ windowBits: 14, memLevel: 7 }</code></pre>\n<p>Of course this will generally degrade compression (there&apos;s no free lunch).\n\n</p>\n<p>The memory requirements for inflate are (in bytes)\n\n</p>\n<pre><code>1 &lt;&lt; windowBits</code></pre>\n<p>that is, 32K for windowBits=15 (default value) plus a few kilobytes\nfor small objects.\n\n</p>\n<p>This is in addition to a single internal output slab buffer of size\n<code>chunkSize</code>, which defaults to 16K.\n\n</p>\n<p>The speed of zlib compression is affected most dramatically by the\n<code>level</code> setting. A higher level will result in better compression, but\nwill take longer to complete. A lower level will result in less\ncompression, but will be much faster.\n\n</p>\n<p>In general, greater memory usage options will mean that node has to make\nfewer calls to zlib, since it&apos;ll be able to process more data in a\nsingle <code>write</code> operation. So, this is another factor that affects the\nspeed, at the cost of memory usage.\n\n</p>\n"},{"textRaw":"Constants","name":"Constants","type":"misc","desc":"<p>All of the constants defined in zlib.h are also defined on\n<code>require(&apos;zlib&apos;)</code>.\nIn the normal course of operations, you will not need to ever set any of\nthese. They are documented here so that their presence is not\nsurprising. This section is taken almost directly from the <a href=\"http://zlib.net/manual.html#Constants\">zlib\ndocumentation</a>. See\n</p>\n<p><a href=\"http://zlib.net/manual.html#Constants\">http://zlib.net/manual.html#Constants</a> for more details.\n\n</p>\n<p>Allowed flush values.\n\n</p>\n<ul>\n<li><code>zlib.Z_NO_FLUSH</code></li>\n<li><code>zlib.Z_PARTIAL_FLUSH</code></li>\n<li><code>zlib.Z_SYNC_FLUSH</code></li>\n<li><code>zlib.Z_FULL_FLUSH</code></li>\n<li><code>zlib.Z_FINISH</code></li>\n<li><code>zlib.Z_BLOCK</code></li>\n<li><code>zlib.Z_TREES</code></li>\n</ul>\n<p>Return codes for the compression/decompression functions. Negative\nvalues are errors, positive values are used for special but normal\nevents.\n\n</p>\n<ul>\n<li><code>zlib.Z_OK</code></li>\n<li><code>zlib.Z_STREAM_END</code></li>\n<li><code>zlib.Z_NEED_DICT</code></li>\n<li><code>zlib.Z_ERRNO</code></li>\n<li><code>zlib.Z_STREAM_ERROR</code></li>\n<li><code>zlib.Z_DATA_ERROR</code></li>\n<li><code>zlib.Z_MEM_ERROR</code></li>\n<li><code>zlib.Z_BUF_ERROR</code></li>\n<li><code>zlib.Z_VERSION_ERROR</code></li>\n</ul>\n<p>Compression levels.\n\n</p>\n<ul>\n<li><code>zlib.Z_NO_COMPRESSION</code></li>\n<li><code>zlib.Z_BEST_SPEED</code></li>\n<li><code>zlib.Z_BEST_COMPRESSION</code></li>\n<li><code>zlib.Z_DEFAULT_COMPRESSION</code></li>\n</ul>\n<p>Compression strategy.\n\n</p>\n<ul>\n<li><code>zlib.Z_FILTERED</code></li>\n<li><code>zlib.Z_HUFFMAN_ONLY</code></li>\n<li><code>zlib.Z_RLE</code></li>\n<li><code>zlib.Z_FIXED</code></li>\n<li><code>zlib.Z_DEFAULT_STRATEGY</code></li>\n</ul>\n<p>Possible values of the data_type field.\n\n</p>\n<ul>\n<li><code>zlib.Z_BINARY</code></li>\n<li><code>zlib.Z_TEXT</code></li>\n<li><code>zlib.Z_ASCII</code></li>\n<li><code>zlib.Z_UNKNOWN</code></li>\n</ul>\n<p>The deflate compression method (the only one supported in this version).\n\n</p>\n<ul>\n<li><code>zlib.Z_DEFLATED</code></li>\n</ul>\n<p>For initializing zalloc, zfree, opaque.\n\n</p>\n<ul>\n<li><code>zlib.Z_NULL</code></li>\n</ul>\n"}],"type":"module","displayName":"Zlib"}]}
View
1 public/json/0.8.3/child_process.json
@@ -1 +0,0 @@
-{"source":"doc/api/child_process.markdown","modules":[{"textRaw":"Child Process","name":"child_process","stability":3,"stabilityText":"Stable","desc":"<p>Node provides a tri-directional <code>popen(3)</code> facility through the\n<code>child_process</code> module.\n\n</p>\n<p>It is possible to stream data through a child&apos;s <code>stdin</code>, <code>stdout</code>, and\n<code>stderr</code> in a fully non-blocking way.\n\n</p>\n<p>To create a child process use <code>require(&apos;child_process&apos;).spawn()</code> or\n<code>require(&apos;child_process&apos;).fork()</code>. The semantics of each are slightly\ndifferent, and explained below.\n\n</p>\n","classes":[{"textRaw":"Class: ChildProcess","type":"class","name":"ChildProcess","desc":"<p><code>ChildProcess</code> is an [EventEmitter][].\n\n</p>\n<p>Child processes always have three streams associated with them. <code>child.stdin</code>,\n<code>child.stdout</code>, and <code>child.stderr</code>. These may be shared with the stdio\nstreams of the parent process, or they may be separate stream objects\nwhich can be piped to and from.\n\n</p>\n<p>The ChildProcess class is not intended to be used directly. Use the\n<code>spawn()</code> or <code>fork()</code> methods to create a Child Process instance.\n\n</p>\n","events":[{"textRaw":"Event: 'exit'","type":"event","name":"exit","params":[],"desc":"<p>This event is emitted after the child process ends. If the process terminated\nnormally, <code>code</code> is the final exit code of the process, otherwise <code>null</code>. If\nthe process terminated due to receipt of a signal, <code>signal</code> is the string name\nof the signal, otherwise <code>null</code>.\n\n</p>\n<p>Note that the child process stdio streams might still be open.\n\n</p>\n<p>See <code>waitpid(2)</code>.\n\n</p>\n"},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p>This event is emitted when the stdio streams of a child process have all\nterminated. This is distinct from &apos;exit&apos;, since multiple processes\nmight share the same stdio streams.\n\n</p>\n","params":[]},{"textRaw":"Event: 'disconnect'","type":"event","name":"disconnect","desc":"<p>This event is emitted after using the <code>.disconnect()</code> method in the parent or\nin the child. After disconnecting it is no longer possible to send messages.\nAn alternative way to check if you can send messages is to see if the\n<code>child.connected</code> property is <code>true</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'message'","type":"event","name":"message","params":[],"desc":"<p>Messages send by <code>.send(message, [sendHandle])</code> are obtained using the\n<code>message</code> event.\n\n</p>\n"}],"properties":[{"textRaw":"`stdin` {Stream object} ","name":"stdin","desc":"<p>A <code>Writable Stream</code> that represents the child process&apos;s <code>stdin</code>.\nClosing this stream via <code>end()</code> often causes the child process to terminate.\n\n</p>\n<p>If the child stdio streams are shared with the parent, then this will\nnot be set.\n\n</p>\n"},{"textRaw":"`stdout` {Stream object} ","name":"stdout","desc":"<p>A <code>Readable Stream</code> that represents the child process&apos;s <code>stdout</code>.\n\n</p>\n<p>If the child stdio streams are shared with the parent, then this will\nnot be set.\n\n</p>\n"},{"textRaw":"`stderr` {Stream object} ","name":"stderr","desc":"<p>A <code>Readable Stream</code> that represents the child process&apos;s <code>stderr</code>.\n\n</p>\n<p>If the child stdio streams are shared with the parent, then this will\nnot be set.\n\n</p>\n"},{"textRaw":"`pid` {Integer} ","name":"pid","desc":"<p>The PID of the child process.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn,\n grep = spawn(&apos;grep&apos;, [&apos;ssh&apos;]);\n\nconsole.log(&apos;Spawned child pid: &apos; + grep.pid);\ngrep.stdin.end();</code></pre>\n"}],"methods":[{"textRaw":"child.kill([signal])","type":"method","name":"kill","signatures":[{"params":[{"textRaw":"`signal` {String} ","name":"signal","type":"String","optional":true}]},{"params":[{"name":"signal","optional":true}]}],"desc":"<p>Send a signal to the child process. If no argument is given, the process will\nbe sent <code>&apos;SIGTERM&apos;</code>. See <code>signal(7)</code> for a list of available signals.\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn,\n grep = spawn(&apos;grep&apos;, [&apos;ssh&apos;]);\n\ngrep.on(&apos;exit&apos;, function (code, signal) {\n console.log(&apos;child process terminated due to receipt of signal &apos;+signal);\n});\n\n// send SIGHUP to process\ngrep.kill(&apos;SIGHUP&apos;);</code></pre>\n<p>Note that while the function is called <code>kill</code>, the signal delivered to the child\nprocess may not actually kill it. <code>kill</code> really just sends a signal to a process.\n\n</p>\n<p>See <code>kill(2)</code>\n\n</p>\n"},{"textRaw":"child.send(message, [sendHandle])","type":"method","name":"send","signatures":[{"params":[{"textRaw":"`message` {Object} ","name":"message","type":"Object"},{"textRaw":"`sendHandle` {Handle object} ","name":"sendHandle","type":"Handle object","optional":true}]},{"params":[{"name":"message"},{"name":"sendHandle","optional":true}]}],"desc":"<p>When using <code>child_process.fork()</code> you can write to the child using\n<code>child.send(message, [sendHandle])</code> and messages are received by\na <code>&apos;message&apos;</code> event on the child.\n\n</p>\n<p>For example:\n\n</p>\n<pre><code>var cp = require(&apos;child_process&apos;);\n\nvar n = cp.fork(__dirname + &apos;/sub.js&apos;);\n\nn.on(&apos;message&apos;, function(m) {\n console.log(&apos;PARENT got message:&apos;, m);\n});\n\nn.send({ hello: &apos;world&apos; });</code></pre>\n<p>And then the child script, <code>&apos;sub.js&apos;</code> might look like this:\n\n</p>\n<pre><code>process.on(&apos;message&apos;, function(m) {\n console.log(&apos;CHILD got message:&apos;, m);\n});\n\nprocess.send({ foo: &apos;bar&apos; });</code></pre>\n<p>In the child the <code>process</code> object will have a <code>send()</code> method, and <code>process</code>\nwill emit objects each time it receives a message on its channel.\n\n</p>\n<p>There is a special case when sending a <code>{cmd: &apos;NODE_foo&apos;}</code> message. All messages\ncontaining a <code>NODE_</code> prefix in its <code>cmd</code> property will not be emitted in\nthe <code>message</code> event, since they are internal messages used by node core.\nMessages containing the prefix are emitted in the <code>internalMessage</code> event, you\nshould by all means avoid using this feature, it is subject to change without notice.\n\n</p>\n<p>The <code>sendHandle</code> option to <code>child.send()</code> is for sending a TCP server or\nsocket object to another process. The child will receive the object as its\nsecond argument to the <code>message</code> event.\n\n</p>\n<p><strong>send server object</strong>\n\n</p>\n<p>Here is an example of sending a server:\n\n</p>\n<pre><code>var child = require(&apos;child_process&apos;).fork(&apos;child.js&apos;);\n\n// Open up the server object and send the handle.\nvar server = require(&apos;net&apos;).createServer();\nserver.on(&apos;connection&apos;, function (socket) {\n socket.end(&apos;handled by parent&apos;);\n});\nserver.listen(1337, function() {\n child.send(&apos;server&apos;, server);\n});</code></pre>\n<p>And the child would the recive the server object as:\n\n</p>\n<pre><code>process.on(&apos;message&apos;, function(m, server) {\n if (m === &apos;server&apos;) {\n server.on(&apos;connection&apos;, function (socket) {\n socket.end(&apos;handled by child&apos;);\n });\n }\n});</code></pre>\n<p>Note that the server is now shared between the parent and child, this means\nthat some connections will be handled by the parent and some by the child.\n\n</p>\n<p><strong>send socket object</strong>\n\n</p>\n<p>Here is an example of sending a socket. It will spawn two childs and handle\nconnections with the remote address <code>74.125.127.100</code> as VIP by sending the\nsocket to a &quot;special&quot; child process. Other sockets will go to a &quot;normal&quot; process.\n\n</p>\n<pre><code>var normal = require(&apos;child_process&apos;).fork(&apos;child.js&apos;, [&apos;normal&apos;]);\nvar special = require(&apos;child_process&apos;).fork(&apos;child.js&apos;, [&apos;special&apos;]);\n\n// Open up the server and send sockets to child\nvar server = require(&apos;net&apos;).createServer();\nserver.on(&apos;connection&apos;, function (socket) {\n\n // if this is a VIP\n if (socket.remoteAddress === &apos;74.125.127.100&apos;) {\n special.send(&apos;socket&apos;, socket);\n return;\n }\n // just the usual dudes\n normal.send(&apos;socket&apos;, socket);\n});\nserver.listen(1337);</code></pre>\n<p>The <code>child.js</code> could look like this:\n\n</p>\n<pre><code>process.on(&apos;message&apos;, function(m, socket) {\n if (m === &apos;socket&apos;) {\n socket.end(&apos;You where handled as a &apos; + process.argv[2] + &apos; person&apos;);\n }\n});</code></pre>\n<p>Note that once a single socket has been sent to a child the parent can no\nlonger keep track of when the socket is destroyed. To indicate this condition\nthe <code>.connections</code> property becomes <code>null</code>.\nIt is also recomended not to use <code>.maxConnections</code> in this condition.\n\n</p>\n"},{"textRaw":"child.disconnect()","type":"method","name":"disconnect","desc":"<p>To close the IPC connection between parent and child use the\n<code>child.disconnect()</code> method. This allows the child to exit gracefully since\nthere is no IPC channel keeping it alive. When calling this method the\n<code>disconnect</code> event will be emitted in both parent and child, and the\n<code>connected</code> flag will be set to <code>false</code>. Please note that you can also call\n<code>process.disconnect()</code> in the child process.\n\n</p>\n","signatures":[{"params":[]}]}]}],"methods":[{"textRaw":"child_process.spawn(command, [args], [options])","type":"method","name":"spawn","signatures":[{"return":{"textRaw":"return: {ChildProcess object} ","name":"return","type":"ChildProcess object"},"params":[{"textRaw":"`command` {String} The command to run ","name":"command","type":"String","desc":"The command to run"},{"textRaw":"`args` {Array} List of string arguments ","name":"args","type":"Array","desc":"List of string arguments","optional":true},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`stdio` {Array|String} Child's stdio configuration. (See below) ","name":"stdio","type":"Array|String","desc":"Child's stdio configuration. (See below)"},{"textRaw":"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See below) ","name":"customFds","type":"Array","desc":"**Deprecated** File descriptors for the child to use for stdio. (See below)"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`detached` {Boolean} The child will be a process group leader. (See below) ","name":"detached","type":"Boolean","desc":"The child will be a process group leader. (See below)"}],"name":"options","type":"Object","optional":true}]},{"params":[{"name":"command"},{"name":"args","optional":true},{"name":"options","optional":true}]}],"desc":"<p>Launches a new process with the given <code>command</code>, with command line arguments in <code>args</code>.\nIf omitted, <code>args</code> defaults to an empty Array.\n\n</p>\n<p>The third argument is used to specify additional options, which defaults to:\n\n</p>\n<pre><code>{ cwd: undefined,\n env: process.env\n}</code></pre>\n<p><code>cwd</code> allows you to specify the working directory from which the process is spawned.\nUse <code>env</code> to specify environment variables that will be visible to the new process.\n\n</p>\n<p>Example of running <code>ls -lh /usr</code>, capturing <code>stdout</code>, <code>stderr</code>, and the exit code:\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n spawn = require(&apos;child_process&apos;).spawn,\n ls = spawn(&apos;ls&apos;, [&apos;-lh&apos;, &apos;/usr&apos;]);\n\nls.stdout.on(&apos;data&apos;, function (data) {\n console.log(&apos;stdout: &apos; + data);\n});\n\nls.stderr.on(&apos;data&apos;, function (data) {\n console.log(&apos;stderr: &apos; + data);\n});\n\nls.on(&apos;exit&apos;, function (code) {\n console.log(&apos;child process exited with code &apos; + code);\n});</code></pre>\n<p>Example: A very elaborate way to run &apos;ps ax | grep ssh&apos;\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n spawn = require(&apos;child_process&apos;).spawn,\n ps = spawn(&apos;ps&apos;, [&apos;ax&apos;]),\n grep = spawn(&apos;grep&apos;, [&apos;ssh&apos;]);\n\nps.stdout.on(&apos;data&apos;, function (data) {\n grep.stdin.write(data);\n});\n\nps.stderr.on(&apos;data&apos;, function (data) {\n console.log(&apos;ps stderr: &apos; + data);\n});\n\nps.on(&apos;exit&apos;, function (code) {\n if (code !== 0) {\n console.log(&apos;ps process exited with code &apos; + code);\n }\n grep.stdin.end();\n});\n\ngrep.stdout.on(&apos;data&apos;, function (data) {\n console.log(&apos;&apos; + data);\n});\n\ngrep.stderr.on(&apos;data&apos;, function (data) {\n console.log(&apos;grep stderr: &apos; + data);\n});\n\ngrep.on(&apos;exit&apos;, function (code) {\n if (code !== 0) {\n console.log(&apos;grep process exited with code &apos; + code);\n }\n});</code></pre>\n<p>Example of checking for failed exec:\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn,\n child = spawn(&apos;bad_command&apos;);\n\nchild.stderr.setEncoding(&apos;utf8&apos;);\nchild.stderr.on(&apos;data&apos;, function (data) {\n if (/^execvp\\(\\)/.test(data)) {\n console.log(&apos;Failed to start child process.&apos;);\n }\n});</code></pre>\n<p>Note that if spawn receives an empty options object, it will result in\nspawning the process with an empty environment rather than using\n<code>process.env</code>. This due to backwards compatibility issues with a deprecated\nAPI.\n\n</p>\n<p>The &apos;stdio&apos; option to <code>child_process.spawn()</code> is an array where each\nindex corresponds to a fd in the child. The value is one of the following:\n\n</p>\n<ol>\n<li><code>&apos;pipe&apos;</code> - Create a pipe between the child process and the parent process.\nThe parent end of the pipe is exposed to the parent as a property on the\n<code>child_process</code> object as <code>ChildProcess.stdio[fd]</code>. Pipes created for\nfds 0 - 2 are also available as ChildProcess.stdin, ChildProcess.stdout\nand ChildProcess.stderr, respectively.</li>\n<li><code>&apos;ipc&apos;</code> - Create an IPC channel for passing messages/file descriptors\nbetween parent and child. A ChildProcess may have at most <em>one</em> IPC stdio\nfile descriptor. Setting this option enables the ChildProcess.send() method.\nIf the child writes JSON messages to this file descriptor, then this will\ntrigger ChildProcess.on(&apos;message&apos;). If the child is a Node.js program, then\nthe presence of an IPC channel will enable process.send() and\nprocess.on(&apos;message&apos;).</li>\n<li><code>&apos;ignore&apos;</code> - Do not set this file descriptor in the child. Note that Node\nwill always open fd 0 - 2 for the processes it spawns. When any of these is\nignored node will open <code>/dev/null</code> and attach it to the child&apos;s fd.</li>\n<li><code>Stream</code> object - Share a readable or writable stream that refers to a tty,\nfile, socket, or a pipe with the child process. The stream&apos;s underlying\nfile descriptor is duplicated in the child process to the fd that \ncorresponds to the index in the <code>stdio</code> array.</li>\n<li>Positive integer - The integer value is interpreted as a file descriptor \nthat is is currently open in the parent process. It is shared with the child\nprocess, similar to how <code>Stream</code> objects can be shared.</li>\n<li><code>null</code>, <code>undefined</code> - Use default value. For stdio fds 0, 1 and 2 (in other\nwords, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the\ndefault is <code>&apos;ignore&apos;</code>.</li>\n</ol>\n<p>As a shorthand, the <code>stdio</code> argument may also be one of the following\nstrings, rather than an array:\n\n</p>\n<ul>\n<li><code>ignore</code> - <code>[&apos;ignore&apos;, &apos;ignore&apos;, &apos;ignore&apos;]</code></li>\n<li><code>pipe</code> - <code>[&apos;pipe&apos;, &apos;pipe&apos;, &apos;pipe&apos;]</code></li>\n<li><code>inherit</code> - <code>[process.stdin, process.stdout, process.stderr]</code> or <code>[0,1,2]</code></li>\n</ul>\n<p>Example:\n\n</p>\n<pre><code>var spawn = require(&apos;child_process&apos;).spawn;\n\n// Child will use parent&apos;s stdios\nspawn(&apos;prg&apos;, [], { stdio: &apos;inherit&apos; });\n\n// Spawn child sharing only stderr\nspawn(&apos;prg&apos;, [], { stdio: [&apos;pipe&apos;, &apos;pipe&apos;, process.stderr] });\n\n// Open an extra fd=4, to interact with programs present a\n// startd-style interface.\nspawn(&apos;prg&apos;, [], { stdio: [&apos;pipe&apos;, null, null, null, &apos;pipe&apos;] });</code></pre>\n<p>If the <code>detached</code> option is set, the child process will be made the leader of a\nnew process group. This makes it possible for the child to continue running \nafter the parent exits.\n\n</p>\n<p>By default, the parent will wait for the detached child to exit. To prevent\nthe parent from waiting for a given <code>child</code>, use the <code>child.unref()</code> method,\nand the parent&apos;s event loop will not include the child in its reference count.\n\n</p>\n<p>Example of detaching a long-running process and redirecting its output to a\nfile:\n\n</p>\n<pre><code> var fs = require(&apos;fs&apos;),\n spawn = require(&apos;child_process&apos;).spawn,\n out = fs.openSync(&apos;./out.log&apos;, &apos;a&apos;),\n err = fs.openSync(&apos;./out.log&apos;, &apos;a&apos;);\n\n var child = spawn(&apos;prg&apos;, [], {\n detached: true,\n stdio: [ &apos;ignore&apos;, out, err ]\n });\n\n child.unref();</code></pre>\n<p>When using the <code>detached</code> option to start a long-running process, the process\nwill not stay running in the background unless it is provided with a <code>stdio</code>\nconfiguration that is not connected to the parent. If the parent&apos;s <code>stdio</code> is\ninherited, the child will remain attached to the controlling terminal.\n\n</p>\n<p>There is a deprecated option called <code>customFds</code> which allows one to specify\nspecific file descriptors for the stdio of the child process. This API was\nnot portable to all platforms and therefore removed.\nWith <code>customFds</code> it was possible to hook up the new process&apos; <code>[stdin, stdout,\nstderr]</code> to existing streams; <code>-1</code> meant that a new stream should be created.\nUse at your own risk.\n\n</p>\n<p>There are several internal options. In particular <code>stdinStream</code>,\n<code>stdoutStream</code>, <code>stderrStream</code>. They are for INTERNAL USE ONLY. As with all\nundocumented APIs in Node, they should not be used.\n\n</p>\n<p>See also: <code>child_process.exec()</code> and <code>child_process.fork()</code>\n\n</p>\n"},{"textRaw":"child_process.exec(command, [options], callback)","type":"method","name":"exec","signatures":[{"return":{"textRaw":"Return: ChildProcess object ","name":"return","desc":"ChildProcess object"},"params":[{"textRaw":"`command` {String} The command to run, with space-separated arguments ","name":"command","type":"String","desc":"The command to run, with space-separated arguments"},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`stdio` {Array|String} Child's stdio configuration. (See above) ","name":"stdio","type":"Array|String","desc":"Child's stdio configuration. (See above)"},{"textRaw":"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See above) ","name":"customFds","type":"Array","desc":"**Deprecated** File descriptors for the child to use for stdio. (See above)"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`encoding` {String} (Default: 'utf8') ","name":"encoding","default":"utf8","type":"String"},{"textRaw":"`timeout` {Number} (Default: 0) ","name":"timeout","default":"0","type":"Number"},{"textRaw":"`maxBuffer` {Number} (Default: 200*1024) ","name":"maxBuffer","default":"200*1024","type":"Number"},{"textRaw":"`killSignal` {String} (Default: 'SIGTERM') ","name":"killSignal","default":"SIGTERM","type":"String"}],"name":"options","type":"Object","optional":true},{"textRaw":"`callback` {Function} called with the output when process terminates ","options":[{"textRaw":"`error` {Error} ","name":"error","type":"Error"},{"textRaw":"`stdout` {Buffer} ","name":"stdout","type":"Buffer"},{"textRaw":"`stderr` {Buffer} ","name":"stderr","type":"Buffer"}],"name":"callback","type":"Function","desc":"called with the output when process terminates"}]},{"params":[{"name":"command"},{"name":"options","optional":true},{"name":"callback"}]}],"desc":"<p>Runs a command in a shell and buffers the output.\n\n</p>\n<pre><code>var util = require(&apos;util&apos;),\n exec = require(&apos;child_process&apos;).exec,\n child;\n\nchild = exec(&apos;cat *.js bad_file | wc -l&apos;,\n function (error, stdout, stderr) {\n console.log(&apos;stdout: &apos; + stdout);\n console.log(&apos;stderr: &apos; + stderr);\n if (error !== null) {\n console.log(&apos;exec error: &apos; + error);\n }\n});</code></pre>\n<p>The callback gets the arguments <code>(error, stdout, stderr)</code>. On success, <code>error</code>\nwill be <code>null</code>. On error, <code>error</code> will be an instance of <code>Error</code> and <code>err.code</code>\nwill be the exit code of the child process, and <code>err.signal</code> will be set to the\nsignal that terminated the process.\n\n</p>\n<p>There is a second optional argument to specify several options. The\ndefault options are\n\n</p>\n<pre><code>{ encoding: &apos;utf8&apos;,\n timeout: 0,\n maxBuffer: 200*1024,\n killSignal: &apos;SIGTERM&apos;,\n cwd: null,\n env: null }</code></pre>\n<p>If <code>timeout</code> is greater than 0, then it will kill the child process\nif it runs longer than <code>timeout</code> milliseconds. The child process is killed with\n<code>killSignal</code> (default: <code>&apos;SIGTERM&apos;</code>). <code>maxBuffer</code> specifies the largest\namount of data allowed on stdout or stderr - if this value is exceeded then\nthe child process is killed.\n\n\n</p>\n"},{"textRaw":"child_process.execFile(file, args, options, callback)","type":"method","name":"execFile","signatures":[{"return":{"textRaw":"Return: ChildProcess object ","name":"return","desc":"ChildProcess object"},"params":[{"textRaw":"`file` {String} The filename of the program to run ","name":"file","type":"String","desc":"The filename of the program to run"},{"textRaw":"`args` {Array} List of string arguments ","name":"args","type":"Array","desc":"List of string arguments"},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`stdio` {Array|String} Child's stdio configuration. (See above) ","name":"stdio","type":"Array|String","desc":"Child's stdio configuration. (See above)"},{"textRaw":"`customFds` {Array} **Deprecated** File descriptors for the child to use for stdio. (See above) ","name":"customFds","type":"Array","desc":"**Deprecated** File descriptors for the child to use for stdio. (See above)"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`encoding` {String} (Default: 'utf8') ","name":"encoding","default":"utf8","type":"String"},{"textRaw":"`timeout` {Number} (Default: 0) ","name":"timeout","default":"0","type":"Number"},{"textRaw":"`maxBuffer` {Number} (Default: 200\\*1024) ","name":"maxBuffer","default":"200\\*1024","type":"Number"},{"textRaw":"`killSignal` {String} (Default: 'SIGTERM') ","name":"killSignal","default":"SIGTERM","type":"String"}],"name":"options","type":"Object"},{"textRaw":"`callback` {Function} called with the output when process terminates ","options":[{"textRaw":"`error` {Error} ","name":"error","type":"Error"},{"textRaw":"`stdout` {Buffer} ","name":"stdout","type":"Buffer"},{"textRaw":"`stderr` {Buffer} ","name":"stderr","type":"Buffer"}],"name":"callback","type":"Function","desc":"called with the output when process terminates"}]},{"params":[{"name":"file"},{"name":"args"},{"name":"options"},{"name":"callback"}]}],"desc":"<p>This is similar to <code>child_process.exec()</code> except it does not execute a\nsubshell but rather the specified file directly. This makes it slightly\nleaner than <code>child_process.exec</code>. It has the same options.\n\n\n</p>\n"},{"textRaw":"child\\_process.fork(modulePath, [args], [options])","type":"method","name":"fork","signatures":[{"return":{"textRaw":"Return: ChildProcess object ","name":"return","desc":"ChildProcess object"},"params":[{"textRaw":"`modulePath` {String} The module to run in the child ","name":"modulePath","type":"String","desc":"The module to run in the child"},{"textRaw":"`args` {Array} List of string arguments ","name":"args","type":"Array","desc":"List of string arguments","optional":true},{"textRaw":"`options` {Object} ","options":[{"textRaw":"`cwd` {String} Current working directory of the child process ","name":"cwd","type":"String","desc":"Current working directory of the child process"},{"textRaw":"`env` {Object} Environment key-value pairs ","name":"env","type":"Object","desc":"Environment key-value pairs"},{"textRaw":"`encoding` {String} (Default: 'utf8') ","name":"encoding","default":"utf8","type":"String"},{"textRaw":"`timeout` {Number} (Default: 0) ","name":"timeout","default":"0","type":"Number"}],"name":"options","type":"Object","optional":true}]},{"params":[{"name":"modulePath"},{"name":"args","optional":true},{"name":"options","optional":true}]}],"desc":"<p>This is a special case of the <code>spawn()</code> functionality for spawning Node\nprocesses. In addition to having all the methods in a normal ChildProcess\ninstance, the returned object has a communication channel built-in. See\n<code>child.send(message, [sendHandle])</code> for details.\n\n</p>\n<p>By default the spawned Node process will have the stdout, stderr associated\nwith the parent&apos;s. To change this behavior set the <code>silent</code> property in the\n<code>options</code> object to <code>true</code>.\n\n</p>\n<p>These child Nodes are still whole new instances of V8. Assume at least 30ms\nstartup and 10mb memory for each new Node. That is, you cannot create many\nthousands of them.\n\n</p>\n"}],"type":"module","displayName":"Child Process"}]}
View
1 public/json/0.8.3/cluster.json
@@ -1 +0,0 @@
-{"source":"doc/api/cluster.markdown","modules":[{"textRaw":"Cluster","name":"cluster","stability":1,"stabilityText":"Experimental","desc":"<p>A 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\n</p>\n<p>The cluster module allows you to easily create a network of processes that\nall share server ports.\n\n</p>\n<pre><code>var cluster = require(&apos;cluster&apos;);\nvar http = require(&apos;http&apos;);\nvar numCPUs = require(&apos;os&apos;).cpus().length;\n\nif (cluster.isMaster) {\n // Fork workers.\n for (var i = 0; i &lt; numCPUs; i++) {\n cluster.fork();\n }\n\n cluster.on(&apos;exit&apos;, function(worker, code, signal) {\n console.log(&apos;worker &apos; + worker.process.pid + &apos; died&apos;);\n });\n} else {\n // Workers can share any TCP connection\n // In this case its a HTTP server\n http.createServer(function(req, res) {\n res.writeHead(200);\n res.end(&quot;hello world\\n&quot;);\n }).listen(8000);\n}</code></pre>\n<p>Running node will now share port 8000 between the workers:\n\n</p>\n<pre><code>% node server.js\nWorker 2438 online\nWorker 2437 online</code></pre>\n<p>This feature was introduced recently, and may change in future versions.\nPlease try it out and provide feedback.\n\n</p>\n<p>Also note that, on Windows, it is not yet possible to set up a named pipe\nserver in a worker.\n\n</p>\n","miscs":[{"textRaw":"How It Works","name":"How It Works","type":"misc","desc":"<p>The worker processes are spawned using the <code>child_process.fork</code> method,\nso that they can communicate with the parent via IPC and pass server\nhandles back and forth.\n\n</p>\n<p>When you call <code>server.listen(...)</code> in a worker, it serializes the\narguments and passes the request to the master process. If the master\nprocess already has a listening server matching the worker&apos;s\nrequirements, then it passes the handle to the worker. If it does not\nalready have a listening server matching that requirement, then it will\ncreate one, and pass the handle to the child.\n\n</p>\n<p>This causes potentially surprising behavior in three edge cases:\n\n</p>\n<ol>\n<li><code>server.listen({fd: 7})</code> Because the message is passed to the master,\nfile descriptor 7 <strong>in the parent</strong> will be listened on, and the\nhandle passed to the worker, rather than listening to the worker&apos;s\nidea of what the number 7 file descriptor references.</li>\n<li><code>server.listen(handle)</code> Listening on handles explicitly will cause\nthe worker to use the supplied handle, rather than talk to the master\nprocess. If the worker already has the handle, then it&apos;s presumed\nthat you know what you are doing.</li>\n<li><code>server.listen(0)</code> Normally, this will case servers to listen on a\nrandom port. However, in a cluster, each worker will receive the\nsame &quot;random&quot; port each time they do <code>listen(0)</code>. In essence, the\nport is random the first time, but predictable thereafter. If you\nwant to listen on a unique port, generate a port number based on the\ncluster worker ID.</li>\n</ol>\n<p>When multiple processes are all <code>accept()</code>ing on the same underlying\nresource, the operating system load-balances across them very\nefficiently. There is no routing logic in Node.js, or in your program,\nand no shared state between the workers. Therefore, it is important to\ndesign your program such that it does not rely too heavily on in-memory\ndata objects for things like sessions and login.\n\n</p>\n<p>Because workers are all separate processes, they can be killed or\nre-spawned depending on your program&apos;s needs, without affecting other\nworkers. As long as there are some workers still alive, the server will\ncontinue to accept connections. Node does not automatically manage the\nnumber of workers for you, however. It is your responsibility to manage\nthe worker pool for your application&apos;s needs.\n\n</p>\n"}],"properties":[{"textRaw":"`settings` {Object} ","name":"settings","options":[{"textRaw":"`exec` {String} file path to worker file. (Default=`__filename`) ","name":"exec","default":"__filename","type":"String","desc":"file path to worker file."},{"textRaw":"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ","name":"args","default":"process.argv.slice(2)","type":"Array","desc":"string arguments passed to worker."},{"textRaw":"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ","name":"silent","default":"false","type":"Boolean","desc":"whether or not to send output to parent's stdio."}],"desc":"<p>All settings set by the <code>.setupMaster</code> is stored in this settings object.\nThis object is not supposed to be change or set manually, by you.\n\n</p>\n"},{"textRaw":"`isMaster` {Boolean} ","name":"isMaster","desc":"<p>True if the process is a master. This is determined\nby the <code>process.env.NODE_UNIQUE_ID</code>. If <code>process.env.NODE_UNIQUE_ID</code> is\nundefined, then <code>isMaster</code> is <code>true</code>.\n\n</p>\n"},{"textRaw":"`isWorker` {Boolean} ","name":"isWorker","desc":"<p>This boolean flag is true if the process is a worker forked from a master.\nIf the <code>process.env.NODE_UNIQUE_ID</code> is set to a value, then\n<code>isWorker</code> is <code>true</code>.\n\n</p>\n"},{"textRaw":"`settings` {Object} ","name":"settings","options":[{"textRaw":"`exec` {String} file path to worker file. Default: `__filename` ","name":"exec","type":"String","desc":"file path to worker file. Default: `__filename`"},{"textRaw":"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ","name":"args","default":"process.argv.slice(2)","type":"Array","desc":"string arguments passed to worker."},{"textRaw":"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ","name":"silent","default":"false","type":"Boolean","desc":"whether or not to send output to parent's stdio."}],"desc":"<p>All settings set by the <code>.setupMaster</code> is stored in this settings object.\nThis object is not supposed to be change or set manually.\n\n</p>\n"},{"textRaw":"`workers` {Object} ","name":"workers","desc":"<p>In the cluster all living worker objects are stored in this object by there\n<code>id</code> as the key. This makes it easy to loop through all living workers.\n\n</p>\n<pre><code>// Go through all workers\nfunction eachWorker(callback) {\n for (var id in cluster.workers) {\n callback(cluster.workers[id]);\n }\n}\neachWorker(function(worker) {\n worker.send(&apos;big announcement to all workers&apos;);\n});</code></pre>\n<p>Should you wish to reference a worker over a communication channel, using\nthe worker&apos;s unique id is the easiest way to find the worker.\n\n</p>\n<pre><code>socket.on(&apos;data&apos;, function(id) {\n var worker = cluster.workers[id];\n});</code></pre>\n"}],"events":[{"textRaw":"Event: 'fork'","type":"event","name":"fork","params":[],"desc":"<p>When a new worker is forked the cluster module will emit a &apos;fork&apos; event.\nThis can be used to log worker activity, and create you own timeout.\n\n</p>\n<pre><code>var timeouts = [];\nfunction errorMsg() {\n console.error(&quot;Something must be wrong with the connection ...&quot;);\n}\n\ncluster.on(&apos;fork&apos;, function(worker) {\n timeouts[worker.id] = setTimeout(errorMsg, 2000);\n});\ncluster.on(&apos;listening&apos;, function(worker, address) {\n clearTimeout(timeouts[worker.id]);\n});\ncluster.on(&apos;exit&apos;, function(worker, code, signal) {\n clearTimeout(timeouts[worker.id]);\n errorMsg();\n});</code></pre>\n"},{"textRaw":"Event: 'online'","type":"event","name":"online","params":[],"desc":"<p>After forking a new worker, the worker should respond with a online message.\nWhen the master receives a online message it will emit such event.\nThe difference between &apos;fork&apos; and &apos;online&apos; is that fork is emitted when the\nmaster tries to fork a worker, and &apos;online&apos; is emitted when the worker is\nbeing executed.\n\n</p>\n<pre><code>cluster.on(&apos;online&apos;, function(worker) {\n console.log(&quot;Yay, the worker responded after it was forked&quot;);\n});</code></pre>\n"},{"textRaw":"Event: 'listening'","type":"event","name":"listening","params":[],"desc":"<p>When calling <code>listen()</code> from a worker, a &apos;listening&apos; event is automatically assigned\nto the server instance. When the server is listening a message is send to the master\nwhere the &apos;listening&apos; event is emitted.\n\n</p>\n<p>The event handler is executed with two arguments, the <code>worker</code> contains the worker\nobject and the <code>address</code> object contains the following connection properties:\n<code>address</code>, <code>port</code> and <code>addressType</code>. This is very useful if the worker is listening\non more than one address.\n\n</p>\n<pre><code>cluster.on(&apos;listening&apos;, function(worker, address) {\n console.log(&quot;A worker is now connected to &quot; + address.address + &quot;:&quot; + address.port);\n});</code></pre>\n"},{"textRaw":"Event: 'disconnect'","type":"event","name":"disconnect","params":[],"desc":"<p>When a workers IPC channel has disconnected this event is emitted. This will happen\nwhen the worker dies, usually after calling <code>.destroy()</code>.\n\n</p>\n<p>When calling <code>.disconnect()</code>, there may be a delay between the\n<code>disconnect</code> and <code>exit</code> events. This event can be used to detect if\nthe process is stuck in a cleanup or if there are long-living\nconnections.\n\n</p>\n<pre><code>cluster.on(&apos;disconnect&apos;, function(worker) {\n console.log(&apos;The worker #&apos; + worker.id + &apos; has disconnected&apos;);\n});</code></pre>\n"},{"textRaw":"Event: 'exit'","type":"event","name":"exit","params":[],"desc":"<p>When any of the workers die the cluster module will emit the &apos;exit&apos; event.\nThis can be used to restart the worker by calling <code>fork()</code> again.\n\n</p>\n<pre><code>cluster.on(&apos;exit&apos;, function(worker, code, signal) {\n var exitCode = worker.process.exitCode;\n console.log(&apos;worker &apos; + worker.process.pid + &apos; died (&apos;+exitCode+&apos;). restarting...&apos;);\n cluster.fork();\n});</code></pre>\n"},{"textRaw":"Event: 'setup'","type":"event","name":"setup","params":[],"desc":"<p>When the <code>.setupMaster()</code> function has been executed this event emits.\nIf <code>.setupMaster()</code> was not executed before <code>fork()</code> this function will\ncall <code>.setupMaster()</code> with no arguments.\n\n</p>\n"}],"methods":[{"textRaw":"cluster.setupMaster([settings])","type":"method","name":"setupMaster","signatures":[{"params":[{"textRaw":"`settings` {Object} ","options":[{"textRaw":"`exec` {String} file path to worker file. (Default=`__filename`) ","name":"exec","default":"__filename","type":"String","desc":"file path to worker file."},{"textRaw":"`args` {Array} string arguments passed to worker. (Default=`process.argv.slice(2)`) ","name":"args","default":"process.argv.slice(2)","type":"Array","desc":"string arguments passed to worker."},{"textRaw":"`silent` {Boolean} whether or not to send output to parent's stdio. (Default=`false`) ","name":"silent","default":"false","type":"Boolean","desc":"whether or not to send output to parent's stdio."}],"name":"settings","type":"Object","optional":true}]},{"params":[{"name":"settings","optional":true}]}],"desc":"<p>The <code>setupMaster</code> is used to change the default &apos;fork&apos; behavior. It takes\none option object argument.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var cluster = require(&quot;cluster&quot;);\ncluster.setupMaster({\n exec : &quot;worker.js&quot;,\n args : [&quot;--use&quot;, &quot;https&quot;],\n silent : true\n});\ncluster.fork();</code></pre>\n"},{"textRaw":"cluster.fork([env])","type":"method","name":"fork","signatures":[{"return":{"textRaw":"return {Worker object} ","name":"return","type":"Worker object"},"params":[{"textRaw":"`env` {Object} Key/value pairs to add to child process environment. ","name":"env","type":"Object","desc":"Key/value pairs to add to child process environment.","optional":true}]},{"params":[{"name":"env","optional":true}]}],"desc":"<p>Spawn a new worker process. This can only be called from the master process.\n\n</p>\n"},{"textRaw":"cluster.disconnect([callback])","type":"method","name":"disconnect","signatures":[{"params":[{"textRaw":"`callback` {Function} called when all workers are disconnected and handlers are closed ","name":"callback","type":"Function","desc":"called when all workers are disconnected and handlers are closed","optional":true}]},{"params":[{"name":"callback","optional":true}]}],"desc":"<p>When calling this method, all workers will commit a graceful suicide. When they are\ndisconnected all internal handlers will be closed, allowing the master process to\ndie graceful if no other event is waiting.\n\n</p>\n<p>The method takes an optional callback argument which will be called when finished.\n\n</p>\n"}],"classes":[{"textRaw":"Class: Worker","type":"class","name":"Worker","desc":"<p>A Worker object contains all public information and method about a worker.\nIn the master it can be obtained using <code>cluster.workers</code>. In a worker\nit can be obtained using <code>cluster.worker</code>.\n\n</p>\n","properties":[{"textRaw":"`id` {String} ","name":"id","desc":"<p>Each new worker is given its own unique id, this id is stored in the\n<code>id</code>.\n\n</p>\n<p>While a worker is alive, this is the key that indexes it in\ncluster.workers\n\n</p>\n"},{"textRaw":"`process` {ChildProcess object} ","name":"process","desc":"<p>All workers are created using <code>child_process.fork()</code>, the returned object\nfrom this function is stored in process.\n\n</p>\n<p>See: <a href=\"child_process.html\">Child Process module</a>\n\n</p>\n"},{"textRaw":"`suicide` {Boolean} ","name":"suicide","desc":"<p>This property is a boolean. It is set when a worker dies after calling <code>.destroy()</code>\nor immediately after calling the <code>.disconnect()</code> method. Until then it is <code>undefined</code>.\n\n</p>\n"}],"methods":[{"textRaw":"worker.send(message, [sendHandle])","type":"method","name":"send","signatures":[{"params":[{"textRaw":"`message` {Object} ","name":"message","type":"Object"},{"textRaw":"`sendHandle` {Handle object} ","name":"sendHandle","type":"Handle object","optional":true}]},{"params":[{"name":"message"},{"name":"sendHandle","optional":true}]}],"desc":"<p>This function is equal to the send methods provided by\n<code>child_process.fork()</code>. In the master you should use this function to\nsend a message to a specific worker. However in a worker you can also use\n<code>process.send(message)</code>, since this is the same function.\n\n</p>\n<p>This example will echo back all messages from the master:\n\n</p>\n<pre><code>if (cluster.isMaster) {\n var worker = cluster.fork();\n worker.send(&apos;hi there&apos;);\n\n} else if (cluster.isWorker) {\n process.on(&apos;message&apos;, function(msg) {\n process.send(msg);\n });\n}</code></pre>\n"},{"textRaw":"worker.destroy()","type":"method","name":"destroy","desc":"<p>This function will kill the worker, and inform the master to not spawn a\nnew worker. The boolean <code>suicide</code> lets you distinguish between voluntary\nand accidental exit.\n\n</p>\n<pre><code>cluster.on(&apos;exit&apos;, function(worker, code, signal) {\n if (worker.suicide === true) {\n console.log(&apos;Oh, it was just suicide\\&apos; – no need to worry&apos;).\n }\n});\n\n// destroy worker\nworker.destroy();</code></pre>\n","signatures":[{"params":[]}]},{"textRaw":"worker.disconnect()","type":"method","name":"disconnect","desc":"<p>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 worker\nwill close allowing it to die graceful. When the IPC channel is closed the <code>disconnect</code>\nevent will emit, this is then followed by the <code>exit</code> event, there is emitted when\nthe worker finally die.\n\n</p>\n<p>Because there might be long living connections, it is useful to implement a timeout.\nThis example ask the worker to disconnect and after 2 seconds it will destroy the\nserver. An alternative wound be to execute <code>worker.destroy()</code> after 2 seconds, but\nthat would normally not allow the worker to do any cleanup if needed.\n\n</p>\n<pre><code>if (cluster.isMaster) {\n var worker = cluser.fork();\n var timeout;\n\n worker.on(&apos;listening&apos;, function(address) {\n worker.disconnect();\n timeout = setTimeout(function() {\n worker.send(&apos;force kill&apos;);\n }, 2000);\n });\n\n worker.on(&apos;disconnect&apos;, function() {\n clearTimeout(timeout);\n });\n\n} else if (cluster.isWorker) {\n var net = require(&apos;net&apos;);\n var server = net.createServer(function(socket) {\n // connection never end\n });\n\n server.listen(8000);\n\n server.on(&apos;close&apos;, function() {\n // cleanup\n });\n\n process.on(&apos;message&apos;, function(msg) {\n if (msg === &apos;force kill&apos;) {\n server.destroy();\n }\n });\n}</code></pre>\n","signatures":[{"params":[]}]}],"events":[{"textRaw":"Event: 'message'","type":"event","name":"message","params":[],"desc":"<p>This event is the same as the one provided by <code>child_process.fork()</code>.\nIn the master you should use this event, however in a worker you can also use\n<code>process.on(&apos;message&apos;)</code>\n\n</p>\n<p>As an example, here is a cluster that keeps count of the number of requests\nin the master process using the message system:\n\n</p>\n<pre><code>var cluster = require(&apos;cluster&apos;);\nvar http = require(&apos;http&apos;);\n\nif (cluster.isMaster) {\n\n // Keep track of http requests\n var numReqs = 0;\n setInterval(function() {\n console.log(&quot;numReqs =&quot;, numReqs);\n }, 1000);\n\n // Count requestes\n function messageHandler(msg) {\n if (msg.cmd &amp;&amp; msg.cmd == &apos;notifyRequest&apos;) {\n numReqs += 1;\n }\n }\n\n // Start workers and listen for messages containing notifyRequest\n var numCPUs = require(&apos;os&apos;).cpus().length;\n for (var i = 0; i &lt; numCPUs; i++) {\n cluster.fork();\n }\n\n Object.keys(cluster.workers).forEach(function(id) {\n cluster.workers[id].on(&apos;message&apos;, 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(&quot;hello world\\n&quot;);\n\n // notify master about the request\n process.send({ cmd: &apos;notifyRequest&apos; });\n }).listen(8000);\n}</code></pre>\n"},{"textRaw":"Event: 'online'","type":"event","name":"online","desc":"<p>Same as the <code>cluster.on(&apos;online&apos;)</code> event, but emits only when the state change\non the specified worker.\n\n</p>\n<pre><code>cluster.fork().on(&apos;online&apos;, function() {\n // Worker is online\n};</code></pre>\n","params":[]},{"textRaw":"Event: 'listening'","type":"event","name":"listening","params":[],"desc":"<p>Same as the <code>cluster.on(&apos;listening&apos;)</code> event, but emits only when the state change\non the specified worker.\n\n</p>\n<pre><code>cluster.fork().on(&apos;listening&apos;, function(address) {\n // Worker is listening\n};</code></pre>\n"},{"textRaw":"Event: 'disconnect'","type":"event","name":"disconnect","desc":"<p>Same as the <code>cluster.on(&apos;disconnect&apos;)</code> event, but emits only when the state change\non the specified worker.\n\n</p>\n<pre><code>cluster.fork().on(&apos;disconnect&apos;, function() {\n // Worker has disconnected\n};</code></pre>\n","params":[]},{"textRaw":"Event: 'exit'","type":"event","name":"exit","params":[],"desc":"<p>Emitted by the individual worker instance, when the underlying child process\nis terminated. See <a href=\"child_process.html#child_process_event_exit\">child_process event: &apos;exit&apos;</a>.\n\n</p>\n<pre><code>var worker = cluster.fork();\nworker.on(&apos;exit&apos;, function(code, signal) {\n if( signal ) {\n console.log(&quot;worker was killed by signal: &quot;+signal);\n } else if( code !== 0 ) {\n console.log(&quot;worker exited with error code: &quot;+code);\n } else {\n console.log(&quot;worker success!&quot;);\n }\n};</code></pre>\n"}]}],"type":"module","displayName":"Cluster"}]}
View
1 public/json/0.8.3/domain.json
@@ -1 +0,0 @@
-{"source":"doc/api/domain.markdown","modules":[{"textRaw":"Domain","name":"domain","stability":1,"stabilityText":"Experimental","desc":"<p>Domains 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 <code>error</code> event, or throw an error, then the domain object\nwill be notified, rather than losing the context of the error in the\n<code>process.on(&apos;uncaughtException&apos;)</code> handler, or causing the program to\nexit with an error code.\n\n</p>\n<p>This 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\n</p>\n<p>Due to their experimental nature, the Domains features are disabled unless\nthe <code>domain</code> 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</p>\n","miscs":[{"textRaw":"Additions to Error objects","name":"Additions to Error objects","type":"misc","desc":"<p>Any time an Error object is routed through a domain, a few extra fields\nare added to it.\n\n</p>\n<ul>\n<li><code>error.domain</code> The domain that first handled the error.</li>\n<li><code>error.domain_emitter</code> The event emitter that emitted an &apos;error&apos; event\nwith the error object.</li>\n<li><code>error.domain_bound</code> The callback function which was bound to the\ndomain, and passed an error as its first argument.</li>\n<li><code>error.domain_thrown</code> A boolean indicating whether the error was\nthrown, emitted, or passed to a bound callback function.</li>\n</ul>\n"},{"textRaw":"Implicit Binding","name":"Implicit Binding","type":"misc","desc":"<p>If 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\n</p>\n<p>Additionally, 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\n</p>\n<p>In 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\n</p>\n<p>If you <em>want</em> to nest Domain objects as children of a parent Domain,\nthen you must explicitly add them, and then dispose of them later.\n\n</p>\n<p>Implicit binding routes thrown errors and <code>&apos;error&apos;</code> events to the\nDomain&apos;s <code>error</code> event, but does not register the EventEmitter on the\nDomain, so <code>domain.dispose()</code> will not shut down the EventEmitter.\nImplicit binding only takes care of thrown errors and <code>&apos;error&apos;</code> events.\n\n</p>\n"},{"textRaw":"Explicit Binding","name":"Explicit Binding","type":"misc","desc":"<p>Sometimes, 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\n</p>\n<p>For 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\n</p>\n<p>That is possible via explicit binding.\n\n</p>\n<p>For example:\n\n</p>\n<pre><code>// 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&apos;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(&apos;error&apos;, function(er) {\n console.error(&apos;Error&apos;, er, req.url);\n try {\n res.writeHead(500);\n res.end(&apos;Error occurred, sorry.&apos;);\n res.on(&apos;close&apos;, function() {\n // forcibly shut down any other things added to this domain\n reqd.dispose();\n });\n } catch (er) {\n console.error(&apos;Error sending 500&apos;, er, req.url);\n // tried our best. clean up anything remaining.\n reqd.dispose();\n }\n });\n }).listen(1337);\n});</code></pre>\n"}],"methods":[{"textRaw":"domain.create()","type":"method","name":"create","signatures":[{"return":{"textRaw":"return: {Domain} ","name":"return","type":"Domain"},"params":[]},{"params":[]}],"desc":"<p>Returns a new Domain object.\n\n</p>\n"}],"classes":[{"textRaw":"Class: Domain","type":"class","name":"Domain","desc":"<p>The Domain class encapsulates the functionality of routing errors and\nuncaught exceptions to the active Domain object.\n\n</p>\n<p>Domain is a child class of [EventEmitter][]. To handle the errors that it\ncatches, listen to its <code>error</code> event.\n\n</p>\n","methods":[{"textRaw":"domain.run(fn)","type":"method","name":"run","signatures":[{"params":[{"textRaw":"`fn` {Function} ","name":"fn","type":"Function"}]},{"params":[{"name":"fn"}]}],"desc":"<p>Run 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\n</p>\n<p>This is the most basic way to use a domain.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var d = domain.create();\nd.on(&apos;error&apos;, function(er) {\n console.error(&apos;Caught error!&apos;, er);\n});\nd.run(function() {\n process.nextTick(function() {\n setTimeout(function() { // simulating some various async stuff\n fs.open(&apos;non-existent file&apos;, &apos;r&apos;, function(er, fd) {\n if (er) throw er;\n // proceed...\n });\n }, 100);\n });\n});</code></pre>\n<p>In this example, the <code>d.on(&apos;error&apos;)</code> handler will be triggered, rather\nthan crashing the program.\n\n</p>\n"},{"textRaw":"domain.add(emitter)","type":"method","name":"add","signatures":[{"params":[{"textRaw":"`emitter` {EventEmitter | Timer} emitter or timer to be added to the domain ","name":"emitter","type":"EventEmitter | Timer","desc":"emitter or timer to be added to the domain"}]},{"params":[{"name":"emitter"}]}],"desc":"<p>Explicitly adds an emitter to the domain. If any event handlers called by\nthe emitter throw an error, or if the emitter emits an <code>error</code> event, it\nwill be routed to the domain&apos;s <code>error</code> event, just like with implicit\nbinding.\n\n</p>\n<p>This also works with timers that are returned from <code>setInterval</code> and\n<code>setTimeout</code>. If their callback function throws, it will be caught by\nthe domain &apos;error&apos; handler.\n\n</p>\n<p>If the Timer or EventEmitter was already bound to a domain, it is removed\nfrom that one, and bound to this one instead.\n\n</p>\n"},{"textRaw":"domain.remove(emitter)","type":"method","name":"remove","signatures":[{"params":[{"textRaw":"`emitter` {EventEmitter | Timer} emitter or timer to be removed from the domain ","name":"emitter","type":"EventEmitter | Timer","desc":"emitter or timer to be removed from the domain"}]},{"params":[{"name":"emitter"}]}],"desc":"<p>The opposite of <code>domain.add(emitter)</code>. Removes domain handling from the\nspecified emitter.\n\n</p>\n"},{"textRaw":"domain.bind(cb)","type":"method","name":"bind","signatures":[{"return":{"textRaw":"return: {Function} The bound function ","name":"return","type":"Function","desc":"The bound function"},"params":[{"textRaw":"`cb` {Function} The callback function ","name":"cb","type":"Function","desc":"The callback function"}]},{"params":[{"name":"cb"}]}],"desc":"<p>The 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&apos;s <code>error</code> event.\n\n</p>\n<h4>Example</h4>\n<pre><code>var d = domain.create();\n\nfunction 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\nd.on(&apos;error&apos;, 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});</code></pre>\n"},{"textRaw":"domain.intercept(cb)","type":"method","name":"intercept","signatures":[{"return":{"textRaw":"return: {Function} The intercepted function ","name":"return","type":"Function","desc":"The intercepted function"},"params":[{"textRaw":"`cb` {Function} The callback function ","name":"cb","type":"Function","desc":"The callback function"}]},{"params":[{"name":"cb"}]}],"desc":"<p>This method is almost identical to <code>domain.bind(cb)</code>. However, in\naddition to catching thrown errors, it will also intercept <code>Error</code>\nobjects sent as the first argument to the function.\n\n</p>\n<p>In this way, the common <code>if (er) return cb(er);</code> pattern can be replaced\nwith a single error handler in a single place.\n\n</p>\n<h4>Example</h4>\n<pre><code>var d = domain.create();\n\nfunction readSomeFile(filename, cb) {\n fs.readFile(filename, d.intercept(function(data) {\n // note, the first argument is never passed to the\n // callback since it is assumed to be the &apos;Error&apos; argument\n // and thus intercepted by the domain.\n\n // if this throws, it will also be passed to the domain\n // so the error-handling logic can be moved to the &apos;error&apos;\n // event on the domain instead of being repeated throughout\n // the program.\n return cb(null, JSON.parse(data));\n }));\n}\n\nd.on(&apos;error&apos;, 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});</code></pre>\n"},{"textRaw":"domain.dispose()","type":"method","name":"dispose","desc":"<p>The 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\n</p>\n<p>The intention of calling <code>dispose</code> is generally to prevent cascading\nerrors when a critical part of the Domain context is found to be in an\nerror state.\n\n</p>\n<p>Once the domain is disposed the <code>dispose</code> event will emit.\n\n</p>\n<p>Note 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.\n\n</p>\n","signatures":[{"params":[]}]}],"properties":[{"textRaw":"`members` {Array} ","name":"members","desc":"<p>An array of timers and event emitters that have been explicitly added\nto the domain.\n\n</p>\n"}]}],"type":"module","displayName":"Domain"}]}
View
1 public/json/0.8.3/http.json
@@ -1 +0,0 @@
-{"source":"doc/api/http.markdown","modules":[{"textRaw":"HTTP","name":"http","stability":3,"stabilityText":"Stable","desc":"<p>To use the HTTP server and client one must <code>require(&apos;http&apos;)</code>.\n\n</p>\n<p>The HTTP interfaces in Node are designed to support many features\nof the protocol which have been traditionally difficult to use.\nIn particular, large, possibly chunk-encoded, messages. The interface is\ncareful to never buffer entire requests or responses--the\nuser is able to stream data.\n\n</p>\n<p>HTTP message headers are represented by an object like this:\n\n</p>\n<pre><code>{ &apos;content-length&apos;: &apos;123&apos;,\n &apos;content-type&apos;: &apos;text/plain&apos;,\n &apos;connection&apos;: &apos;keep-alive&apos;,\n &apos;accept&apos;: &apos;*/*&apos; }</code></pre>\n<p>Keys are lowercased. Values are not modified.\n\n</p>\n<p>In order to support the full spectrum of possible HTTP applications, Node&apos;s\nHTTP API is very low-level. It deals with stream handling and message\nparsing only. It parses a message into headers and body but it does not\nparse the actual headers or the body.\n\n\n</p>\n","properties":[{"textRaw":"`STATUS_CODES` {Object} ","name":"STATUS_CODES","desc":"<p>A collection of all the standard HTTP response status codes, and the\nshort description of each. For example, <code>http.STATUS_CODES[404] === &apos;Not\nFound&apos;</code>.\n\n</p>\n"},{"textRaw":"http.globalAgent","name":"globalAgent","desc":"<p>Global instance of Agent which is used as the default for all http client\nrequests.\n\n\n</p>\n"},{"textRaw":"http.ClientResponse","name":"ClientResponse","desc":"<p>This object is created when making a request with <code>http.request()</code>. It is\npassed to the <code>&apos;response&apos;</code> event of the request object.\n\n</p>\n<p>The response implements the [Readable Stream][] interface. This is an\n[EventEmitter][] with the following events:\n\n\n</p>\n","events":[{"textRaw":"Event: 'data'","type":"event","name":"data","desc":"<p><code>function (chunk) { }</code>\n\n</p>\n<p>Emitted when a piece of the message body is received.\n\n</p>\n<p>Note that the <strong>data will be lost</strong> if there is no listener when a\n<code>ClientResponse</code> emits a <code>&apos;data&apos;</code> event.\n\n\n</p>\n","params":[]},{"textRaw":"Event: 'end'","type":"event","name":"end","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Emitted exactly once for each message. No arguments. After\nemitted no other events will be emitted on the response.\n\n</p>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function (err) { }</code>\n\n</p>\n<p>Indicates that the underlaying connection was terminated before\n<code>end</code> event was emitted.\nSee [http.ServerRequest][]&apos;s <code>&apos;close&apos;</code> event for more information.\n\n</p>\n","params":[]}],"properties":[{"textRaw":"response.statusCode","name":"statusCode","desc":"<p>The 3-digit HTTP response status code. E.G. <code>404</code>.\n\n</p>\n"},{"textRaw":"response.httpVersion","name":"httpVersion","desc":"<p>The HTTP version of the connected-to server. Probably either\n<code>&apos;1.1&apos;</code> or <code>&apos;1.0&apos;</code>.\nAlso <code>response.httpVersionMajor</code> is the first integer and\n<code>response.httpVersionMinor</code> is the second.\n\n</p>\n"},{"textRaw":"response.headers","name":"headers","desc":"<p>The response headers object.\n\n</p>\n"},{"textRaw":"response.trailers","name":"trailers","desc":"<p>The response trailers object. Only populated after the &apos;end&apos; event.\n\n</p>\n"}],"methods":[{"textRaw":"response.setEncoding([encoding])","type":"method","name":"setEncoding","desc":"<p>Set the encoding for the response body. See [stream.setEncoding()][] for more\ninformation.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"response.pause()","type":"method","name":"pause","desc":"<p>Pauses response from emitting events. Useful to throttle back a download.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"response.resume()","type":"method","name":"resume","desc":"<p>Resumes a paused response.\n\n</p>\n","signatures":[{"params":[]}]}]}],"methods":[{"textRaw":"http.createServer([requestListener])","type":"method","name":"createServer","desc":"<p>Returns a new web server object.\n\n</p>\n<p>The <code>requestListener</code> is a function which is automatically\nadded to the <code>&apos;request&apos;</code> event.\n\n</p>\n","signatures":[{"params":[{"name":"requestListener","optional":true}]}]},{"textRaw":"http.createClient([port], [host])","type":"method","name":"createClient","desc":"<p>This function is <strong>deprecated</strong>; please use [http.request()][] instead.\nConstructs a new HTTP client. <code>port</code> and <code>host</code> refer to the server to be\nconnected to.\n\n</p>\n","signatures":[{"params":[{"name":"port","optional":true},{"name":"host","optional":true}]}]},{"textRaw":"http.request(options, callback)","type":"method","name":"request","desc":"<p>Node maintains several connections per server to make HTTP requests.\nThis function allows one to transparently issue requests.\n\n</p>\n<p><code>options</code> can be an object or a string. If <code>options</code> is a string, it is\nautomatically parsed with [url.parse()][].\n\n</p>\n<p>Options:\n\n</p>\n<ul>\n<li><code>host</code>: A domain name or IP address of the server to issue the request to.\nDefaults to <code>&apos;localhost&apos;</code>.</li>\n<li><code>hostname</code>: To support <code>url.parse()</code> <code>hostname</code> is preferred over <code>host</code></li>\n<li><code>port</code>: Port of remote server. Defaults to 80.</li>\n<li><code>localAddress</code>: Local interface to bind for network connections.</li>\n<li><code>socketPath</code>: Unix Domain Socket (use one of host:port or socketPath)</li>\n<li><code>method</code>: A string specifying the HTTP request method. Defaults to <code>&apos;GET&apos;</code>.</li>\n<li><code>path</code>: Request path. Defaults to <code>&apos;/&apos;</code>. Should include query string if any.\nE.G. <code>&apos;/index.html?page=12&apos;</code></li>\n<li><code>headers</code>: An object containing request headers.</li>\n<li><code>auth</code>: Basic authentication i.e. <code>&apos;user:password&apos;</code> to compute an\nAuthorization header.</li>\n<li><code>agent</code>: Controls [Agent][] behavior. When an Agent is used request will\ndefault to <code>Connection: keep-alive</code>. Possible values:<ul>\n<li><code>undefined</code> (default): use [global Agent][] for this host and port.</li>\n<li><code>Agent</code> object: explicitly use the passed in <code>Agent</code>.</li>\n<li><code>false</code>: opts out of connection pooling with an Agent, defaults request to\n<code>Connection: close</code>.</li>\n</ul>\n</li>\n</ul>\n<p><code>http.request()</code> returns an instance of the <code>http.ClientRequest</code>\nclass. The <code>ClientRequest</code> instance is a writable stream. If one needs to\nupload a file with a POST request, then write to the <code>ClientRequest</code> object.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var options = {\n host: &apos;www.google.com&apos;,\n port: 80,\n path: &apos;/upload&apos;,\n method: &apos;POST&apos;\n};\n\nvar req = http.request(options, function(res) {\n console.log(&apos;STATUS: &apos; + res.statusCode);\n console.log(&apos;HEADERS: &apos; + JSON.stringify(res.headers));\n res.setEncoding(&apos;utf8&apos;);\n res.on(&apos;data&apos;, function (chunk) {\n console.log(&apos;BODY: &apos; + chunk);\n });\n});\n\nreq.on(&apos;error&apos;, function(e) {\n console.log(&apos;problem with request: &apos; + e.message);\n});\n\n// write data to request body\nreq.write(&apos;data\\n&apos;);\nreq.write(&apos;data\\n&apos;);\nreq.end();</code></pre>\n<p>Note that in the example <code>req.end()</code> was called. With <code>http.request()</code> one\nmust always call <code>req.end()</code> to signify that you&apos;re done with the request -\neven if there is no data being written to the request body.\n\n</p>\n<p>If any error is encountered during the request (be that with DNS resolution,\nTCP level errors, or actual HTTP parse errors) an <code>&apos;error&apos;</code> event is emitted\non the returned request object.\n\n</p>\n<p>There are a few special headers that should be noted.\n\n</p>\n<ul>\n<li><p>Sending a &apos;Connection: keep-alive&apos; will notify Node that the connection to\nthe server should be persisted until the next request.</p>\n</li>\n<li><p>Sending a &apos;Content-length&apos; header will disable the default chunked encoding.</p>\n</li>\n<li><p>Sending an &apos;Expect&apos; header will immediately send the request headers.\nUsually, when sending &apos;Expect: 100-continue&apos;, you should both set a timeout\nand listen for the <code>continue</code> event. See RFC2616 Section 8.2.3 for more\ninformation.</p>\n</li>\n<li><p>Sending an Authorization header will override using the <code>auth</code> option\nto compute basic authentication.</p>\n</li>\n</ul>\n","signatures":[{"params":[{"name":"options"},{"name":"callback"}]}]},{"textRaw":"http.get(options, callback)","type":"method","name":"get","desc":"<p>Since most requests are GET requests without bodies, Node provides this\nconvenience method. The only difference between this method and <code>http.request()</code>\nis that it sets the method to GET and calls <code>req.end()</code> automatically.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>http.get(&quot;http://www.google.com/index.html&quot;, function(res) {\n console.log(&quot;Got response: &quot; + res.statusCode);\n}).on(&apos;error&apos;, function(e) {\n console.log(&quot;Got error: &quot; + e.message);\n});</code></pre>\n","signatures":[{"params":[{"name":"options"},{"name":"callback"}]}]}],"classes":[{"textRaw":"Class: http.Server","type":"class","name":"http.Server","desc":"<p>This is an [EventEmitter][] with the following events:\n\n</p>\n","events":[{"textRaw":"Event: 'request'","type":"event","name":"request","desc":"<p><code>function (request, response) { }</code>\n\n</p>\n<p>Emitted each time there is a request. Note that there may be multiple requests\nper connection (in the case of keep-alive connections).\n <code>request</code> is an instance of <code>http.ServerRequest</code> and <code>response</code> is\n an instance of <code>http.ServerResponse</code>\n\n</p>\n","params":[]},{"textRaw":"Event: 'connection'","type":"event","name":"connection","desc":"<p><code>function (socket) { }</code>\n\n</p>\n<p> When a new TCP stream is established. <code>socket</code> is an object of type\n <code>net.Socket</code>. Usually users will not want to access this event. The\n <code>socket</code> can also be accessed at <code>request.connection</code>.\n\n</p>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function () { }</code>\n\n</p>\n<p> Emitted when the server closes.\n\n</p>\n","params":[]},{"textRaw":"Event: 'checkContinue'","type":"event","name":"checkContinue","desc":"<p><code>function (request, response) { }</code>\n\n</p>\n<p>Emitted each time a request with an http Expect: 100-continue is received.\nIf this event isn&apos;t listened for, the server will automatically respond\nwith a 100 Continue as appropriate.\n\n</p>\n<p>Handling this event involves calling <code>response.writeContinue</code> 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 the\nrequest body.\n\n</p>\n<p>Note that when this event is emitted and handled, the <code>request</code> event will\nnot be emitted.\n\n</p>\n","params":[]},{"textRaw":"Event: 'connect'","type":"event","name":"connect","desc":"<p><code>function (request, socket, head) { }</code>\n\n</p>\n<p>Emitted each time a client requests a http CONNECT method. If this event isn&apos;t\nlistened for, then clients requesting a CONNECT method will have their\nconnections closed.\n\n</p>\n<ul>\n<li><code>request</code> is the arguments for the http request, as it is in the request\nevent.</li>\n<li><code>socket</code> is the network socket between the server and client.</li>\n<li><code>head</code> is an instance of Buffer, the first packet of the tunneling stream,\nthis may be empty.</li>\n</ul>\n<p>After this event is emitted, the request&apos;s socket will not have a <code>data</code>\nevent listener, meaning you will need to bind to it in order to handle data\nsent to the server on that socket.\n\n</p>\n","params":[]},{"textRaw":"Event: 'upgrade'","type":"event","name":"upgrade","desc":"<p><code>function (request, socket, head) { }</code>\n\n</p>\n<p>Emitted each time a client requests a http upgrade. If this event isn&apos;t\nlistened for, then clients requesting an upgrade will have their connections\nclosed.\n\n</p>\n<ul>\n<li><code>request</code> is the arguments for the http request, as it is in the request\nevent.</li>\n<li><code>socket</code> is the network socket between the server and client.</li>\n<li><code>head</code> is an instance of Buffer, the first packet of the upgraded stream,\nthis may be empty.</li>\n</ul>\n<p>After this event is emitted, the request&apos;s socket will not have a <code>data</code>\nevent listener, meaning you will need to bind to it in order to handle data\nsent to the server on that socket.\n\n</p>\n","params":[]},{"textRaw":"Event: 'clientError'","type":"event","name":"clientError","desc":"<p><code>function (exception) { }</code>\n\n</p>\n<p>If a client connection emits an &apos;error&apos; event - it will forwarded here.\n\n</p>\n","params":[]}],"methods":[{"textRaw":"server.listen(port, [hostname], [backlog], [callback])","type":"method","name":"listen","desc":"<p>Begin accepting connections on the specified port and hostname. If the\nhostname is omitted, the server will accept connections directed to any\nIPv4 address (<code>INADDR_ANY</code>).\n\n</p>\n<p>To listen to a unix socket, supply a filename instead of port and hostname.\n\n</p>\n<p>Backlog is the maximum length of the queue of pending connections.\nThe actual length will be determined by your OS through sysctl settings such as\n<code>tcp_max_syn_backlog</code> and <code>somaxconn</code> on linux. The default value of this\nparameter is 511 (not 512).\n\n</p>\n<p>This function is asynchronous. The last parameter <code>callback</code> will be added as\na listener for the [&apos;listening&apos;][] event. See also [net.Server.listen(port)][].\n\n\n</p>\n","signatures":[{"params":[{"name":"port"},{"name":"hostname","optional":true},{"name":"backlog","optional":true},{"name":"callback","optional":true}]}]},{"textRaw":"server.listen(path, [callback])","type":"method","name":"listen","desc":"<p>Start a UNIX socket server listening for connections on the given <code>path</code>.\n\n</p>\n<p>This function is asynchronous. The last parameter <code>callback</code> will be added as\na listener for the [&apos;listening&apos;][] event. See also [net.Server.listen(path)][].\n\n\n</p>\n","signatures":[{"params":[{"name":"path"},{"name":"callback","optional":true}]}]},{"textRaw":"server.listen(handle, [listeningListener])","type":"method","name":"listen","signatures":[{"params":[{"textRaw":"`handle` {Object} ","name":"handle","type":"Object"},{"textRaw":"`listeningListener` {Function} ","name":"listeningListener","type":"Function","optional":true}]},{"params":[{"name":"handle"},{"name":"listeningListener","optional":true}]}],"desc":"<p>The <code>handle</code> object can be set to either a server or socket (anything\nwith an underlying <code>_handle</code> member), or a <code>{fd: &lt;n&gt;}</code> object.\n\n</p>\n<p>This will cause the server to accept connections on the specified\nhandle, but it is presumed that the file descriptor or handle has\nalready been bound to a port or domain socket.\n\n</p>\n<p>Listening on a file descriptor is not supported on Windows.\n\n</p>\n<p>This function is asynchronous. The last parameter <code>callback</code> will be added as\na listener for the <a href=\"net.html#event_listening_\">&apos;listening&apos;</a> event.\nSee also <a href=\"net.html#server.listen\">net.Server.listen()</a>.\n\n</p>\n"},{"textRaw":"server.close([cb])","type":"method","name":"close","desc":"<p>Stops the server from accepting new connections. See [net.Server.close()][].\n\n\n</p>\n","signatures":[{"params":[{"name":"cb","optional":true}]}]}],"properties":[{"textRaw":"server.maxHeadersCount","name":"maxHeadersCount","desc":"<p>Limits maximum incoming headers count, equal to 1000 by default. If set to 0 -\nno limit will be applied.\n\n\n</p>\n"}]},{"textRaw":"Class: http.ServerRequest","type":"class","name":"http.ServerRequest","desc":"<p>This object is created internally by a HTTP server -- not by\nthe user -- and passed as the first argument to a <code>&apos;request&apos;</code> listener.\n\n</p>\n<p>The request implements the [Readable Stream][] interface. This is an\n[EventEmitter][] with the following events:\n\n</p>\n","events":[{"textRaw":"Event: 'data'","type":"event","name":"data","desc":"<p><code>function (chunk) { }</code>\n\n</p>\n<p>Emitted when a piece of the message body is received. The chunk is a string if\nan encoding has been set with <code>request.setEncoding()</code>, otherwise it&apos;s a\n[Buffer][].\n\n</p>\n<p>Note that the <strong>data will be lost</strong> if there is no listener when a\n<code>ServerRequest</code> emits a <code>&apos;data&apos;</code> event.\n\n</p>\n","params":[]},{"textRaw":"Event: 'end'","type":"event","name":"end","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Emitted exactly once for each request. After that, no more <code>&apos;data&apos;</code> events\nwill be emitted on the request.\n\n</p>\n","params":[]},{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Indicates that the underlaying connection was terminated before\n<code>response.end()</code> was called or able to flush.\n\n</p>\n<p>Just like <code>&apos;end&apos;</code>, this event occurs only once per request, and no more <code>&apos;data&apos;</code>\nevents will fire afterwards.\n\n</p>\n<p>Note: <code>&apos;close&apos;</code> can fire after <code>&apos;end&apos;</code>, but not vice versa.\n\n</p>\n","params":[]}],"properties":[{"textRaw":"request.method","name":"method","desc":"<p>The request method as a string. Read only. Example:\n<code>&apos;GET&apos;</code>, <code>&apos;DELETE&apos;</code>.\n\n\n</p>\n"},{"textRaw":"request.url","name":"url","desc":"<p>Request URL string. This contains only the URL that is\npresent in the actual HTTP request. If the request is:\n\n</p>\n<pre><code>GET /status?name=ryan HTTP/1.1\\r\\n\nAccept: text/plain\\r\\n\n\\r\\n</code></pre>\n<p>Then <code>request.url</code> will be:\n\n</p>\n<pre><code>&apos;/status?name=ryan&apos;</code></pre>\n<p>If you would like to parse the URL into its parts, you can use\n<code>require(&apos;url&apos;).parse(request.url)</code>. Example:\n\n</p>\n<pre><code>node&gt; require(&apos;url&apos;).parse(&apos;/status?name=ryan&apos;)\n{ href: &apos;/status?name=ryan&apos;,\n search: &apos;?name=ryan&apos;,\n query: &apos;name=ryan&apos;,\n pathname: &apos;/status&apos; }</code></pre>\n<p>If you would like to extract the params from the query string,\nyou can use the <code>require(&apos;querystring&apos;).parse</code> function, or pass\n<code>true</code> as the second argument to <code>require(&apos;url&apos;).parse</code>. Example:\n\n</p>\n<pre><code>node&gt; require(&apos;url&apos;).parse(&apos;/status?name=ryan&apos;, true)\n{ href: &apos;/status?name=ryan&apos;,\n search: &apos;?name=ryan&apos;,\n query: { name: &apos;ryan&apos; },\n pathname: &apos;/status&apos; }</code></pre>\n"},{"textRaw":"request.headers","name":"headers","desc":"<p>Read only.\n\n</p>\n"},{"textRaw":"request.trailers","name":"trailers","desc":"<p>Read only; HTTP trailers (if present). Only populated after the &apos;end&apos; event.\n\n</p>\n"},{"textRaw":"request.httpVersion","name":"httpVersion","desc":"<p>The HTTP protocol version as a string. Read only. Examples:\n<code>&apos;1.1&apos;</code>, <code>&apos;1.0&apos;</code>.\nAlso <code>request.httpVersionMajor</code> is the first integer and\n<code>request.httpVersionMinor</code> is the second.\n\n\n</p>\n"},{"textRaw":"request.connection","name":"connection","desc":"<p>The <code>net.Socket</code> object associated with the connection.\n\n\n</p>\n<p>With HTTPS support, use request.connection.verifyPeer() and\nrequest.connection.getPeerCertificate() to obtain the client&apos;s\nauthentication details.\n\n\n\n</p>\n"}],"methods":[{"textRaw":"request.setEncoding([encoding])","type":"method","name":"setEncoding","desc":"<p>Set the encoding for the request body. See [stream.setEncoding()][] for more\ninformation.\n\n</p>\n","signatures":[{"params":[{"name":"encoding","optional":true}]}]},{"textRaw":"request.pause()","type":"method","name":"pause","desc":"<p>Pauses request from emitting events. Useful to throttle back an upload.\n\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"request.resume()","type":"method","name":"resume","desc":"<p>Resumes a paused request.\n\n</p>\n","signatures":[{"params":[]}]}]},{"textRaw":"Class: http.ServerResponse","type":"class","name":"http.ServerResponse","desc":"<p>This object is created internally by a HTTP server--not by the user. It is\npassed as the second parameter to the <code>&apos;request&apos;</code> event.\n\n</p>\n<p>The response implements the [Writable Stream][] interface. This is an\n[EventEmitter][] with the following events:\n\n</p>\n","events":[{"textRaw":"Event: 'close'","type":"event","name":"close","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Indicates that the underlaying connection was terminated before\n<code>response.end()</code> was called or able to flush.\n\n</p>\n","params":[]}],"methods":[{"textRaw":"response.writeContinue()","type":"method","name":"writeContinue","desc":"<p>Sends a HTTP/1.1 100 Continue message to the client, indicating that\nthe request body should be sent. See the [&apos;checkContinue&apos;][] event on <code>Server</code>.\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"response.writeHead(statusCode, [reasonPhrase], [headers])","type":"method","name":"writeHead","desc":"<p>Sends a response header to the request. The status code is a 3-digit HTTP\nstatus code, like <code>404</code>. The last argument, <code>headers</code>, are the response headers.\nOptionally one can give a human-readable <code>reasonPhrase</code> as the second\nargument.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var body = &apos;hello world&apos;;\nresponse.writeHead(200, {\n &apos;Content-Length&apos;: body.length,\n &apos;Content-Type&apos;: &apos;text/plain&apos; });</code></pre>\n<p>This method must only be called once on a message and it must\nbe called before <code>response.end()</code> is called.\n\n</p>\n<p>If you call <code>response.write()</code> or <code>response.end()</code> before calling this, the\nimplicit/mutable headers will be calculated and call this function for you.\n\n</p>\n<p>Note: that Content-Length is given in bytes not characters. The above example\nworks because the string <code>&apos;hello world&apos;</code> contains only single byte characters.\nIf the body contains higher coded characters then <code>Buffer.byteLength()</code>\nshould be used to determine the number of bytes in a given encoding.\nAnd Node does not check whether Content-Length and the length of the body\nwhich has been transmitted are equal or not.\n\n</p>\n","signatures":[{"params":[{"name":"statusCode"},{"name":"reasonPhrase","optional":true},{"name":"headers","optional":true}]}]},{"textRaw":"response.setHeader(name, value)","type":"method","name":"setHeader","desc":"<p>Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value will be replaced. Use an array of strings\nhere if you need to send multiple headers with the same name.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>response.setHeader(&quot;Content-Type&quot;, &quot;text/html&quot;);</code></pre>\n<p>or\n\n</p>\n<pre><code>response.setHeader(&quot;Set-Cookie&quot;, [&quot;type=ninja&quot;, &quot;language=javascript&quot;]);</code></pre>\n","signatures":[{"params":[{"name":"name"},{"name":"value"}]}]},{"textRaw":"response.getHeader(name)","type":"method","name":"getHeader","desc":"<p>Reads out a header that&apos;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</p>\n<p>Example:\n\n</p>\n<pre><code>var contentType = response.getHeader(&apos;content-type&apos;);</code></pre>\n","signatures":[{"params":[{"name":"name"}]}]},{"textRaw":"response.removeHeader(name)","type":"method","name":"removeHeader","desc":"<p>Removes a header that&apos;s queued for implicit sending.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>response.removeHeader(&quot;Content-Encoding&quot;);</code></pre>\n","signatures":[{"params":[{"name":"name"}]}]},{"textRaw":"response.write(chunk, [encoding])","type":"method","name":"write","desc":"<p>If this method is called and <code>response.writeHead()</code> has not been called, it will\nswitch to implicit header mode and flush the implicit headers.\n\n</p>\n<p>This sends a chunk of the response body. This method may\nbe called multiple times to provide successive parts of the body.\n\n</p>\n<p><code>chunk</code> can be a string or a buffer. If <code>chunk</code> is a string,\nthe second parameter specifies how to encode it into a byte stream.\nBy default the <code>encoding</code> is <code>&apos;utf8&apos;</code>.\n\n</p>\n<p><strong>Note</strong>: This is the raw HTTP body and has nothing to do with\nhigher-level multi-part body encodings that may be used.\n\n</p>\n<p>The first time <code>response.write()</code> is called, it will send the buffered\nheader information and the first body to the client. The second time\n<code>response.write()</code> is called, Node assumes you&apos;re going to be streaming\ndata, and sends that separately. That is, the response is buffered up to the\nfirst chunk of body.\n\n</p>\n","signatures":[{"params":[{"name":"chunk"},{"name":"encoding","optional":true}]}]},{"textRaw":"response.addTrailers(headers)","type":"method","name":"addTrailers","desc":"<p>This method adds HTTP trailing headers (a header but at the end of the\nmessage) to the response.\n\n</p>\n<p>Trailers will <strong>only</strong> be emitted if chunked encoding is used for the\nresponse; if it is not (e.g., if the request was HTTP/1.0), they will\nbe silently discarded.\n\n</p>\n<p>Note that HTTP requires the <code>Trailer</code> header to be sent if you intend to\nemit trailers, with a list of the header fields in its value. E.g.,\n\n</p>\n<pre><code>response.writeHead(200, { &apos;Content-Type&apos;: &apos;text/plain&apos;,\n &apos;Trailer&apos;: &apos;Content-MD5&apos; });\nresponse.write(fileData);\nresponse.addTrailers({&apos;Content-MD5&apos;: &quot;7895bf4b8828b55ceaf47747b4bca667&quot;});\nresponse.end();</code></pre>\n","signatures":[{"params":[{"name":"headers"}]}]},{"textRaw":"response.end([data], [encoding])","type":"method","name":"end","desc":"<p>This method signals to the server that all of the response headers and body\nhas been sent; that server should consider this message complete.\nThe method, <code>response.end()</code>, MUST be called on each\nresponse.\n\n</p>\n<p>If <code>data</code> is specified, it is equivalent to calling <code>response.write(data, encoding)</code>\nfollowed by <code>response.end()</code>.\n\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"encoding","optional":true}]}]}],"properties":[{"textRaw":"response.statusCode","name":"statusCode","desc":"<p>When using implicit headers (not calling <code>response.writeHead()</code> explicitly), this property\ncontrols the status code that will be send to the client when the headers get\nflushed.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>response.statusCode = 404;</code></pre>\n<p>After response header was sent to the client, this property indicates the\nstatus code which was sent out.\n\n</p>\n"},{"textRaw":"response.sendDate","name":"sendDate","desc":"<p>When true, the Date header will be automatically generated and sent in \nthe response if it is not already present in the headers. Defaults to true.\n\n</p>\n<p>This should only be disabled for testing; HTTP requires the Date header\nin responses.\n\n</p>\n"}]},{"textRaw":"Class: http.Agent","type":"class","name":"http.Agent","desc":"<p>In node 0.5.3+ there is a new implementation of the HTTP Agent which is used\nfor pooling sockets used in HTTP client requests.\n\n</p>\n<p>Previously, a single agent instance helped pool for a single host+port. The\ncurrent implementation now holds sockets for any number of hosts.\n\n</p>\n<p>The current HTTP Agent also defaults client requests to using\nConnection:keep-alive. If no pending HTTP requests are waiting on a socket\nto become free the socket is closed. This means that node&apos;s pool has the\nbenefit of keep-alive when under load but still does not require developers\nto manually close the HTTP clients using keep-alive.\n\n</p>\n<p>Sockets are removed from the agent&apos;s pool when the socket emits either a\n&quot;close&quot; event or a special &quot;agentRemove&quot; event. This means that if you intend\nto keep one HTTP request open for a long time and don&apos;t want it to stay in the\npool you can do something along the lines of:\n\n</p>\n<pre><code>http.get(options, function(res) {\n // Do stuff\n}).on(&quot;socket&quot;, function (socket) {\n socket.emit(&quot;agentRemove&quot;);\n});</code></pre>\n<p>Alternatively, you could just opt out of pooling entirely using <code>agent:false</code>:\n\n</p>\n<pre><code>http.get({host:&apos;localhost&apos;, port:80, path:&apos;/&apos;, agent:false}, function (res) {\n // Do stuff\n})</code></pre>\n","properties":[{"textRaw":"agent.maxSockets","name":"maxSockets","desc":"<p>By default set to 5. Determines how many concurrent sockets the agent can have \nopen per host.\n\n</p>\n"},{"textRaw":"agent.sockets","name":"sockets","desc":"<p>An object which contains arrays of sockets currently in use by the Agent. Do not \nmodify.\n\n</p>\n"},{"textRaw":"agent.requests","name":"requests","desc":"<p>An object which contains queues of requests that have not yet been assigned to \nsockets. Do not modify.\n\n</p>\n"}]},{"textRaw":"Class: http.ClientRequest","type":"class","name":"http.ClientRequest","desc":"<p>This object is created internally and returned from <code>http.request()</code>. It\nrepresents an <em>in-progress</em> request whose header has already been queued. The\nheader is still mutable using the <code>setHeader(name, value)</code>, <code>getHeader(name)</code>,\n<code>removeHeader(name)</code> API. The actual header will be sent along with the first\ndata chunk or when closing the connection.\n\n</p>\n<p>To get the response, add a listener for <code>&apos;response&apos;</code> to the request object.\n<code>&apos;response&apos;</code> will be emitted from the request object when the response\nheaders have been received. The <code>&apos;response&apos;</code> event is executed with one\nargument which is an instance of <code>http.ClientResponse</code>.\n\n</p>\n<p>During the <code>&apos;response&apos;</code> event, one can add listeners to the\nresponse object; particularly to listen for the <code>&apos;data&apos;</code> event. Note that\nthe <code>&apos;response&apos;</code> event is called before any part of the response body is received,\nso there is no need to worry about racing to catch the first part of the\nbody. As long as a listener for <code>&apos;data&apos;</code> is added during the <code>&apos;response&apos;</code>\nevent, the entire body will be caught.\n\n\n</p>\n<pre><code>// Good\nrequest.on(&apos;response&apos;, function (response) {\n response.on(&apos;data&apos;, function (chunk) {\n console.log(&apos;BODY: &apos; + chunk);\n });\n});\n\n// Bad - misses all or part of the body\nrequest.on(&apos;response&apos;, function (response) {\n setTimeout(function () {\n response.on(&apos;data&apos;, function (chunk) {\n console.log(&apos;BODY: &apos; + chunk);\n });\n }, 10);\n});</code></pre>\n<p>Note: Node does not check whether Content-Length and the length of the body\nwhich has been transmitted are equal or not.\n\n</p>\n<p>The request implements the [Writable Stream][] interface. This is an\n[EventEmitter][] with the following events:\n\n</p>\n","events":[{"textRaw":"Event 'response'","type":"event","name":"response","desc":"<p><code>function (response) { }</code>\n\n</p>\n<p>Emitted when a response is received to this request. This event is emitted only\nonce. The <code>response</code> argument will be an instance of <code>http.ClientResponse</code>.\n\n</p>\n<p>Options:\n\n</p>\n<ul>\n<li><code>host</code>: A domain name or IP address of the server to issue the request to.</li>\n<li><code>port</code>: Port of remote server.</li>\n<li><code>socketPath</code>: Unix Domain Socket (use one of host:port or socketPath)</li>\n</ul>\n","params":[]},{"textRaw":"Event: 'socket'","type":"event","name":"socket","desc":"<p><code>function (socket) { }</code>\n\n</p>\n<p>Emitted after a socket is assigned to this request.\n\n</p>\n","params":[]},{"textRaw":"Event: 'connect'","type":"event","name":"connect","desc":"<p><code>function (response, socket, head) { }</code>\n\n</p>\n<p>Emitted each time a server responds to a request with a CONNECT method. If this\nevent isn&apos;t being listened for, clients receiving a CONNECT method will have\ntheir connections closed.\n\n</p>\n<p>A client server pair that show you how to listen for the <code>connect</code> event.\n\n</p>\n<pre><code>var http = require(&apos;http&apos;);\nvar net = require(&apos;net&apos;);\nvar url = require(&apos;url&apos;);\n\n// Create an HTTP tunneling proxy\nvar proxy = http.createServer(function (req, res) {\n res.writeHead(200, {&apos;Content-Type&apos;: &apos;text/plain&apos;});\n res.end(&apos;okay&apos;);\n});\nproxy.on(&apos;connect&apos;, function(req, cltSocket, head) {\n // connect to an origin server\n var srvUrl = url.parse(&apos;http://&apos; + req.url);\n var srvSocket = net.connect(srvUrl.port, srvUrl.hostname, function() {\n cltSocket.write(&apos;HTTP/1.1 200 Connection Established\\r\\n&apos; +\n &apos;Proxy-agent: Node-Proxy\\r\\n&apos; +\n &apos;\\r\\n&apos;);\n srvSocket.write(head);\n srvSocket.pipe(cltSocket);\n cltSocket.pipe(srvSocket);\n });\n});\n\n// now that proxy is running\nproxy.listen(1337, &apos;127.0.0.1&apos;, function() {\n\n // make a request to a tunneling proxy\n var options = {\n port: 1337,\n host: &apos;127.0.0.1&apos;,\n method: &apos;CONNECT&apos;,\n path: &apos;www.google.com:80&apos;\n };\n\n var req = http.request(options);\n req.end();\n\n req.on(&apos;connect&apos;, function(res, socket, head) {\n console.log(&apos;got connected!&apos;);\n\n // make a request over an HTTP tunnel\n socket.write(&apos;GET / HTTP/1.1\\r\\n&apos; +\n &apos;Host: www.google.com:80\\r\\n&apos; +\n &apos;Connection: close\\r\\n&apos; +\n &apos;\\r\\n&apos;);\n socket.on(&apos;data&apos;, function(chunk) {\n console.log(chunk.toString());\n });\n socket.on(&apos;end&apos;, function() {\n proxy.close();\n });\n });\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'upgrade'","type":"event","name":"upgrade","desc":"<p><code>function (response, socket, head) { }</code>\n\n</p>\n<p>Emitted each time a server responds to a request with an upgrade. If this\nevent isn&apos;t being listened for, clients receiving an upgrade header will have\ntheir connections closed.\n\n</p>\n<p>A client server pair that show you how to listen for the <code>upgrade</code> event.\n\n</p>\n<pre><code>var http = require(&apos;http&apos;);\n\n// Create an HTTP server\nvar srv = http.createServer(function (req, res) {\n res.writeHead(200, {&apos;Content-Type&apos;: &apos;text/plain&apos;});\n res.end(&apos;okay&apos;);\n});\nsrv.on(&apos;upgrade&apos;, function(req, socket, head) {\n socket.write(&apos;HTTP/1.1 101 Web Socket Protocol Handshake\\r\\n&apos; +\n &apos;Upgrade: WebSocket\\r\\n&apos; +\n &apos;Connection: Upgrade\\r\\n&apos; +\n &apos;\\r\\n&apos;);\n\n socket.pipe(socket); // echo back\n});\n\n// now that server is running\nsrv.listen(1337, &apos;127.0.0.1&apos;, function() {\n\n // make a request\n var options = {\n port: 1337,\n host: &apos;127.0.0.1&apos;,\n headers: {\n &apos;Connection&apos;: &apos;Upgrade&apos;,\n &apos;Upgrade&apos;: &apos;websocket&apos;\n }\n };\n\n var req = http.request(options);\n req.end();\n\n req.on(&apos;upgrade&apos;, function(res, socket, upgradeHead) {\n console.log(&apos;got upgraded!&apos;);\n socket.end();\n process.exit(0);\n });\n});</code></pre>\n","params":[]},{"textRaw":"Event: 'continue'","type":"event","name":"continue","desc":"<p><code>function () { }</code>\n\n</p>\n<p>Emitted when the server sends a &apos;100 Continue&apos; HTTP response, usually because\nthe request contained &apos;Expect: 100-continue&apos;. This is an instruction that\nthe client should send the request body.\n\n</p>\n","params":[]}],"methods":[{"textRaw":"request.write(chunk, [encoding])","type":"method","name":"write","desc":"<p>Sends a chunk of the body. By calling this method\nmany times, the user can stream a request body to a\nserver--in that case it is suggested to use the\n<code>[&apos;Transfer-Encoding&apos;, &apos;chunked&apos;]</code> header line when\ncreating the request.\n\n</p>\n<p>The <code>chunk</code> argument should be a [Buffer][] or a string.\n\n</p>\n<p>The <code>encoding</code> argument is optional and only applies when <code>chunk</code> is a string.\nDefaults to <code>&apos;utf8&apos;</code>.\n\n\n</p>\n","signatures":[{"params":[{"name":"chunk"},{"name":"encoding","optional":true}]}]},{"textRaw":"request.end([data], [encoding])","type":"method","name":"end","desc":"<p>Finishes sending the request. If any parts of the body are\nunsent, it will flush them to the stream. If the request is\nchunked, this will send the terminating <code>&apos;0\\r\\n\\r\\n&apos;</code>.\n\n</p>\n<p>If <code>data</code> is specified, it is equivalent to calling\n<code>request.write(data, encoding)</code> followed by <code>request.end()</code>.\n\n</p>\n","signatures":[{"params":[{"name":"data","optional":true},{"name":"encoding","optional":true}]}]},{"textRaw":"request.abort()","type":"method","name":"abort","desc":"<p>Aborts a request. (New since v0.3.8.)\n\n</p>\n","signatures":[{"params":[]}]},{"textRaw":"request.setTimeout(timeout, [callback])","type":"method","name":"setTimeout","desc":"<p>Once a socket is assigned to this request and is connected\n[socket.setTimeout()][] will be called.\n\n</p>\n","signatures":[{"params":[{"name":"timeout"},{"name":"callback","optional":true}]}]},{"textRaw":"request.setNoDelay([noDelay])","type":"method","name":"setNoDelay","desc":"<p>Once a socket is assigned to this request and is connected\n[socket.setNoDelay()][] will be called.\n\n</p>\n","signatures":[{"params":[{"name":"noDelay","optional":true}]}]},{"textRaw":"request.setSocketKeepAlive([enable], [initialDelay])","type":"method","name":"setSocketKeepAlive","desc":"<p>Once a socket is assigned to this request and is connected\n[socket.setKeepAlive()][] will be called.\n\n</p>\n","signatures":[{"params":[{"name":"enable","optional":true},{"name":"initialDelay","optional":true}]}]}]}],"type":"module","displayName":"HTTP"}]}
View
1 public/json/0.8.3/mydata.json
@@ -1 +0,0 @@
-{"synopsis.json":{"Synopsis":{"path":"miscs.0","type":"misc"}},"timers.json":{"Timers":{"path":"modules.0","type":"module"},"setTimeout(callback, delay, [arg], [...])":{"path":"modules.0.methods.0","type":"method"},"clearTimeout(timeoutId)":{"path":"modules.0.methods.1","type":"method"},"setInterval(callback, delay, [arg], [...])":{"path":"modules.0.methods.2","type":"method"},"clearInterval(intervalId)":{"path":"modules.0.methods.3","type":"method"}},"documentation.json":{"About this Documentation":{"path":"miscs.0","type":"misc"},"Stability Index":{"path":"miscs.0.miscs.0","type":"misc"},"JSON Output":{"path":"miscs.0.miscs.1","type":"misc"}},"stdio.json":{"console":{"path":"globals.0","type":"global"},"console.log([data], [...])":{"path":"globals.0.methods.0","type":"method"},"console.info([data], [...])":{"path":"globals.0.methods.1","type":"method"},"console.error([data], [...])":{"path":"globals.0.methods.2","type":"method"},"console.warn([data], [...])":{"path":"globals.0.methods.3","type":"method"},"console.dir(obj)":{"path":"globals.0.methods.4","type":"method"},"console.time(label)":{"path":"globals.0.methods.5","type":"method"},"console.timeEnd(label)":{"path":"globals.0.methods.6","type":"method"},"console.trace(label)":{"path":"globals.0.methods.7","type":"method"},"console.assert(expression, [message])":{"path":"globals.0.methods.8","type":"method"}},"globals.json":{"global":{"path":"miscs.0.globals.0","type":"global"},"process":{"path":"miscs.0.globals.1","type":"global"},"console":{"path":"miscs.0.globals.2","type":"global"},"Class: Buffer":{"path":"miscs.0.globals.3","type":"global"},"clearInterval(t)":{"path":"miscs.0.globals.4","type":"global"},"require()":{"path":"miscs.0.vars.0","type":"var"},"require.resolve()":{"path":"miscs.0.vars.0.methods.0","type":"method"},"`cache` {Object} ":{"path":"miscs.0.vars.0.properties.0"},"`extensions` {Array} ":{"path":"miscs.0.vars.0.properties.1"},"__filename":{"path":"miscs.0.vars.1","type":"var"},"__dirname":{"path":"miscs.0.vars.2","type":"var"},"module":{"path":"miscs.0.vars.3","type":"var"},"exports":{"path":"miscs.0.vars.4","type":"var"},"setTimeout(cb, ms)":{"path":"miscs.0.methods.0","type":"method"},"clearTimeout(t)":{"path":"miscs.0.methods.1","type":"method"},"setInterval(cb, ms)":{"path":"miscs.0.methods.2","type":"method"},"Global Objects":{"path":"miscs.0","type":"misc"}},"events.json":{"Events":{"path":"modules.0","type":"module"},"Class: events.EventEmitter":{"path":"modules.0.classes.0","type":"class"},"emitter.addListener(event, listener)":{"path":"modules.0.classes.0.methods.0","type":"method"},"emitter.on(event, listener)":{"path":"modules.0.classes.0.methods.1","type":"method"},"emitter.once(event, listener)":{"path":"modules.0.classes.0.methods.2","type":"method"},"emitter.removeListener(event, listener)":{"path":"modules.0.classes.0.methods.3","type":"method"},"emitter.removeAllListeners([event])":{"path":"modules.0.classes.0.methods.4","type":"method"},"emitter.setMaxListeners(n)":{"path":"modules.0.classes.0.methods.5","type":"method"},"emitter.listeners(event)":{"path":"modules.0.classes.0.methods.6","type":"method"},"emitter.emit(event, [arg1], [arg2], [...])":{"path":"modules.0.classes.0.methods.7","type":"method"},"Event: 'newListener'":{"path":"modules.0.classes.0.events.0","type":"event"}},"modules.json":{"Modules":{"path":"modules.0","type":"module"},"Cycles":{"path":"modules.0.miscs.0","type":"misc"},"Core Modules":{"path":"modules.0.miscs.1","type":"misc"},"File Modules":{"path":"modules.0.miscs.2","type":"misc"},"Loading from `node_modules` Folders":{"path":"modules.0.miscs.3","type":"misc"},"Folders as Modules":{"path":"modules.0.miscs.4","type":"misc"},"Caching":{"path":"modules.0.miscs.5","type":"misc"},"Module Caching Caveats":{"path":"modules.0.miscs.5.miscs.0","type":"misc"},"All Together...":{"path":"modules.0.miscs.6","type":"misc"},"Loading from the global folders":{"path":"modules.0.miscs.7","type":"misc"},"Accessing the main module":{"path":"modules.0.miscs.8","type":"misc"},"Addenda: Package Manager Tips":{"path":"modules.0.miscs.9","type":"misc"},"The `module` Object":{"path":"modules.0.vars.0","type":"var"},"`exports` {Object} ":{"path":"modules.0.vars.0.properties.0"},"`id` {String} ":{"path":"modules.0.vars.0.methods.0.signatures.0.params.0","type":"String"},"`filename` {String} ":{"path":"modules.0.vars.0.properties.2"},"`loaded` {Boolean} ":{"path":"modules.0.vars.0.properties.3"},"`parent` {Module Object} ":{"path":"modules.0.vars.0.properties.4"},"`children` {Array} ":{"path":"modules.0.vars.0.properties.5"},"module.require(id)":{"path":"modules.0.vars.0.methods.0","type":"method"},"Return: {Object} `exports` from the resolved module ":{"path":"modules.0.vars.0.methods.0.signatures.0.return","type":"Object"}},"util.json":{"util":{"path":"modules.0","type":"module"},"util.format(format, [...])":{"path":"modules.0.methods.0","type":"method"},"util.debug(string)":{"path":"modules.0.methods.1","type":"method"},"util.error([...])":{"path":"modules.0.methods.2","type":"method"},"util.puts([...])":{"path":"modules.0.methods.3","type":"method"},"util.print([...])":{"path":"modules.0.methods.4","type":"method"},"util.log(string)":{"path":"modules.0.methods.5","type":"method"},"util.inspect(object, [showHidden], [depth], [colors])":{"path":"modules.0.methods.6","type":"method"},"util.isArray(object)":{"path":"modules.0.methods.7","type":"method"},"util.isRegExp(object)":{"path":"modules.0.methods.8","type":"method"},"util.isDate(object)":{"path":"modules.0.methods.9","type":"method"},"util.isError(object)":{"path":"modules.0.methods.10","type":"method"},"util.pump(readableStream, writableStream, [callback])":{"path":"modules.0.methods.11","type":"method"},"util.inherits(constructor, superConstructor)":{"path":"modules.0.methods.12","type":"method"}},"addons.json":{"Addons":{"path":"modules.0","type":"module"},"Hello world":{"path":"modules.0.modules.0","type":"module"},"Addon patterns":{"path":"modules.0.modules.1","type":"module"},"Function arguments":{"path":"modules.0.modules.1.modules.0","type":"module"},"Callbacks":{"path":"modules.0.modules.1.modules.1","type":"module"},"Object factory":{"path":"modules.0.modules.1.modules.2","type":"module"},"Function factory":{"path":"modules.0.modules.1.modules.3","type":"module"},"Wrapping C++ objects":{"path":"modules.0.modules.1.modules.4","type":"module"},"Factory of wrapped objects":{"path":"modules.0.modules.1.modules.5","type":"module"},"Passing wrapped objects around":{"path":"modules.0.modules.1.modules.6","type":"module"}},"domain.json":{"Domain":{"path":"modules.0","type":"module"},"Additions to Error objects":{"path":"modules.0.miscs.0","type":"misc"},"Implicit Binding":{"path":"modules.0.miscs.1","type":"misc"},"Explicit Binding":{"path":"modules.0.miscs.2","type":"misc"},"domain.create()":{"path":"modules.0.methods.0","type":"method"},"return: {Domain} ":{"path":"modules.0.methods.0.signatures.0.return","type":"Domain"},"Class: Domain":{"path":"modules.0.classes.0","type":"class"},"domain.run(fn)":{"path":"modules.0.classes.0.methods.0","type":"method"},"`fn` {Function} ":{"path":"modules.0.classes.0.methods.0.signatures.0.params.0","type":"Function"},"domain.add(emitter)":{"path":"modules.0.classes.0.methods.1","type":"method"},"`emitter` {EventEmitter | Timer} emitter or timer to be added to the domain ":{"path":"modules.0.classes.0.methods.1.signatures.0.params.0","type":"EventEmitter | Timer"},"domain.remove(emitter)":{"path":"modules.0.classes.0.methods.2","type":"method"},"`emitter` {EventEmitter | Timer} emitter or timer to be removed from the domain ":{"path":"modules.0.classes.0.methods.2.signatures.0.params.0","type":"EventEmitter | Timer"},"domain.bind(cb)":{"path":"modules.0.classes.0.methods.3","type":"method"},"return: {Function} The bound function ":{"path":"modules.0.classes.0.methods.3.signatures.0.return","type":"Function"},"`cb` {Function} The callback function ":{"path":"modules.0.classes.0.methods.4.signatures.0.params.0","type":"Function"},"domain.intercept(cb)":{"path":"modules.0.classes.0.methods.4","type":"method"},"return: {Function} The intercepted function ":{"path":"modules.0.classes.0.methods.4.signatures.0.return","type":"Function"},"domain.dispose()":{"path":"modules.0.classes.0.methods.5","type":"method"},"`members` {Array} ":{"path":"modules.0.classes.0.properties.0"}},"crypto.json":{"Crypto":{"path":"modules.0","type":"module"},"crypto.createCredentials(details)":{"path":"modules.0.methods.0","type":"method"},"crypto.createHash(algorithm)":{"path":"modules.0.methods.1","type":"method"},"crypto.createHmac(algorithm, key)":{"path":"modules.0.methods.2","type":"method"},"crypto.createCipher(algorithm, password)":{"path":"modules.0.methods.3","type":"method"},"crypto.createCipheriv(algorithm, key, iv)":{"path":"modules.0.methods.4","type":"method"},"crypto.createDecipher(algorithm, password)":{"path":"modules.0.methods.5","type":"method"},"crypto.createDecipheriv(algorithm, key, iv)":{"path":"modules.0.methods.6","type":"method"},"crypto.createSign(algorithm)":{"path":"modules.0.methods.7","type":"method"},"crypto.createVerify(algorithm)":{"path":"modules.0.methods.8","type":"method"},"crypto.createDiffieHellman(prime_length)":{"path":"modules.0.methods.9","type":"method"},"crypto.createDiffieHellman(prime, [encoding])":{"path":"modules.0.methods.10","type":"method"},"crypto.getDiffieHellman(group_name)":{"path":"modules.0.methods.11","type":"method"},"crypto.pbkdf2(password, salt, iterations, keylen, callback)":{"path":"modules.0.methods.12","type":"method"},"crypto.randomBytes(size, [callback])":{"path":"modules.0.methods.13","type":"method"},"Class: Hash":{"path":"modules.0.classes.0","type":"class"},"hash.update(data, [input_encoding])":{"path":"modules.0.classes.0.methods.0","type":"method"},"hash.digest([encoding])":{"path":"modules.0.classes.0.methods.1","type":"method"},"Class: Hmac":{"path":"modules.0.classes.1","type":"class"},"hmac.update(data)":{"path":"modules.0.classes.1.methods.0","type":"method"},"hmac.digest([encoding])":{"path":"modules.0.classes.1.methods.1","type":"method"},"Class: Cipher":{"path":"modules.0.classes.2","type":"class"},"cipher.update(data, [input_encoding], [output_encoding])":{"path":"modules.0.classes.2.methods.0","type":"method"},"cipher.final([output_encoding])":{"path":"modules.0.classes.2.methods.1","type":"method"},"cipher.setAutoPadding(auto_padding=true)":{"path":"modules.0.classes.2.methods.2","type":"method"},"Class: Decipher":{"path":"modules.0.classes.3","type":"class"},"decipher.update(data, [input_encoding], [output_encoding])":{"path":"modules.0.classes.3.methods.0","type":"method"},"decipher.final([output_encoding])":{"path":"modules.0.classes.3.methods.1","type":"method"},"decipher.setAutoPadding(auto_padding=true)":{"path":"modules.0.classes.3.methods.2","type":"method"},"Class: Signer":{"path":"modules.0.classes.4","type":"class"},"signer.update(data)":{"path":"modules.0.classes.4.methods.0","type":"method"},"signer.sign(private_key, [output_format])":{"path":"modules.0.classes.4.methods.1","type":"method"},"Class: Verify":{"path":"modules.0.classes.5","type":"class"},"verifier.update(data)":{"path":"modules.0.classes.5.methods.0","type":"method"},"verifier.verify(object, signature, [signature_format])":{"path":"modules.0.classes.5.methods.1","type":"method"},"Class: DiffieHellman":{"path":"modules.0.classes.6","type":"class"},"diffieHellman.generateKeys([encoding])":{"path":"modules.0.classes.6.methods.0","type":"method"},"diffieHellman.computeSecret(other_public_key, [input_encoding], [output_encoding])":{"path":"modules.0.classes.6.methods.1","type":"method"},"diffieHellman.getPrime([encoding])":{"path":"modules.0.classes.6.methods.2","type":"method"},"diffieHellman.getGenerator([encoding])":{"path":"modules.0.classes.6.methods.3","type":"method"},"diffieHellman.getPublicKey([encoding])":{"path":"modules.0.classes.6.methods.4","type":"method"},"diffieHellman.getPrivateKey([encoding])":{"path":"modules.0.classes.6.methods.5","type":"method"},"diffieHellman.setPublicKey(public_key, [encoding])":{"path":"modules.0.classes.6.methods.6","type":"method"},"diffieHellman.setPrivateKey(public_key, [encoding])":{"path":"modules.0.classes.6.methods.7","type":"method"}},"tls.json":{"TLS (SSL)":{"path":"modules.0","type":"module"},"Client-initiated renegotiation attack mitigation":{"path":"modules.0.miscs.0","type":"misc"},"NPN and SNI":{"path":"modules.0.miscs.1","type":"misc"},"tls.createServer(options, [secureConnectionListener])":{"path":"modules.0.methods.0","type":"method"},"tls.connect(options, [secureConnectListener])":{"path":"modules.0.methods.1","type":"method"},"tls.connect(port, [host], [options], [secureConnectListener])":{"path":"modules.0.methods.2","type":"method"},"tls.createSecurePair([credentials], [isServer], [requestCert], [rejectUnauthorized])":{"path":"modules.0.methods.3","type":"method"},"Class: SecurePair":{"path":"modules.0.classes.0","type":"class"},"Event: 'secure'":{"path":"modules.0.classes.0.events.0","type":"event"},"Class: tls.Server":{"path":"modules.0.classes.1","type":"class"},"Event: 'secureConnection'":{"path":"modules.0.classes.1.events.0","type":"event"},"Event: 'clientError'":{"path":"modules.0.classes.1.events.1","type":"event"},"server.listen(port, [host], [callback])":{"path":"modules.0.classes.1.methods.0","type":"method"},"server.close()":{"path":"modules.0.classes.1.methods.1","type":"method"},"server.address()":{"path":"modules.0.classes.1.methods.2","type":"method"},"server.addContext(hostname, credentials)":{"path":"modules.0.classes.1.methods.3","type":"method"},"server.maxConnections":{"path":"modules.0.classes.1.properties.0"},"server.connections":{"path":"modules.0.classes.1.properties.1"},"Class: tls.CleartextStream":{"path":"modules.0.classes.2","type":"class"},"Event: 'secureConnect'":{"path":"modules.0.classes.2.events.0","type":"event"},"cleartextStream.authorized":{"path":"modules.0.classes.2.properties.0"},"cleartextStream.authorizationError":{"path":"modules.0.classes.2.properties.1"},"cleartextStream.remoteAddress":{"path":"modules.0.classes.2.properties.2"},"cleartextStream.remotePort":{"path":"modules.0.classes.2.properties.3"},"cleartextStream.getPeerCertificate()":{"path":"modules.0.classes.2.methods.0","type":"method"},"cleartextStream.getCipher()":{"path":"modules.0.classes.2.methods.1","type":"method"},"cleartextStream.address()":{"path":"modules.0.classes.2.methods.2","type":"method"}},"string_decoder.json":{"StringDecoder":{"path":"modules.0","type":"module"},"Class: StringDecoder":{"path":"modules.0.classes.0","type":"class"},"StringDecoder.write(buffer)":{"path":"modules.0.classes.0.methods.0","type":"method"}},"path.json":{"Path":{"path":"modules.0","type":"module"},"path.normalize(p)":{"path":"modules.0.methods.0","type":"method"},"path.join([path1], [path2], [...])":{"path":"modules.0.methods.1","type":"method"},"path.resolve([from ...], to)":{"path":"modules.0.methods.2","type":"method"},"path.relative(from, to)":{"path":"modules.0.methods.3","type":"method"},"path.dirname(p)":{"path":"modules.0.methods.4","type":"method"},"path.basename(p, [ext])":{"path":"modules.0.methods.5","type":"method"},"path.extname(p)":{"path":"modules.0.methods.6","type":"method"},"path.sep":{"path":"modules.0.properties.0"}},"net.json":{"net":{"path":"modules.0","type":"module"},"net.createServer([options], [connectionListener])":{"path":"modules.0.methods.0","type":"method"},"net.connect(options, [connectionListener])":{"path":"modules.0.methods.1","type":"method"},"net.createConnection(options, [connectionListener])":{"path":"modules.0.methods.2","type":"method"},"net.connect(port, [host], [connectListener])":{"path":"modules.0.methods.3","type":"method"},"net.createConnection(port, [host], [connectListener])":{"path":"modules.0.methods.4","type":"method"},"net.connect(path, [connectListener])":{"path":"modules.0.methods.5","type":"method"},"net.createConnection(path, [connectListener])":{"path":"modules.0.methods.6","type":"method"},"net.isIP(input)":{"path":"modules.0.methods.7","type":"method"},"net.isIPv4(input)":{"path":"modules.0.methods.8","type":"method"},"net.isIPv6(input)":{"path":"modules.0.methods.9","type":"method"},"Class: net.Server":{"path":"modules.0.classes.0","type":"class"},"server.listen(port, [host], [backlog], [listeningListener])":{"path":"modules.0.classes.0.methods.0","type":"method"},"server.listen(path, [listeningListener])":{"path":"modules.0.classes.0.methods.1","type":"method"},"server.listen(handle, [listeningListener])":{"path":"modules.0.classes.0.methods.2","type":"method"},"`handle` {Object} ":{"path":"modules.0.classes.0.methods.2.signatures.0.params.0","type":"Object"},"`listeningListener` {Function} ":{"path":"modules.0.classes.0.methods.2.signatures.0.params.1","type":"Function"},"server.close([cb])":{"path":"modules.0.classes.0.methods.3","type":"method"},"server.address()":{"path":"modules.0.classes.0.methods.4","type":"method"},"server.maxConnections":{"path":"modules.0.classes.0.properties.0"},"server.connections":{"path":"modules.0.classes.0.properties.1"},"Event: 'listening'":{"path":"modules.0.classes.0.events.0","type":"event"},"Event: 'connection'":{"path":"modules.0.classes.0.events.1","type":"event"},"Event: 'close'":{"path":"modules.0.classes.1.events.6","type":"event"},"Event: 'error'":{"path":"modules.0.classes.1.events.5","type":"event"},"Class: net.Socket":{"path":"modules.0.classes.1","type":"class"},"new net.Socket([options])":{"path":"modules.0.classes.1.methods.0","type":"method"},"socket.connect(port, [host], [connectListener])":{"path":"modules.0.classes.1.methods.1","type":"method"},"socket.connect(path, [connectListener])":{"path":"modules.0.classes.1.methods.2","type":"method"},"socket.setEncoding([encoding])":{"path":"modules.0.classes.1.methods.3","type":"method"},"socket.write(data, [encoding], [callback])":{"path":"modules.0.classes.1.methods.4","type":"method"},"socket.end([data], [encoding])":{"path":"modules.0.classes.1.methods.5","type":"method"},"socket.destroy()":{"path":"modules.0.classes.1.methods.6","type":"method"},"socket.pause()":{"path":"modules.0.classes.1.methods.7","type":"method"},"socket.resume()":{"pa