Playback your Nodejs repl history like a video file or a memory.
Initial author: Steve Wang ([email protected])
license: GPL 3.0
Requires: Nodejs
- Install with NPM:
npm install repl-rp
- Install with Github:
git pull https://github.com/mrname5/repl-rp.git
const P = require('repl-rp')
OR
const P = await import('repl-rp')
To view recording tools run:
P.recording
P.recording.startRecording()
Then start typing and the contents will be recorded. Will be saved to a new txt file which will contain the current date + repl-history and the file number.
P.recording.stopRecording()
Recording will be paused but can always be resumed with start recording command.
P.recording.historyStream
Use the CommandHistoryPlayer class It takes once argument the file path in string form:
let historyPlayer = new P.playback.CommandHistoryPlayer(fileName)
To start playback with relative time:
historyPlayer.play()
To stop/pause playback do this:
historyPlayer.stop()
To just run all commands saved at once run:
historyPlayer.runAllNow()
To repeat run this:
historyPlayer.repeat()
To change speed of playback, check the speed variable in CommandHistoryPlayer. The bigger the number the faster the speed. Original speed is 1.
historyPlayer.speed = 2