Skip to content

Commit

Permalink
Merge pull request #13 from HarrySarson/patch-1
Browse files Browse the repository at this point in the history
Fix example in readme
  • Loading branch information
eush77 committed Apr 22, 2017
2 parents c5d51c7 + 07bf43a commit 3299082
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -7,8 +7,13 @@ Persist a node repl's history to a file.
install: `npm install repl.history` install: `npm install repl.history`


```javascript ```javascript
var os = require('os');
var path = require('path');

var historyFile = path.join(os.homedir(), '.node_history');

var repl = require('repl').start('> '); 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. this will drop a `.node_history` file in your home directory.
Expand All @@ -21,4 +26,4 @@ run `repl.history` on the command line


A file `~/.node_history` will be created. 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.