プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
_ zx tasks.md

実行方法 #

$ deno -A npm:zx tasks.md [task]
: or
$ npx zx tasks.md [task]
const task = {
  build,
  test,
  cowsay,
}[argv._[0]];

$.verbose = true;
await task?.().then(process.exit);

build #

ビルド

async function build() {
  console.log("building...");
}

test #

テスト

async function test() {
  console.log("testing...");
}

cowsay #

import { say } from "cowsay";

async function cowsay() {
  console.log(say({ text: argv._[1] ?? "Hello, World!" }));
}

help #

このテキストの表示

cat "${__filename}"