Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'json-api-v0.6' into v0.6

  • Loading branch information...
isaacs committed Mar 1, 2012
2 parents 4065b24 + 4ca3fd0 commit a63ce6ea941633b9466f129c3ee3dbe116b10553
Showing with 3,076 additions and 2,275 deletions.
  1. +15 −30 Makefile
  2. +2 −2 doc/about/index.html
  3. +4 −6 doc/api/_toc.markdown
  4. +9 −9 doc/api/addons.markdown
  5. +4 −8 doc/api/all.markdown
  6. +1 −1 doc/api/appendix_1.markdown
  7. 0 doc/api/appendix_2.markdown
  8. +12 −12 doc/api/assert.markdown
  9. +177 −51 doc/api/{buffers.markdown → buffer.markdown}
  10. +137 −36 doc/api/{child_processes.markdown → child_process.markdown}
  11. +6 −6 doc/api/cluster.markdown
  12. +58 −17 doc/api/crypto.markdown
  13. +11 −11 doc/api/debugger.markdown
  14. +53 −21 doc/api/dgram.markdown
  15. +11 −11 doc/api/dns.markdown
  16. +59 −0 doc/api/documentation.markdown
  17. +15 −12 doc/api/events.markdown
  18. +89 −86 doc/api/fs.markdown
  19. +58 −16 doc/api/globals.markdown
  20. +24 −24 doc/api/http.markdown
  21. +3 −3 doc/api/https.markdown
  22. +93 −12 doc/api/modules.markdown
  23. +52 −72 doc/api/net.markdown
  24. +14 −12 doc/api/os.markdown
  25. +8 −8 doc/api/path.markdown
  26. +33 −34 doc/api/process.markdown
  27. +7 −5 doc/api/querystring.markdown
  28. +7 −4 doc/api/readline.markdown
  29. +5 −3 doc/api/repl.markdown
  30. +14 −10 doc/api/stdio.markdown
  31. +7 −1 doc/api/{streams.markdown → stream.markdown}
  32. +3 −1 doc/api/synopsis.markdown
  33. +8 −5 doc/api/timers.markdown
  34. +16 −8 doc/api/tls.markdown
  35. +5 −5 doc/api/tty.markdown
  36. +4 −4 doc/api/url.markdown
  37. +11 −11 doc/api/util.markdown
  38. +12 −6 doc/api/vm.markdown
  39. +33 −25 doc/api/zlib.markdown
  40. BIN doc/api_assets/anchor.png
  41. +38 −37 doc/api_assets/style.css
  42. +2 −2 doc/community/index.html
  43. BIN doc/footer-logo-alt.png
  44. BIN doc/icons-interior.png
  45. BIN doc/{ → images}/anchor.png
  46. BIN doc/{ → images}/close-downloads.png
  47. BIN doc/{ → images}/community-icons.png
  48. BIN doc/{ → images}/download-logo.png
  49. BIN doc/{ → images}/ebay-logo.png
  50. BIN doc/{api_assets → images}/footer-logo-alt.png
  51. BIN doc/{ → images}/footer-logo.png
  52. BIN doc/{ → images}/home-icons.png
  53. BIN doc/{api_assets → images}/icons-interior.png
  54. BIN doc/{ → images}/icons.png
  55. BIN doc/{ → images}/joyent-logo_orange_nodeorg-01.png
  56. BIN doc/{ → images}/linkedin-logo.png
  57. BIN doc/{api_assets → images}/logo-light.png
  58. BIN doc/{ → images}/logo.png
  59. BIN doc/{ → images}/logos/monitor.png
  60. BIN doc/{ → images}/logos/node-favicon.png
  61. BIN doc/{ → images}/logos/nodejs-1024x768.png
  62. BIN doc/{ → images}/logos/nodejs-1280x1024.png
  63. BIN doc/{ → images}/logos/nodejs-1440x900.png
  64. BIN doc/{ → images}/logos/nodejs-1920x1200.png
  65. BIN doc/{ → images}/logos/nodejs-2560x1440.png
  66. BIN doc/{ → images}/logos/nodejs-black.eps
  67. BIN doc/{ → images}/logos/nodejs-black.png
  68. BIN doc/{ → images}/logos/nodejs-dark.eps
  69. BIN doc/{ → images}/logos/nodejs-dark.png
  70. BIN doc/{ → images}/logos/nodejs-green.eps
  71. BIN doc/{ → images}/logos/nodejs-green.png
  72. BIN doc/{ → images}/logos/nodejs-light.eps
  73. BIN doc/{ → images}/logos/nodejs.png
  74. BIN doc/{ → images}/microsoft-logo.png
  75. BIN doc/{community → images}/not-invented-here.png
  76. BIN doc/{api_assets → images}/platform-icons.png
  77. BIN doc/{ → images}/ryan-speaker.jpg
  78. 0 doc/{api_assets → images}/sh_javascript.min.js
  79. 0 doc/{api_assets → images}/sh_main.js
  80. BIN doc/{ → images}/sponsored.png
  81. BIN doc/{api_assets → images}/twitter-bird.png
  82. BIN doc/{ → images}/yahoo-logo.png
  83. +7 −7 doc/index.html
  84. BIN doc/logo-light.png
  85. +12 −12 doc/logos/index.html
  86. +18 −18 doc/pipe.css
  87. BIN doc/platform-icons.png
  88. +21 −13 doc/template.html
  89. BIN doc/twitter-bird.png
  90. +96 −0 tools/doc/README.md
  91. +99 −0 tools/doc/generate.js
  92. +154 −0 tools/doc/html.js
  93. +536 −0 tools/doc/json.js
  94. +1 −0 tools/doc/node_modules/.bin/marked
  95. +2 −0 tools/doc/node_modules/marked/.npmignore
  96. +19 −0 tools/doc/node_modules/marked/LICENSE
  97. +9 −0 tools/doc/node_modules/marked/Makefile
  98. +135 −0 tools/doc/node_modules/marked/README.md
  99. +115 −0 tools/doc/node_modules/marked/bin/marked
  100. +1 −0 tools/doc/node_modules/marked/index.js
  101. +662 −0 tools/doc/node_modules/marked/lib/marked.js
  102. +39 −0 tools/doc/node_modules/marked/man/marked.1
  103. +15 −0 tools/doc/node_modules/marked/package.json
  104. +15 −0 tools/doc/package.json
  105. +0 −150 tools/doctool/doctool.js
  106. +0 −1,448 tools/doctool/markdown.js
