0.0.2
readline for deno
Repository
Current version released
4 years ago
Versions
readline-Sync for Deno
implementation of readline for deno.land
Usage
deno run –allow-read –allow-write https://deno.land/x/readline_sync/tests/test_get.ts
import { readline } from 'https://deno.land/x/readline_sync/mod.ts'
let name: string = readline.puts('What\'s your name? ')
let age = Number(readline.puts('Your age: '))
readline.write(`Hello, ${name}, age: ${age}`)
deno run –allow-read –allow-write https://deno.land/x/readline_sync/tests/test_chooseOption.ts
import { readline } from 'https://deno.land/x/readline_sync/mod.ts'
let animals = ['Horse', 'Rooster', 'Cow', 'Dog', "Hamster"]
let select = readline.chooseOption(animals,"Which animal to choose? ")
readline.write(`You chose ${animals[select]}`)