From 50977f777f5863c84bd4bda94b07134723d6ffc4 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Wed, 27 Jan 2016 23:06:28 -0500 Subject: [PATCH 1/4] doc: add added for assert.markdown Introduces the YAML metadata concept and the "Added" property to the assert documentation. --- doc/api/assert.markdown | 48 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/doc/api/assert.markdown b/doc/api/assert.markdown index 44dafc2fc114b0..c742352f828867 100644 --- a/doc/api/assert.markdown +++ b/doc/api/assert.markdown @@ -1,4 +1,7 @@ # Assert + Stability: 3 - Locked @@ -12,7 +15,14 @@ The API for the `assert` module is [Locked][]. This means that there will be no additions or changes to any of the methods implemented and exposed by the module. -## assert(value[, message]), assert.ok(value[, message]) +## assert(value[, message]) + +## assert.ok(value[, message]) + Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. @@ -44,6 +54,9 @@ assert.ok(false, 'it\'s false'); ``` ## assert.deepEqual(actual, expected[, message]) + Tests for deep equality between the `actual` and `expected` parameters. Primitive values are compared with the equal comparison operator ( `==` ). @@ -102,6 +115,9 @@ property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error message is assigned. ## assert.deepStrictEqual(actual, expected[, message]) + Generally identical to `assert.deepEqual` with the exception that primitive values are compared using the strict equality operator ( `===` ). @@ -122,6 +138,9 @@ property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error message is assigned. ## assert.doesNotThrow(block[, error][, message]) + Asserts that the function `block` does not throw an error. See [`assert.throws()`][] for more details. @@ -174,6 +193,9 @@ assert.doesNotThrow( ``` ## assert.equal(actual, expected[, message]) + Tests shallow, coercive equality between the `actual` and `expected` parameters using the equal comparison operator ( `==` ). @@ -197,6 +219,9 @@ property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error message is assigned. ## assert.fail(actual, expected, message, operator) + Throws an `AssertionError`. If `message` is falsy, the error message is set as the values of `actual` and `expected` separated by the provided `operator`. @@ -213,6 +238,9 @@ assert.fail(1, 2, 'whoops', '>'); ``` ## assert.ifError(value) + Throws `value` if `value` is truthy. This is useful when testing the `error` argument in callbacks. @@ -227,6 +255,9 @@ assert.ifError(new Error()); // Throws Error ``` ## assert.notDeepEqual(actual, expected[, message]) + Tests for any deep inequality. Opposite of [`assert.deepEqual`][]. @@ -268,6 +299,9 @@ property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error message is assigned. ## assert.notDeepStrictEqual(actual, expected[, message]) + Tests for deep strict inequality. Opposite of [`assert.deepStrictEqual`][]. @@ -286,6 +320,9 @@ with a `message` property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error message is assigned. ## assert.notEqual(actual, expected[, message]) + Tests shallow, coercive inequality with the not equal comparison operator ( `!=` ). @@ -308,6 +345,9 @@ property set equal to the value of the `message` parameter. If the `message` parameter is undefined, a default error message is assigned. ## assert.notStrictEqual(actual, expected[, message]) + Tests strict inequality as determined by the strict not equal operator ( `!==` ). @@ -330,6 +370,9 @@ If the values are strictly equal, an `AssertionError` is thrown with a `message` parameter is undefined, a default error message is assigned. ## assert.strictEqual(actual, expected[, message]) + Tests strict equality as determined by the strict equality operator ( `===` ). @@ -351,6 +394,9 @@ If the values are not strictly equal, an `AssertionError` is thrown with a `message` parameter is undefined, a default error message is assigned. ## assert.throws(block[, error][, message]) + Expects the function `block` to throw an error. If specified, `error` can be a constructor, [`RegExp`][], or validation function. From 8b66af4768235feaca910cf5d83eb50c3a47908d Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Thu, 28 Jan 2016 11:13:24 -0500 Subject: [PATCH 2/4] doc: add added for timers.markdown Introduces the YAML metadata concept and the "Added" property to the timers documentation. --- doc/api/timers.markdown | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown index 7e4efb47c12929..be867c03851555 100644 --- a/doc/api/timers.markdown +++ b/doc/api/timers.markdown @@ -1,4 +1,7 @@ # Timers + Stability: 3 - Locked @@ -6,18 +9,30 @@ All of the timer functions are globals. You do not need to `require()` this module in order to use them. ## clearImmediate(immediateObject) + Stops an immediate from triggering. ## clearInterval(intervalObject) + Stops an interval from triggering. ## clearTimeout(timeoutObject) + Prevents a timeout from triggering. ## ref() + If you had previously `unref()`d a timer you can call `ref()` to explicitly request the timer hold the program open. If the timer is already `ref`d calling @@ -26,6 +41,9 @@ request the timer hold the program open. If the timer is already `ref`d calling Returns the timer. ## setImmediate(callback[, arg][, ...]) + To schedule the "immediate" execution of `callback` after I/O events callbacks and before [`setTimeout`][] and [`setInterval`][]. Returns an @@ -40,6 +58,9 @@ until the next event loop iteration. If `callback` is not a function `setImmediate()` will throw immediately. ## setInterval(callback, delay[, arg][, ...]) + To schedule the repeated execution of `callback` every `delay` milliseconds. Returns a `intervalObject` for possible use with `clearInterval()`. Optionally @@ -52,6 +73,9 @@ milliseconds (approximately 25 days) or less than 1, Node.js will use 1 as the If `callback` is not a function `setInterval()` will throw immediately. ## setTimeout(callback, delay[, arg][, ...]) + To schedule execution of a one-time `callback` after `delay` milliseconds. Returns a `timeoutObject` for possible use with `clearTimeout()`. Optionally you @@ -69,6 +93,9 @@ immediately, as if the `delay` was set to 1. If `callback` is not a function `setTimeout()` will throw immediately. ## unref() + The opaque value returned by [`setTimeout`][] and [`setInterval`][] also has the method `timer.unref()` which will allow you to create a timer that is active but From cdb1ac8a7adeedaeed540f9431a3f338248692cd Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Fri, 29 Jan 2016 20:41:58 -0500 Subject: [PATCH 3/4] doc: add added for repl.markdown Introduces the YAML metadata concept and "Added" property to the repl documentation. --- doc/api/repl.markdown | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown index 86ece2c27ee0af..9ac6736844ffa7 100644 --- a/doc/api/repl.markdown +++ b/doc/api/repl.markdown @@ -153,10 +153,16 @@ and try to print `obj` in REPL, it will invoke the custom `inspect()` function: ``` ## Class: REPLServer + This inherits from [Readline Interface][] with the following events: ### Event: 'exit' + `function () {}` @@ -175,6 +181,9 @@ replServer.on('exit', () => { ### Event: 'reset' + `function (context) {}` @@ -197,6 +206,9 @@ replServer.on('reset', (context) => { ``` ### replServer.defineCommand(keyword, cmd) + * `keyword` {String} * `cmd` {Object|Function} @@ -235,6 +247,9 @@ Hello, Node.js User! ``` ### replServer.displayPrompt([preserveCursor]) + * `preserveCursor` {Boolean} @@ -244,6 +259,9 @@ used primarily with `defineCommand`. It's also used internally to render each prompt line. ## repl.start(options) + Returns and starts a `REPLServer` instance, that inherits from [Readline Interface][]. Accepts an "options" Object that takes From 6f9936b4851da189a4b94d0ef06eb22f4b95e863 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Tue, 2 Feb 2016 11:09:48 -0500 Subject: [PATCH 4/4] doc: add added for zlib.markdown Introduces the YAML metadata concept and "Added" property to the zlib documentation. --- doc/api/zlib.markdown | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index 60cd7145abbbfb..95cc070b7b982d 100644 --- a/doc/api/zlib.markdown +++ b/doc/api/zlib.markdown @@ -1,4 +1,7 @@ # Zlib + Stability: 2 - Stable @@ -242,30 +245,51 @@ See the description of `deflateInit2` and `inflateInit2` at for more information on these. ## Class: zlib.Deflate + Compress data using deflate. ## Class: zlib.DeflateRaw + Compress data using deflate, and do not append a zlib header. ## Class: zlib.Gunzip + Decompress a gzip stream. ## Class: zlib.Gzip + Compress data using gzip. ## Class: zlib.Inflate + Decompress a deflate stream. ## Class: zlib.InflateRaw + Decompress a raw deflate stream. ## Class: zlib.Unzip + Decompress either a Gzip- or Deflate-compressed stream by auto-detecting the header. @@ -276,6 +300,9 @@ Not exported by the `zlib` module. It is documented here because it is the base class of the compressor/decompressor classes. ### zlib.flush([kind], callback) + `kind` defaults to `zlib.Z_FULL_FLUSH`. @@ -293,30 +320,51 @@ Reset the compressor/decompressor to factory defaults. Only applicable to the inflate and deflate algorithms. ## zlib.createDeflate([options]) + Returns a new [Deflate][] object with an [options][]. ## zlib.createDeflateRaw([options]) + Returns a new [DeflateRaw][] object with an [options][]. ## zlib.createGunzip([options]) + Returns a new [Gunzip][] object with an [options][]. ## zlib.createGzip([options]) + Returns a new [Gzip][] object with an [options][]. ## zlib.createInflate([options]) + Returns a new [Inflate][] object with an [options][]. ## zlib.createInflateRaw([options]) + Returns a new [InflateRaw][] object with an [options][]. ## zlib.createUnzip([options]) + Returns a new [Unzip][] object with an [options][].