diff --git a/.eslintrc.js b/.eslintrc.js index 7574e1b4b6c7f7..28a31d050a6de1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -329,5 +329,7 @@ module.exports = { TextDecoder: 'readable', queueMicrotask: 'readable', globalThis: 'readable', + btoa: 'readable', + atob: 'readable', }, }; diff --git a/doc/api/buffer.md b/doc/api/buffer.md index f31b8b298b02eb..60c073287baee9 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -3282,6 +3282,8 @@ accessed using `require('buffer')`. added: REPLACEME --> +> Stability: 3 - Legacy. Use `Buffer.from(data, 'base64')` instead. + * `data` {any} The Base64-encoded input string. Decodes a string of Base64-encoded data into bytes, and encodes those bytes @@ -3301,6 +3303,8 @@ and binary data should be performed using `Buffer.from(str, 'base64')` and added: REPLACEME --> +> Stability: 3 - Legacy. Use `buf.toString('base64')` instead. + * `data` {any} An ASCII (Latin1) string. Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes diff --git a/doc/api/globals.md b/doc/api/globals.md index 6f8c9d3b398c11..831ef06bec6094 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -146,6 +146,24 @@ This variable may appear to be global but is not. See [`__dirname`][]. This variable may appear to be global but is not. See [`__filename`][]. +## `atob(data)` + + +> Stability: 3 - Legacy. Use `Buffer.from(data, 'base64')` instead. + +Global alias for [`buffer.atob()`][]. + +## `btoa(data)` + + +> Stability: 3 - Legacy. Use `buf.toString('base64')` instead. + +Global alias for [`buffer.btoa()`][]. + ## `clearImmediate(immediateObject)`