mirror of
https://github.com/denoland/deno.git
synced 2024-11-27 16:10:57 -05:00
13 lines
333 B
TypeScript
13 lines
333 B
TypeScript
|
import { createRequire } from "node:module";
|
||
|
const require = createRequire(import.meta.url);
|
||
|
|
||
|
console.log(getParentUrl());
|
||
|
console.log(require.resolve("@denotest/esm-basic", {
|
||
|
paths: [getParentUrl()],
|
||
|
}));
|
||
|
|
||
|
function getParentUrl() {
|
||
|
const fileUrl = import.meta.url;
|
||
|
return fileUrl.substring(0, fileUrl.lastIndexOf("/") + 1);
|
||
|
}
|