From 931eebffc9bc1e15b84ff0b398bc74198d5206d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Tue, 30 Apr 2019 14:16:16 +0200 Subject: [PATCH 1/3] Add API parity tables Since the Node.js version implemented by this module differs for each API, a table might be helpful to inform users what APIs they can use (and to keep track of what is still to be done). --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index eb63058..9b7bdac 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,47 @@ To use `util.promisify` and `util.callbackify`, Promises must already be availab See the [Node.js util docs][util]. `util` currently supports the Node 8 LTS API. However, some of the methods are outdated. The `inspect` and `format` methods included in this module are a lot more simple and barebones than the ones in Node.js. +The below table lists the parity of each API with the Node.js version. At the time of writing, the most recent Node.js release is 12.1.0. Any entries with that version are considered up to date; the others may be missing features or bugfixes. See the "History" sections for each API in the [Node.js util docs][util] to learn about the changes that were not yet ported to this module. + +> A version marked "<1.2.3" means that changes introduced in Node.js 1.2.3 were _not_ yet ported to this module. + +| API | Matching Version | +|-|-| +| `callbackify` | 12.1.0 | +| `debuglog` | 0.11.3 | +| `format` | <8.4.0 | +| `formatWithOptions` | missing | +| `getSystemErrorName` | missing | +| `inherits` | 12.1.0 | +| `inspect` | <6.0.0 | +| `isDeepStrictEqual` | missing | +| `promisify` | 12.1.0 | +| `TextDecoder` | missing | +| `TextEncoder` | missing | +| `types` | missing | + +`util` also contains deprecated Node.js APIs. `_extend` and `log` were deprecated in v6, while the `is*` family of functions was deprecated in v4. All these APIs are up to date: + +| Deprecated API | Matching Version | +|-|-| +| `_extend` | 6.0.0 | +| `isArray` | 4.0.0 | +| `isBoolean` | 4.0.0 | +| `isBuffer` | 4.0.0 | +| `isDate` | 4.0.0 | +| `isError` | 4.0.0 | +| `isFunction` | 4.0.0 | +| `isNull` | 4.0.0 | +| `isNullOrUndefined` | 4.0.0 | +| `isNumber` | 4.0.0 | +| `isObject` | 4.0.0 | +| `isPrimitive` | 4.0.0 | +| `isRegExp` | 4.0.0 | +| `isString` | 4.0.0 | +| `isSymbol` | 4.0.0 | +| `isUndefined` | 4.0.0 | +| `log` | 6.0.0 | + ## Contributing PRs are very welcome! The main way to contribute to `util` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js. From fdd626dada3aebcf5231083845c761dc53eb13b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Wed, 1 May 2019 11:02:13 +0200 Subject: [PATCH 2/3] util.types --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b7bdac..7891d61 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ The below table lists the parity of each API with the Node.js version. At the ti | `promisify` | 12.1.0 | | `TextDecoder` | missing | | `TextEncoder` | missing | -| `types` | missing | +| `types` | 12.1.0 | `util` also contains deprecated Node.js APIs. `_extend` and `log` were deprecated in v6, while the `is*` family of functions was deprecated in v4. All these APIs are up to date: From 277f32d150917aa7203b3c2cc3b5f06e2d5759a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Fri, 17 May 2019 16:02:45 +0200 Subject: [PATCH 3/3] Set debuglog to 10.0.0 in parity table strictly this commit is missing: https://github.com/nodejs/node/commit/1b9c40cc71446bd996198c435449a5d213f59a63 inconsequential really, but we shouldn't lie! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7891d61..1bc8720 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ The below table lists the parity of each API with the Node.js version. At the ti | API | Matching Version | |-|-| | `callbackify` | 12.1.0 | -| `debuglog` | 0.11.3 | +| `debuglog` | 10.0.0 | | `format` | <8.4.0 | | `formatWithOptions` | missing | | `getSystemErrorName` | missing |