mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
2e1e74e9f8
Enable code example using both modern ESM syntax and legacy CJS syntax. It adds a toggle on the web interface to let users switch from one JavaScript flavor to the other. PR-URL: https://github.com/nodejs/node/pull/37162 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
145 B
145 B
Usage and Example
CJS snippet is first, it should be the one displayed by default.
require('path');
import 'node:url';