Denoとは Node.jsの作者であるRyan Dahl氏によって立ち上げられた JavaScriptおよびTypeScriptのランタイム環境 10 Things I Regret About Node.js JSConf EU 2018でRyan Dahl氏はNode.jsの設計に関する後悔 を語った Denoはこれらを解決したものとして開発されている
こんな感じで動作します $ deno install --allow-read \ --name shuf https://github.com/kentaro-m/shuf/raw/main/cli.ts $ echo 'bob\njohn\ntom' | shuf Tom Bob John $ shuf sample.csv Tom Bob John
コマンドパース処理 c4spar/deno-cliffyでコマンドが簡単に定義できます。 import { Command } from "https://deno.land/x/[email protected]/command/mod.ts"; import { handler } from './handler.ts'; await new Command() .name("shuf") .version("0.1.0") .description("Write a random permutation of the input lines to standard output.") .arguments('[fileName:string]') .action(async (_, fileName: string) => await handler(fileName)) .parse(Deno.args);