Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

json doc generator now generates _index.json as it creates files. #3696

Closed
wants to merge 44 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5152bf5
Added output file option to gentest.
iapain Jul 12, 2012
24b1c2a
Now json doc generator writes index.json file.\n Renamed url.html and…
iapain Oct 3, 2012
64c39ba
Fixed some typos. `writeOutputToFile` does not raise and exception an…
iapain Mar 14, 2013
a5544bd
Merge branch 'master' into newdoc
iapain Mar 14, 2013
92598e8
node: Now working on v0.13.0
tjfontaine Aug 7, 2014
912b5e0
Merge remote-tracking branch 'upstream/v0.12'
tjfontaine Aug 7, 2014
7c04197
Merge remote-tracking branch 'upstream/v0.12'
tjfontaine Sep 17, 2014
25702ab
net: remove use of arguments in Server constructor
cjihrig Sep 24, 2014
cfcb1de
stream: remove duplicated expression
yorkie Oct 2, 2014
885f721
Merge remote-tracking branch 'upstream/v0.12'
tjfontaine Jan 16, 2015
31d4847
README: fix link text
Jan 5, 2015
d8baf8a
Merge remote-tracking branch 'upstream/v0.12'
Jan 30, 2015
3917596
Merge remote-tracking branch 'upstream/v0.12'
Feb 17, 2015
b3fcc24
src: update AUTHORS after merge of v0.12 in master
Feb 17, 2015
4c31cda
fs: properly handle fd passed to truncate()
bjouhier Feb 7, 2015
e42c4a3
dgram: implicit binds should be exclusive
sam-github Jan 10, 2015
4b69dcb
Merge remote-tracking branch 'upstream/v0.12'
Feb 28, 2015
ef43443
src: enable strict mode in all builtin modules
Feb 28, 2015
a995a6a
Merge remote-tracking branch 'upstream/v0.12'
Mar 5, 2015
8c38b07
net: use cached peername to resolve remote fields
Mar 10, 2015
2b64132
doc: fix '\\' typos on Windows
stcruy Mar 15, 2015
ae58fc4
Merge remote-tracking branch 'upstream/v0.12'
Mar 16, 2015
9b534e2
url: resolve urls with . and ..
amir-s Jan 11, 2015
9010dd2
Merge remote-tracking branch 'upstream/v0.12'
Mar 24, 2015
94beb29
Merge remote-tracking branch 'upstream/v0.12'
Apr 1, 2015
72357e5
tls: more secure defaults
jasnell Mar 30, 2015
1bf1546
tls: command-line switch and envar cipher-list override
jasnell Apr 2, 2015
3f58ce6
tls: make --enable-legacy-cipher-list less verbose
jasnell Apr 6, 2015
3705736
tls: pass in isolate with define string constant + style nits
jasnell Apr 6, 2015
4d9c81b
test: fixing a few nits in the test
jasnell Apr 8, 2015
0df5e1c
Merge remote-tracking branch 'upstream/v0.12'
May 14, 2015
d13d7f7
src: fix ifdef comment
mrkmg May 9, 2015
6f9b178
doc: improve http.request example
jasnell May 19, 2015
016ff77
_http_server.js: fix typo in comment
devonharvey Jun 3, 2015
4d3514f
tls.createSecurePair(): fix documentation typo
socketpair May 16, 2015
f9d783a
Merge remote-tracking branch 'upstream/v0.12'
Jun 4, 2015
6671efa
Fix improper sample code in http.markdown
hidekiy Jun 2, 2015
8c262dd
fixed a typo: fs.ReadStream(filename) -> fs.createReadStream(filename)
duzun May 28, 2015
8140d10
docs: Fix grammar in Transform API text
chrisneave May 23, 2015
63b3f9e
Added output file option to gentest.
iapain Jul 12, 2012
ab03aec
Now json doc generator writes index.json file.\n Renamed url.html and…
iapain Oct 3, 2012
428bea0
Fixed some typos. `writeOutputToFile` does not raise and exception an…
iapain Mar 14, 2013
02cfad5
Callback is properly propagated thanks to @chrisdickinson
iapain Jun 18, 2015
27b3909
resolved conflicts
iapain Jun 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -203,6 +203,7 @@ Feross Aboukhadijeh
Florin-Cristian Gavrila
Forrest L Norvell
Francois Marier
Frank Cash
Fred K. Schott
Frederico Silva
Friedemann Altrock
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -206,7 +206,7 @@ out/doc/%: doc/%
cp -r $< $@

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

