Spaces:
Sleeping
Sleeping
Download apps/api/src/natives.ts from s-eto-hub/firecrawl-api: direct link, hf CLI and curl.
- Browser
- Download file 655 Bytes
-
https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/natives.ts
- Command line
-
hf download hf://spaces/s-eto-hub/firecrawl-api/apps/api/src/natives.ts
-
curl -L -o natives.ts https://huggingface.co/spaces/s-eto-hub/firecrawl-api/resolve/main/apps/api/src/natives.ts
655 Bytes
| import { platform } from "os"; | |
| import { join } from "path"; | |
| const currentPlatform = platform(); | |
| const isWindows = currentPlatform === "win32"; | |
| const EXTENSIONS = { | |
| win32: ".dll", | |
| darwin: ".dylib", | |
| default: ".so", | |
| } as const; | |
| function createNativePath(subPath: string, filename: string): string { | |
| const extension = | |
| EXTENSIONS[currentPlatform as keyof typeof EXTENSIONS] ?? | |
| EXTENSIONS.default; | |
| const fullFilename = `${isWindows ? "" : "lib"}${filename}${extension}`; | |
| return join(process.cwd(), "sharedLibs", subPath, fullFilename); | |
| } | |
| export const HTML_TO_MARKDOWN_PATH = createNativePath( | |
| "go-html-to-md", | |
| "html-to-markdown", | |
| ); | |