repl.history
Advanced tools
Comparing version 0.1.0 to 0.1.1
15
index.js
@@ -12,9 +12,6 @@ var fs = require('fs'); | ||
var fd = fs.openSync(file, 'a'), reval = repl.eval; | ||
repl.eval = function(code, context, file, cb) { | ||
var last = code.substring(1) | ||
last = last.substring(0, last.length-2); | ||
if (last && last !== '.history') { | ||
fs.write(fd, last + '\n'); | ||
repl.rli.addListener('line', function(code) { | ||
if (code && code !== '.history') { | ||
fs.write(fd, code + '\n'); | ||
} else { | ||
@@ -24,6 +21,4 @@ repl.rli.historyIndex++; | ||
} | ||
}); | ||
reval(code, context, file, cb); | ||
} | ||
process.on('exit', function() { | ||
@@ -30,0 +25,0 @@ fs.closeSync(fd); |
{ | ||
"author": "Elijah Insua <tmpvar@gmail.com> (http://tmpvar.com)", | ||
"contributors" : [ | ||
{ "name" : "Scott Nelson", "url" : "https://github.com/scttnlsn" } | ||
], | ||
"name": "repl.history", | ||
"description": "add history to node's repl", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"repository": { | ||
@@ -10,5 +13,2 @@ "type": "git", | ||
}, | ||
"engines": { | ||
"node": "0.6.x" | ||
}, | ||
"dependencies": {}, | ||
@@ -15,0 +15,0 @@ "devDependencies": {}, |
1961
31