This repository is a mirror of the component module amasad/history. It has been modified to work with NPM+Browserify. You can install it using the command npm install npmcomponent/amasad-history
. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to npmcomponent.
Keep track of and cycle through capped history (chat messages, REPL command-lines etc).
$ component install component/history
Initialize with an array of vals
.
Add a value, for example a chat message or REPL command line.
This method resets the history index, meaning the next call
to .back()
will be this latest value.
Cycle backwards through history, returning a value added by .add()
.
Cycle forwards through history, returning a value added by .add()
.
The maximum number of entries defaulting to 1000
.
Reset the index to the latest value.
MIT