Download packages/core/src/util/module.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 255 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/util/module.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/core/src/util/module.ts
-
curl -L -o module.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/util/module.ts
255 Bytes
| 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 {} | |
| } | |
| } | |