JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1074
  • Score
    100M100P100Q102764F
  • License MIT

Load history into node repl

Package Exports

  • repl-story

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (repl-story) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

repl-story

Load history into node repl

npm Build Status codecov License: MIT

Basic Usage

const repl = require('repl');
const replHistory = require('repl-story');

const filename = '~/.my.cli'
const replServer = replHistory({repl, filename});
// play around in repl
// you can consult history using command .history

Api

replHistory(options); The two mantary field of options are:

  • replServer or repl: either the repl module, or a ReplServer
  • filename or historyFile: path toward the history file

Here is the other facultative options that can be provided to replHistory:

  • prompt: optional prompt to use if did not provided a ReplServer instance
  • create or noCreate: whether history file should be created if missing [default: create=true]
  • record or noRecord: whether new history should be recorded [default: record=true]
  • ignore: an array of values that should not be recorded into history

replHistory() return the ReplServer instance you provided, or otherwise the one it started.

Acknowledgment

This is the adaptation of repl.history to current node Apis.

And why story? repl-history was already taken 😉