mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
c1f23c5788
Previously various reads of files in `node_modules` would error on invalid UTF-8. These were cases involving: - reading package.json from Rust - reading package.json from JS - reading CommonJS files from JS - reading CommonJS files from Rust (for ESM translation) - reading ESM files from Rust
10 lines
290 B
JavaScript
10 lines
290 B
JavaScript
import { createRequire } from "node:module";
|
|
|
|
// Import this so that deno_graph knows to download this file.
|
|
if (false) import("npm:@denotest/lossy-utf8-script@1.0.0");
|
|
|
|
const require = createRequire(import.meta.url);
|
|
|
|
const mod = require("@denotest/lossy-utf8-script");
|
|
|
|
console.log(mod);
|