summaryrefslogtreecommitdiff
path: root/tests/specs/run/import_common_js/node_modules/foo/index.mjs
blob: 7a11d39ae602664c4db27e8e1a91d4f7d1adaf03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import process from "node:process";
import path from "node:path";
import url from "node:url";

export default async function () {
    console.log("hello from foo node module");

    const cjsFileToImport = path.join(process.cwd(), "index.cjs");

    const cjsModule = await import(url.pathToFileURL(cjsFileToImport));

    console.log("cjsModule.cwd()", cjsModule.cwd());
}