npx
ライクにパッケージを実行することもできます。
$ deno run --unstable \
--allow-env \
--allow-read \
--allow-write \
npm:make-dir-cli@3.0.0 src/components
const ac = new AbortController();
Deno.serve((req) => new Response("Hello, Flash"), {
port: 4500,
onListen: ({ port, hostname }) => {
console.log(`Started at http://${hostname}:${port}`);
},
onError: (error) => {
return new Response("Internal Server Error", { status: 500 });
},
signal: ac.signal,
});
deno init
コマンド$ deno init my-first-project
Project initialized
Run these commands to get started
cd my-first-project
deno run main.ts
deno test
npm init
やyarn init
などのようにプロジェクトの初期化ができます。
"buffer"
型の追加 (破壊的変更)const dylib = Deno.dlopen(libPath, {
"do_something_with_buffer": { parameters: ["buffer", "usize"], result: "void" },
});
const data = new Uint8Array([1, 2, 3, 4]);
dylib.do_something_with_buffer(data, data.length);
今後は、TypedArray
を渡す際は"pointer"
型ではなく"buffer"
型を使う必要があります。
Deno.open(Sync)
やWeb Streams APIなどが最適化Denoの今後の計画について発表されました。
import { start } from "$fresh/server.ts";
import twindPlugin from "$fresh/plugins/twind.ts";
import manifest from "./fresh.gen.ts";
import twindConfig from "./twind.config.js";
await start(manifest, { plugins: [twindPlugin(twindConfig)] });
<Head>
の非推奨化 (代わりに<head>
を使う)Hey folks, we are working hard with Prisma team on support for both Deno CLI and Deno Deploy. We expect to share some news in the coming weeks.
Bartekさんの発言より (prisma/prisma: Add support for Deno (#2452))
まもなくprisma generate
コマンドが動かせるようになるかもしれないとのことです
$ PRISMA_CLIENT_ENGINE_TYPE=binary deno run -A --unstable npm:prisma generate
hashrockさんがdeno-jaのLPを作ってくださいました!
Deno Newsでも紹介されてます
## `deno bundle`の非推奨化と`deno pack`の追加 - [Proposal: deprecate deno bundle, add deno pack (#15463)](https://github.com/denoland/deno/issues/15463) - コマンド名に関する誤解の解消や安定性の向上などが目的のようです。 ---