Package

purescript-node-readline-question

Repository
i-am-tom/purescript-node-readline-question
License
MIT
Uploaded by
i-am-tom

purescript-node-readline-question on Pursuit

A very, very simple interface to Node's ReadLine.question function. Allows for interactive command-line apps without line breaks between questions and their answers.

Example

Here's a friendly conversation between you and a robot.

module Test.Main where

import Prelude

import Control.Monad.Aff (launchAff)
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (log)

import Node.ReadLine.Question (question)

main = launchAff $ do
  you <- question "What is your name"
  me  <- question "What is my name"

  liftEff $ log $ "Hello, " <> you <> "!"
  liftEff $ log $ "I am a robot called " <> me <> "."

Installation

bower install purescript-node-readline-question

Documentation

Module documentation is published on Pursuit.