@@ -0,0 +1,1278 @@
+// IMPORTANT: choose one%0Avar RL_LIB = %22libreadline%22;  // NOTE: libreadline is GPL%0A//var RL_LIB = %22libedit%22;%0A%0Avar HISTORY_FILE = require('path').join(process.env.HOME, '.mal-history');%0A%0Avar rlwrap = %7B%7D; // namespace for this module in web context%0A%0Avar ffi = require('ffi'),%0A    fs = require('fs');%0A%0Avar rllib = ffi.Library(RL_LIB, %7B%0A    'readline':    %5B 'string', %5B 'string' %5D %5D,%0A    'add_history': %5B 'int',    %5B 'string' %5D %5D%7D);%0A%0Avar rl_history_loaded = false;%0A%0Aexports.readline = rlwrap.readline = function(prompt) %7B%0A    prompt = typeof prompt !== 'undefined' ? prompt : %22user%3E %22;%0A%0A    if (!rl_history_loaded) %7B%0A        rl_history_loaded = true;%0A        var lines = %5B%5D;%0A        if (fs.existsSync(HISTORY_FILE)) %7B%0A            lines = fs.readFileSync(HISTORY_FILE).toString().split(%22%5Cn%22);%0A        %7D%0A        // Max of 2000 lines%0A        lines = lines.slice(Math.max(lines.length - 2000, 0));%0A        for (var i=0; i%3Clines.length; i++) %7B%0A            if (lines%5Bi%5D) %7B rllib.add_history(lines%5Bi%5D); %7D%0A        %7D%0A    %7D%0A%0A    var line = rllib.readline(prompt);%0A    if (line) %7B%0A        rllib.add_history(line);%0A        try %7B%0A            fs.appendFileSync(HISTORY_FILE, line + %22%5Cn%22);%0A        %7D catch (exc) %7B%0A            // ignored%0A        %7D%0A    %7D%0A%0A    return line;%0A%7D;%0Avar readline = exports;%0A

bring over node_readline.js to fix build