node/test/fixtures/es-module-loaders/loader-load-receiving-modified-context.mjs
Jacob Smith 4667b07cd2
esm: move hook execution to separate thread
PR-URL: https://github.com/nodejs/node/pull/44710
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Co-authored-by: Michaël Zasso <targos@protonmail.com>
2023-04-13 09:35:17 +02:00

7 lines
203 B
JavaScript

import { writeSync } from 'node:fs';
export async function load(url, context, next) {
writeSync(1, context.foo + '\n'); // Expose actual value the hook was called with
return next(url, context);
}