@@ -78,12 +78,15 @@ test-npm-publish: all
out/Release/node: all

apidoc_sources = $(wildcard doc/api/*.markdown)
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html))
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \
$(addprefix out/,$(apidoc_sources:.markdown=.json))

apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos
apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos out/doc/images

apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

doc_images = $(addprefix out/,$(wildcard doc/images/* doc/*.jpg doc/*.png))

website_files = \
out/doc/index.html \
out/doc/v0.4_announcement.html \
@@ -92,35 +95,14 @@ website_files = \
out/doc/sh_javascript.min.js \
out/doc/sh_vim-dark.css \
out/doc/sh.css \
out/doc/logo.png \
out/doc/favicon.ico \
out/doc/pipe.css \
out/doc/about/index.html \
out/doc/close-downloads.png \
out/doc/community/index.html \
out/doc/community/not-invented-here.png \
out/doc/logos/index.html \
out/doc/microsoft-logo.png \
out/doc/ryan-speaker.jpg \
out/doc/download-logo.png \
out/doc/ebay-logo.png \
out/doc/footer-logo-alt.png \
out/doc/footer-logo.png \
out/doc/icons-interior.png \
out/doc/icons.png \
out/doc/home-icons.png \
out/doc/joyent-logo_orange_nodeorg-01.png \
out/doc/linkedin-logo.png \
out/doc/logo-light.png \
out/doc/mac_osx_nodejs_installer_logo.png \
out/doc/microsoft-logo.png \
out/doc/platform-icons.png \
out/doc/sponsored.png \
out/doc/twitter-bird.png \
out/doc/community-icons.png \
out/doc/yahoo-logo.png

doc docs: out/Release/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs)
$(doc_images)

doc: node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs) tools/doc/

$(apidoc_dirs):
mkdir -p $@
@@ -129,10 +111,13 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
cp $< $@

out/doc/%: doc/%
cp $< $@
cp -r $< $@

out/doc/api/%.json: doc/api/%.markdown
out/Release/node tools/doc/generate.js --format=json $< > $@

out/doc/api/%.html: doc/api/%.markdown out/Release/node $(apidoc_dirs) $(apiassets) tools/doctool/doctool.js
out/Release/node tools/doctool/doctool.js doc/template.html $< > $@
out/doc/api/%.html: doc/api/%.markdown
out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@

out/doc/%:

@@ -197,7 +182,7 @@ $(TARBALL): out/doc
cp doc/node.1 $(TARNAME)/doc/node.1
cp -r out/doc/api $(TARNAME)/doc/api
rm -rf $(TARNAME)/deps/v8/test # too big
rm -rf $(TARNAME)/doc/logos/*.{png,eps} # too big
rm -rf $(TARNAME)/doc/images # too big
tar -cf $(TARNAME).tar $(TARNAME)
rm -rf $(TARNAME)
gzip -f -9 $(TARNAME).tar
@@ -21,7 +21,7 @@
<body class="alt int" id="about">
<div id="intro" class="interior">
<a href="/" title="Go back to the home page">
<img id="logo" src="../logo-light.png" alt="node.js">
<img id="logo" src="http://nodejs.org/images/logo-light.png" alt="node.js">
</a>
</div>
<div id="content" class="clearfix">
@@ -102,7 +102,7 @@ <h1>Node's goal is to provide an easy way to build scalable
<p>But what about multiple-processor concurrency? Aren't
threads necessary to scale programs to multi-core computers?
You can start new processes via <code><a
href="http://nodejs.org/docs/latest/api/child_processes.html#child_process.fork">child_process.fork()</a></code>
href="http://nodejs.org/docs/latest/api/child_process.html#child_process.fork">child_process.fork()</a></code>
these other processes will be scheduled in parallel. For load
balancing incoming connections across multiple processes use
<a href="http://nodejs.org/docs/latest/api/cluster.html">the
@@ -1,5 +1,4 @@
## Table of Contents

* [About these Docs](documentation.html)
* [Synopsis](synopsis.html)
* [Globals](globals.html)
* [STDIO](stdio.html)
@@ -9,8 +8,8 @@
* [Process](process.html)
* [Utilities](util.html)
* [Events](events.html)
* [Buffers](buffers.html)
* [Streams](streams.html)
* [Buffer](buffer.html)
* [Stream](stream.html)
* [Crypto](crypto.html)
* [TLS/SSL](tls.html)
* [String Decoder](string_decoder.html)
@@ -26,7 +25,7 @@
* [Readline](readline.html)
* [REPL](repl.html)
* [VM](vm.html)
* [Child Processes](child_processes.html)
* [Child Processes](child_process.html)
* [Assertion Testing](assert.html)
* [TTY](tty.html)
* [ZLIB](zlib.html)
@@ -35,4 +34,3 @@
* [Cluster](cluster.html)
* Appendixes
* [Appendix 1: Recommended Third-party Modules](appendix_1.html)
* [Appendix 2: Deprecated API's](appendix_2.html)
@@ -1,4 +1,4 @@
## Addons
# Addons

Addons are dynamically linked shared objects. They can provide glue to C and
C++ libraries. The API (at the moment) is rather complex, involving
@@ -24,7 +24,7 @@ compiling your module, you don't need to worry about linking to any of these
libraries.


### Hello world
## Hello world

To get started let's make a small Addon which is the C++ equivalent of
the following Javascript code:
@@ -129,7 +129,7 @@ In cases where there is more than one `.cc` file, simply add the file name to th
obj.source = ['addon.cc', 'myexample.cc']


#### Function arguments
### Function arguments

The following pattern illustrates how to read arguments from JavaScript
function calls and return a result. This is the main and only needed source
@@ -172,7 +172,7 @@ You can test it with the following JavaScript snippet:
console.log( 'This should be eight:', addon.add(3,5) );


#### Callbacks
### Callbacks

You can pass JavaScript functions to a C++ function and execute them from
there. Here's `addon.cc`:
@@ -209,7 +209,7 @@ To test it run the following JavaScript snippet:
});


#### Object factory
### Object factory

You can create and return new objects from within a C++ function with this
`addon.cc` pattern, which returns an object with property `msg` that echoes
@@ -245,7 +245,7 @@ To test it in JavaScript:
console.log(obj1.msg+' '+obj2.msg); // 'hello world'


#### Function factory
### Function factory

This pattern illustrates how to create and return a JavaScript function that
wraps a C++ function:
@@ -286,7 +286,7 @@ To test:
console.log(fn()); // 'hello world'


#### Wrapping C++ objects
### Wrapping C++ objects

Here we will create a wrapper for a C++ object/class `MyObject` that can be
instantiated in JavaScript through the `new` operator. First prepare the main
@@ -381,7 +381,7 @@ Test it with:
console.log( obj.plusOne() ); // 13


#### Factory of wrapped objects
### Factory of wrapped objects

This is useful when you want to be able to create native objects without
explicitly instantiating them with the `new` operator in JavaScript, e.g.
@@ -507,7 +507,7 @@ Test it with:
console.log( obj2.plusOne() ); // 23


#### Passing wrapped objects around
### Passing wrapped objects around

In addition to wrapping and returning C++ objects, you can pass them around
by unwrapping them with Node's `node::ObjectWrap::Unwrap` helper function.
@@ -1,16 +1,15 @@
@include documentation
@include synopsis
@include globals
@include stdio
@include timers
@include modules
@include addons
@include process
@include constants
@include util
@include freelist
@include events
@include buffers
@include streams
@include buffer
@include stream
@include crypto
@include tls
@include string_decoder
@@ -26,14 +25,11 @@
@include readline
@include repl
@include vm
@include child_processes
@include child_process
@include assert
@include tty
@include zlib
@include os
@include debugger
@include cluster

# Appendixes
@include appendix_1
@include appendix_2
@@ -1,4 +1,4 @@
## Appendix 1 - Third Party Modules
# Appendix 1 - Third Party Modules

There are many third party modules for Node. At the time of writing, August
2010, the master repository of modules is
No changes.
@@ -1,41 +1,41 @@
## Assert
# Assert

This module is used for writing unit tests for your applications, you can
access it with `require('assert')`.

### assert.fail(actual, expected, message, operator)
## assert.fail(actual, expected, message, operator)

Throws an exception that displays the values for `actual` and `expected` separated by the provided operator.

### assert(value, message), assert.ok(value, [message])
## assert(value, message), assert.ok(value, [message])

Tests if value is a `true` value, it is equivalent to `assert.equal(true, value, message);`

### assert.equal(actual, expected, [message])
## assert.equal(actual, expected, [message])

Tests shallow, coercive equality with the equal comparison operator ( `==` ).

### assert.notEqual(actual, expected, [message])
## assert.notEqual(actual, expected, [message])

Tests shallow, coercive non-equality with the not equal comparison operator ( `!=` ).

### assert.deepEqual(actual, expected, [message])
## assert.deepEqual(actual, expected, [message])

Tests for deep equality.

### assert.notDeepEqual(actual, expected, [message])
## assert.notDeepEqual(actual, expected, [message])

Tests for any deep inequality.

### assert.strictEqual(actual, expected, [message])
## assert.strictEqual(actual, expected, [message])

Tests strict equality, as determined by the strict equality operator ( `===` )

### assert.notStrictEqual(actual, expected, [message])
## assert.notStrictEqual(actual, expected, [message])

Tests strict non-equality, as determined by the strict not equal operator ( `!==` )

### assert.throws(block, [error], [message])
## assert.throws(block, [error], [message])

Expects `block` to throw an error. `error` can be constructor, regexp or
validation function.
@@ -72,11 +72,11 @@ Custom error validation:
"unexpected error"
);

### assert.doesNotThrow(block, [error], [message])
## assert.doesNotThrow(block, [error], [message])

Expects `block` not to throw an error, see assert.throws for details.

### assert.ifError(value)
## assert.ifError(value)

Tests if value is not a false value, throws if it is a true value. Useful when
testing the first argument, `error` in callbacks.

0 comments on commit a63ce6e

Please sign in to comment.
You can’t perform that action at this time.