File size: 255 Bytes
3e05655
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { createRequire } from "node:module"
import path from "node:path"

export namespace Module {
  export function resolve(id: string, dir: string) {
    try {
      return createRequire(path.join(dir, "package.json")).resolve(id)
    } catch {}
  }
}