module.exports = read var buffer = "" , tty = require("tty") , StringDecoder = require("string_decoder").StringDecoder function raw (mode) { if (process.stdin.setRawMode) { if (process.stdin.isTTY) { process.stdin.setRawMode(mode) } return } // old style try { tty.setRawMode(mode) } catch (e) {} } function read (opts, cb) { if (!cb) cb = opts, opts = {} var p = opts.prompt || "" , def = opts.default , silent = opts.silent , timeout = opts.timeout , num = opts.num || null if (p && def) p += "("+(silent ? "