gradum-kit - v0.1.0
    Preparing search index...

    Function fetchSvg

    • Function

      fetchSvg

      Parameters

      • path: string

        The path or URL to fetch the SVG from.

      • OptionallogError: boolean = true

        Whether to also log failures to the console. The promise rejects either way.

      Returns Promise<SVGElement>

      The parsed SVG element. Rejects on an empty path, a failed request, or markup that does not parse.

      Fetch an SVG file and parse it into a live element, ready to be inserted into the document. Because the markup is parsed rather than placed in an <img>, the result can be styled and scripted.