Sha256: bda069c4958049ca86a6b243bcbf2fbb119c861ba4f85a894a00d8d0682d994f

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

//Written using Nila. Visit http://adhithyan15.github.io/nila
(function() {
  var read, readline, rl;

  // This is a small REPL for Nila to test out nila code and do bug fixes

  readline = require('readline');

  rl = readline.createInterface(process.stdin, process.stdout);

  rl.setPrompt('nila> ');

  rl.prompt();

  read = rl.on('line',function(line) {
    switch(line.trim()) {
      case 'hello':
        console.log("world!");
        break;
      default:
        console.log("Say what? I might have heard " + (line.trim()));
    }
    rl.prompt();
  });

  read.on('close',function() {
    console.log("Have a great day!");
    process.exit(0);
  });

}).call(this);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nilac-0.0.4.3.9.7 examples/repl.js