Permalink
Browse files

Merge pull request #13 from HarrySarson/patch-1

Fix example in readme
  • Loading branch information...
eush77 committed Apr 22, 2017
2 parents c5d51c7 + 07bf43a commit 32990829d6bc88a32d243b161447ede4a44bbd50
Showing with 7 additions and 2 deletions.
  1. +7 −2 README.md
View
@@ -7,8 +7,13 @@ Persist a node repl's history to a file.
install: `npm install repl.history`
```javascript
+var os = require('os');
+var path = require('path');
+
+var historyFile = path.join(os.homedir(), '.node_history');
+
var repl = require('repl').start('> ');
-require('repl.history')(repl, process.env.HOME + '/.node_history');
+require('repl.history')(repl, historyFile);
```
this will drop a `.node_history` file in your home directory.
@@ -21,4 +26,4 @@ run `repl.history` on the command line
A file `~/.node_history` will be created.
-I like to alias it to `nr` for node repl
+I like to alias it to `nr` for node repl

0 comments on commit 3299082

Please sign in to comment.