out/doc/api/%.html: doc/api/%.markdown node
NODE_DOC_VERSION=$(NODE_DOC_VERSION) out/Release/node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -194,7 +194,7 @@ Resources for Newcomers
- [searching the npm registry](http://npmjs.org/)
- [list of companies and projects using node](https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node)
- [node.js mailing list](http://groups.google.com/group/nodejs)
- irc chatroom, [#node.js on freenode.net](http://webchat.freenode.net?channels=node.js&uio=d4)
- [irc chatroom, #node.js on freenode.net](http://webchat.freenode.net?channels=node.js&uio=d4)
- [community](https://github.com/joyent/node/wiki/Community)
- [contributing](https://github.com/joyent/node/wiki/Contributing)
- [big list of all the helpful wiki pages](https://github.com/joyent/node/wiki/_pages)
2 changes: 2 additions & 0 deletions deps/debugger-agent/lib/_debugger_agent.js
@@ -1,3 +1,5 @@
'use strict';

var assert = require('assert');
var net = require('net');
var util = require('util');
Expand Down
2 changes: 1 addition & 1 deletion doc/api/crypto.markdown
Expand Up @@ -101,7 +101,7 @@ Example: this program that takes the sha1 sum of a file

var shasum = crypto.createHash('sha1');

var s = fs.ReadStream(filename);
var s = fs.createReadStream(filename);
s.on('data', function(d) {
shasum.update(d);
});
Expand Down
15 changes: 14 additions & 1 deletion doc/api/http.markdown
Expand Up @@ -511,8 +511,13 @@ Example:
console.log('STATUS: ' + res.statusCode);
console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
var data = '';
res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
console.log('PARTIAL BODY: ' + chunk);
data += chunk;
});
res.on('end', function() {
console.log('COMPLETE BODY: ' + data);
});
});

Expand All @@ -524,6 +529,12 @@ Example:
req.write(postData);
req.end();

The `res` object handed off to the callback function passed into to
`http.request` is an instance of [http.IncomingMessage], which is an
instance of a Readable Stream. The content of a successful response will be
delivered using zero or more `data` events followed by a closing `end`
event.

Note that in the example `req.end()` was called. With `http.request()` one
must always call `req.end()` to signify that you're done with the request -
even if there is no data being written to the request body.
Expand Down Expand Up @@ -557,6 +568,8 @@ Example:

http.get("http://www.google.com/index.html", function(res) {
console.log("Got response: " + res.statusCode);
// consume response body
res.resume();
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
Expand Down
6 changes: 3 additions & 3 deletions doc/api/path.markdown
Expand Up @@ -200,7 +200,7 @@ An example on Windows:

process.env.PATH.split(path.delimiter)
// returns
['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\']
['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\nodejs\\']

## path.parse(pathString)

Expand All @@ -223,8 +223,8 @@ An example on Windows:
path.parse('C:\\path\\dir\\index.html')
// returns
{
root : "C:\",
dir : "C:\path\dir",
root : "C:\\",
dir : "C:\\path\\dir",
base : "index.html",
ext : ".html",
name : "index"
Expand Down
6 changes: 3 additions & 3 deletions doc/api/stream.markdown
Expand Up @@ -1175,9 +1175,9 @@ as a result of this chunk.

Call the callback function only when the current chunk is completely
consumed. Note that there may or may not be output as a result of any
particular input chunk. If you supply as the second argument to the
it will be passed to push method, in other words the following are
equivalent:
particular input chunk. If you supply a data chunk as the second argument
to the callback function it will be passed to push method, in other words
the following are equivalent:

```javascript
transform.prototype._transform = function (data, encoding, callback) {
Expand Down
127 changes: 100 additions & 27 deletions doc/api/tls.markdown
Expand Up @@ -25,8 +25,10 @@ To create a self-signed certificate with the CSR, do this:

Alternatively you can send the CSR to a Certificate Authority for signing.

(TODO: docs on creating a CA, for now interested users should just look at
`test/fixtures/keys/Makefile` in the Node source code)
For Perfect Forward Secrecy, it is required to generate Diffie-Hellman
parameters:

openssl dhparam -outform PEM -out dhparam.pem 2048

To create .pfx or .p12, do this:

Expand Down Expand Up @@ -134,6 +136,81 @@ the character "E" appended to the traditional abbreviations):
Ephemeral methods may have some performance drawbacks, because key generation
is expensive.

## Modifying the Default Cipher Suite

Node.js is built with a default suite of enabled and disabled ciphers.
Currently, the default cipher suite is:

ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:
DHE-RSA-AES256-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:
HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA

This default can be overridden entirely using the `--cipher-list` command line
switch or `NODE_CIPHER_LIST` environment variable. For instance:

node --cipher-list=ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384

Setting the environment variable would have the same effect:

NODE_CIPHER_LIST=ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384

CAUTION: The default cipher suite has been carefully selected to reflect current
security best practices and risk mitigation. Changing the default cipher suite
can have a significant impact on the security of an application. The
`--cipher-list` and `NODE_CIPHER_LIST` options should only be used if
absolutely necessary.

### Using Legacy Default Cipher Suite ###

It is possible for the built-in default cipher suite to change from one release
of Node.js to another. For instance, v0.10.38 uses a different default than
v0.12.2. Such changes can cause issues with applications written to assume
certain specific defaults. To help buffer applications against such changes,
the `--enable-legacy-cipher-list` command line switch or `NODE_LEGACY_CIPHER_LIST`
environment variable can be set to specify a specific preset default:

# Use the v0.10.38 defaults
node --enable-legacy-cipher-list=v0.10.38
// or
NODE_LEGACY_CIPHER_LIST=v0.10.38

# Use the v0.12.2 defaults
node --enable-legacy-cipher-list=v0.12.2
// or
NODE_LEGACY_CIPHER_LIST=v0.12.2

Currently, the values supported for the `enable-legacy-cipher-list` switch and
`NODE_LEGACY_CIPHER_LIST` environment variable include:

v0.10.38 - To enable the default cipher suite used in v0.10.38

ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH

v0.10.39 - To enable the default cipher suite used in v0.10.39

ECDHE-RSA-AES128-SHA256:AES128-GCM-SHA256:HIGH:!RC4:!MD5:!aNULL:!EDH

v0.12.2 - To enable the default cipher suite used in v0.12.2

ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:
HIGH:!MD5:!aNULL

v.0.12.3 - To enable the default cipher suite used in v0.12.3

ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:AES128-GCM-SHA256:HIGH:
!RC4:!MD5:!aNULL

These legacy cipher suites are also made available for use via the
`getLegacyCiphers()` method:

var tls = require('tls');
console.log(tls.getLegacyCiphers('v0.10.38'));

CAUTION: Changes to the default cipher suite are typically made in order to
strengthen the default security for applications running within Node.js.
Reverting back to the defaults used by older releases can weaken the security
of your applications. The legacy cipher suites should only be used if absolutely
necessary.

## tls.getCiphers()

Expand All @@ -144,6 +221,12 @@ Example:
var ciphers = tls.getCiphers();
console.log(ciphers); // ['AES128-SHA', 'AES256-SHA', ...]

## tls.getLegacyCiphers(version)

Returns the legacy default cipher suite for the specified Node.js release.

Example:
var cipher_suite = tls.getLegacyCiphers('v0.10.38');

## tls.createServer(options[, secureConnectionListener])

Expand All @@ -170,31 +253,20 @@ automatically set as a listener for the [secureConnection][] event. The
- `crl` : Either a string or list of strings of PEM encoded CRLs (Certificate
Revocation List)

- `ciphers`: A string describing the ciphers to use or exclude.

To mitigate [BEAST attacks] it is recommended that you use this option in
conjunction with the `honorCipherOrder` option described below to
prioritize the non-CBC cipher.

Defaults to
`ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL`.
Consult the [OpenSSL cipher list format documentation] for details
on the format.

`ECDHE-RSA-AES128-SHA256`, `DHE-RSA-AES128-SHA256` and
`AES128-GCM-SHA256` are TLS v1.2 ciphers and used when Node.js is
linked against OpenSSL 1.0.1 or newer, such as the bundled version
of OpenSSL. Note that it is still possible for a TLS v1.2 client
to negotiate a weaker cipher unless `honorCipherOrder` is enabled.
- `ciphers`: A string describing the ciphers to use or exclude, separated by
`:`. The default cipher suite is:

`RC4` is used as a fallback for clients that speak on older version of
the TLS protocol. `RC4` has in recent years come under suspicion and
should be considered compromised for anything that is truly sensitive.
It is speculated that state-level actors possess the ability to break it.
ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:
DHE-RSA-AES256-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:
HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA

**NOTE**: Previous revisions of this section suggested `AES256-SHA` as an
acceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore
susceptible to [BEAST attacks]. Do *not* use it.
The default cipher suite prefers ECDHE and DHE ciphers for Perfect Forward
secrecy, while offering *some* backward compatibility. Old clients which
rely on insecure and deprecated RC4 or DES-based ciphers (like Internet
Explorer 6) aren't able to complete the handshake with the default
configuration. If you absolutely must support these clients, the
[TLS recommendations] may offer a compatible cipher suite. For more details
on the format, see the [OpenSSL cipher list format documentation].

- `ecdhCurve`: A string describing a named curve to use for ECDH key agreement
or false to disable ECDH.
Expand All @@ -212,7 +284,7 @@ automatically set as a listener for the [secureConnection][] event. The
times out.

- `honorCipherOrder` : When choosing a cipher, use the server's preferences
instead of the client preferences.
instead of the client preferences. Default: `true`.

Although, this option is disabled by default, it is *recommended* that you
use this option in conjunction with the `ciphers` option to mitigate
Expand Down Expand Up @@ -512,7 +584,7 @@ encrypted data, and one reads/writes cleartext data.
Generally the encrypted one is piped to/from an incoming encrypted data stream,
and the cleartext one is used as a replacement for the initial encrypted stream.

- `credentials`: A secure context object from tls.createSecureContext( ... )
- `context`: A secure context object from tls.createSecureContext( ... )

- `isServer`: A boolean indicating whether this tls connection should be
opened as a server or a client.
Expand Down Expand Up @@ -868,5 +940,6 @@ The numeric representation of the local port.
[ECDHE]: https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman
[asn1.js]: http://npmjs.org/package/asn1.js
[OCSP request]: http://en.wikipedia.org/wiki/OCSP_stapling
[TLS recommendations]: https://wiki.mozilla.org/Security/Server_Side_TLS
[SSL_CTX_set_options]: https://www.openssl.org/docs/ssl/SSL_CTX_set_options.html
[CVE-2014-3566]: https://access.redhat.com/articles/1232123
2 changes: 2 additions & 0 deletions lib/_debugger.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var util = require('util'),
path = require('path'),
net = require('net'),
Expand Down
2 changes: 2 additions & 0 deletions lib/_http_agent.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var net = require('net');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
Expand Down
2 changes: 2 additions & 0 deletions lib/_http_client.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var util = require('util');
var net = require('net');
var url = require('url');
Expand Down
2 changes: 2 additions & 0 deletions lib/_http_common.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var FreeList = require('freelist').FreeList;
var HTTPParser = process.binding('http_parser').HTTPParser;

Expand Down
2 changes: 2 additions & 0 deletions lib/_http_incoming.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var util = require('util');
var Stream = require('stream');

Expand Down
2 changes: 2 additions & 0 deletions lib/_http_outgoing.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var assert = require('assert').ok;
var Stream = require('stream');
var timers = require('timers');
Expand Down
4 changes: 3 additions & 1 deletion lib/_http_server.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

var util = require('util');
var net = require('net');
var EventEmitter = require('events').EventEmitter;
Expand Down Expand Up @@ -448,7 +450,7 @@ function connectionListener(socket) {
}

// When we're finished writing the response, check if this is the last
// respose, if so destroy the socket.
// response, if so destroy the socket.
res.on('prefinish', resOnFinish);
function resOnFinish() {
// Usually the first incoming element should be our request. it may
Expand Down
2 changes: 2 additions & 0 deletions lib/_linklist.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

function init(list) {
list._idleNext = list;
list._idlePrev = list;
Expand Down
2 changes: 2 additions & 0 deletions lib/_stream_duplex.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
Expand Down
2 changes: 2 additions & 0 deletions lib/_stream_passthrough.js
Expand Up @@ -19,6 +19,8 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';

// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
Expand Down