9. Copyright (C) 2022 虎の穴ラボ株式会社All Right Reserved.
例:環境変数を取得してみる
9
$ deno run --allow-env ref_env.ts
TEST_VALUE
// ref_env.ts
console.log(Deno.env.get("TEST_KEY"));
$ deno run ref_env.ts
error: Uncaught PermissionDenied: Requires env access to
"TEST_KEY", run again with the --allow-env flag
1. パーミッション指定なし
2. パーミッション指定あり
10. Copyright (C) 2022 虎の穴ラボ株式会社All Right Reserved.
$ deno run sample.ts
Check file:///path/to/sample.ts
error: TS2322 [ERROR]: Type 'string' is not assignable to type 'number'.
counter = "test";
~~~~~~~
at file:///path/to/sample.ts:2:1
// sample.ts
let counter: number = 1;
counter = "test";
console.log(counter);
• デフォルトでTypeScriptが使える
TypeScript
10