From b68928cb193948ced1fc8e34e4a35b173ac78d7f Mon Sep 17 00:00:00 2001 From: sigmaSd Date: Sun, 28 May 2023 13:06:44 +0100 Subject: [PATCH 1/2] mention deno support in the README It seems to work fine, and I have a demo bot with it https://github.com/sigmaSd/deno-matrix-bot --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9099f8ec44d..6f83584801e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ # Matrix JavaScript SDK This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a -browser or in Node.js. +browser or in Node.js or in Deno. The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports @@ -55,6 +55,17 @@ client.publicRooms(function (err, data) { See below for how to include libolm to enable end-to-end-encryption. Please check [the Node.js terminal app](examples/node) for a more complex example. +## In Deno + +```javascript +import * as sdk from "npm:matrix-js-sdk"; +const client = sdk.createClient({ baseUrl: "https://matrix.org" }); +await client.publicRooms(function (err, data) { + console.log("Public Rooms: %s", JSON.stringify(data)); +}); +``` +you can run with `deno run --allow-net myclient.ts` + To start the client: ```javascript From 56240fac0e614b54f53940985a49842fe74de612 Mon Sep 17 00:00:00 2001 From: sigmaSd Date: Wed, 31 May 2023 11:30:52 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6f83584801e..6d5aaa77662 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ # Matrix JavaScript SDK This is the [Matrix](https://matrix.org) Client-Server SDK for JavaScript and TypeScript. This SDK can be run in a -browser or in Node.js or in Deno. +browser or in Node.js. The Matrix specification is constantly evolving - while this SDK aims for maximum backwards compatibility, it only guarantees that a feature will be supported for at least 4 spec releases. For example, if a feature the js-sdk supports @@ -55,16 +55,7 @@ client.publicRooms(function (err, data) { See below for how to include libolm to enable end-to-end-encryption. Please check [the Node.js terminal app](examples/node) for a more complex example. -## In Deno - -```javascript -import * as sdk from "npm:matrix-js-sdk"; -const client = sdk.createClient({ baseUrl: "https://matrix.org" }); -await client.publicRooms(function (err, data) { - console.log("Public Rooms: %s", JSON.stringify(data)); -}); -``` -you can run with `deno run --allow-net myclient.ts` +You can also use the sdk with [Deno](https://deno.land/) (`import npm:matrix-js-sdk`) but its not officialy supported. To start the client: