Function fileURLToPath

  • Convert a URL to a filesystem path.

    Returns

    A filesystem path.

    Throws

    If the URL is not a URL.

    Example

    const path = Bun.fileURLToPath(new URL("file:///foo/bar.txt"));
    console.log(path); // "/foo/bar.txt"

    Parameters

    • url: URL

      The URL to convert.

    Returns string

  • Convert a URL to a filesystem path.

    Returns

    A filesystem path.

    Throws

    If the URL is not a URL.

    Example

    const path = Bun.fileURLToPath(new URL("file:///foo/bar.txt"));
    console.log(path); // "/foo/bar.txt"

    Parameters

    • url: URL

      The URL to convert.

    Returns string

Generated using TypeDoc