pathToFileURLString

tcmts.loader.pathToFileURLString · #erw6th7f · term · runs on the server

uses node:path

import path from "node:path";

export function pathToFileURLString(p: string): string {
  return "file://" + p.split(path.sep).map(encodeURIComponent).join("/");
}

used by