diff --git a/.eslintrc.js b/.eslintrc.js index da17fd47acd4b9..c7c7cc56051b1c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -340,5 +340,9 @@ module.exports = { Headers: 'readable', Request: 'readable', Response: 'readable', + crypto: 'readable', + Crypto: 'readable', + CryptoKey: 'readable', + SubtleCrypto: 'readable', }, }; diff --git a/doc/api/cli.md b/doc/api/cli.md index 10500f130a6b28..a551a3fff9cec6 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -288,6 +288,14 @@ added: v17.5.0 Enable experimental support for the [Fetch API][]. +### `--experimental-global-webcrypto` + + + +Expose the [Web Crypto API][] on the global scope. + ### `--experimental-import-meta-resolve` + ```cjs let crypto; try { diff --git a/doc/api/globals.md b/doc/api/globals.md index 1fa6801dda66c9..f4ea4fb474724f 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -307,6 +307,43 @@ added: v0.1.100 Used to print to stdout and stderr. See the [`console`][] section. +## `Crypto` + + + +> Stability: 1 - Experimental. Enable this API with the +> [`--experimental-global-webcrypto`][] CLI flag. + +A browser-compatible implementation of {Crypto}. This global is available +only if the Node.js binary was compiled with including support for the +`crypto` module. + +## `crypto` + + + +> Stability: 1 - Experimental. Enable this API with the +> [`--experimental-global-webcrypto`][] CLI flag. + +A browser-compatible implementation of the [Web Crypto API][]. + +## `CryptoKey` + + + +> Stability: 1 - Experimental. Enable this API with the +> [`--experimental-global-webcrypto`][] CLI flag. + +A browser-compatible implementation of {CryptoKey}. This global is available +only if the Node.js binary was compiled with including support for the +`crypto` module. + ## `Event` + +> Stability: 1 - Experimental. Enable this API with the +> [`--experimental-global-webcrypto`][] CLI flag. + +A browser-compatible implementation of {SubtleCrypto}. This global is available +only if the Node.js binary was compiled with including support for the +`crypto` module. + ## `DOMException`