Closed lmlsna closed 1 year ago
Why not just add import * as crypto from 'node:crypto'
to the top of the file? The script requires crypto
to work so I'm not sure why we would use a try
/catch
construct here.
Edit: Node.js's documentation recommends const { subtle } = globalThis.crypto;
Uses the builtin crypto module as long as crypto support is enabled (it is by default). The
package-lock.json
files in this repository reflects that crypto 1.0.1 is deprecated in favor of the built in module. This fails on node 18 without this change.