From e1a116212164c32c83da8905517dbd1a7be7a63f Mon Sep 17 00:00:00 2001 From: FUJI Goro Date: Tue, 4 May 2021 14:15:19 +0900 Subject: [PATCH] mention to Deno --- README.md | 7 +++++++ example/deno-with-esmsh.ts | 5 +++++ example/deno-with-unpkg.ts | 5 +++++ 3 files changed, 17 insertions(+) create mode 100755 example/deno-with-esmsh.ts create mode 100755 example/deno-with-unpkg.ts diff --git a/README.md b/README.md index a6838cd7..d4a87cfb 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ deepStrictEqual(decode(encoded), object); - [Distribution](#distribution) - [NPM / npmjs.com](#npm--npmjscom) - [CDN / unpkg.com](#cdn--unpkgcom) +- [Deno Support](#deno-support) - [Maintenance](#maintenance) - [Testing](#testing) - [Continuous Integration](#continuous-integration) @@ -561,6 +562,12 @@ This library is available via CDN: It loads `MessagePack` module to the global object. + +## Deno Support + +You can use this module on Deno. + +See `example/deno-*.ts` for examples. ## Maintenance ### Testing diff --git a/example/deno-with-esmsh.ts b/example/deno-with-esmsh.ts new file mode 100755 index 00000000..97f914b4 --- /dev/null +++ b/example/deno-with-esmsh.ts @@ -0,0 +1,5 @@ +#!/usr/bin/env deno run +/* eslint-disable no-console */ +import * as msgpack from "https://esm.sh/@msgpack/msgpack"; + +console.log(msgpack.decode(msgpack.encode("Hello, world!"))); diff --git a/example/deno-with-unpkg.ts b/example/deno-with-unpkg.ts new file mode 100755 index 00000000..6eded129 --- /dev/null +++ b/example/deno-with-unpkg.ts @@ -0,0 +1,5 @@ +#!/usr/bin/env deno run +/* eslint-disable no-console */ +import * as msgpack from "https://unpkg.com/@msgpack/msgpack?module"; + +console.log(msgpack.decode(msgpack.encode("Hello, world!")));