Skip to content
/ history Public
forked from component/history

Keep track of and cycle through capped history (chat messages, REPL command-lines etc)

Notifications You must be signed in to change notification settings

amasad/history

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

History

Keep track of and cycle through capped history (chat messages, REPL command-lines etc).

Installation

$ component install component/history

API

History(vals)

Initialize with an array of vals.

History#add(val)

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.

History#prev()

Cycle backwards through history, returning a value added by .add().

History#next()

Cycle forwards through history, returning a value added by .add().

History#max(n)

The maximum number of entries defaulting to 1000.

History#reset()

Reset the index to the latest value.

License

MIT

About

Keep track of and cycle through capped history (chat messages, REPL command-lines etc)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%