Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/targadactyl/src/tga.ts>TgaLoader#fetch

tga.js implemented in Deno
Latest
method TgaLoader.prototype.fetch
import { TgaLoader } from "https://deno.land/x/targadactyl@1.2.0/src/tga.ts";

Open remote TGA file

Examples

Example 1

const tga = new TgaLoader();
const src = new URL("https://raw.githubusercontent.com/jasonjgardner/targadactyl/main/test/test.tga");

try {
 tga.load(
   await tga.fetch(src)
 );
} catch (err) {
 // Catch Fetch API errors or TgaLoaderError
}

// TGA data has been initialized! 🍾

Parameters

uri: URL

URL of TGA file

Returns

Promise<Uint8ClampedArray>

TGA data