Created
March 27, 2020 00:18
-
-
Save thgaskell/20d209a5da49be7a01933ec86d7ae908 to your computer and use it in GitHub Desktop.
Hello, Deno!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { parse } from "https://deno.land/std/flags/mod.ts"; | |
| function greet(name?: string): void { | |
| if (!name) { | |
| console.log('Hello, World!'); | |
| } else { | |
| console.log(`Hello, ${name}!`); | |
| } | |
| } | |
| const { name } = parse(Deno.args); | |
| greet(name); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use the
deno installcommand to save the file as an executable:After that, you may be prompted to add the deno binary path to your
$PATHvariable. Once your shell script resolves the deno binary path, you should be able to run the command with your chosen executable name: