From 4fe6c93ceb98ded69eb8a2dcae1cf4878a9e3f60 Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Wed, 12 Nov 2025 13:50:06 +0100 Subject: [PATCH 1/2] README: update installation instructions --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b11ff2..8a98c1e 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,25 @@ Canvas API for Deno, ported from ## Installation -Import from https://deno.land/x/canvas/mod.ts or just import from raw GitHub -URL, https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/master/mod.ts. +### Deno 2 + +Install using: + + deno add jsr:@gfx/canvas-wasm + +Then import like: + +```ts +import { createCanvas } from "@gfx/canvas-wasm"; +``` + +### Deno 1.x + +Use HTTP import (or alternatively directly from `https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/master/mod.ts`) + +```ts +import { createCanvas } from "https://deno.land/x/canvas/mod.ts"; +``` ## Usage @@ -14,7 +31,7 @@ URL, https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/master/mod.ts. other exports from the file are types and utility functions. ```ts -import { createCanvas } from "https://deno.land/x/canvas/mod.ts"; +import { createCanvas } from "@gfx/canvas-wasm"; const canvas = createCanvas(200, 200); const ctx = canvas.getContext("2d"); From 643d13842a53729905e6270c73537dabc891c439 Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Wed, 12 Nov 2025 16:07:18 +0100 Subject: [PATCH 2/2] README: keep http import in example for convenience --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a98c1e..738b54e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ import { createCanvas } from "https://deno.land/x/canvas/mod.ts"; other exports from the file are types and utility functions. ```ts -import { createCanvas } from "@gfx/canvas-wasm"; +import { createCanvas } from "https://deno.land/x/canvas/mod.ts"; const canvas = createCanvas(200, 200); const ctx = canvas.getContext("2d");