Cyclist is an efficient \href{http://en.wikipedia.org/wiki/Circular_buffer}{\texttt{ cyclic list}} implemention for Javascript. It is available through npm


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install cyclist }

\end{DoxyCode}


\href{http://travis-ci.org/mafintosh/cyclist}{\texttt{ }}\hypertarget{md_sfcode_node_modules_cyclist_README_autotoc_md7761}{}\doxysection{What?}\label{md_sfcode_node_modules_cyclist_README_autotoc_md7761}
Cyclist allows you to create a list of fixed size that is cyclic. In a cyclist list the element following the last one is the first one. This property can be really useful when for example trying to order data packets that can arrive out of order over a network stream.\hypertarget{md_sfcode_node_modules_cyclist_README_autotoc_md7762}{}\doxysection{Usage}\label{md_sfcode_node_modules_cyclist_README_autotoc_md7762}

\begin{DoxyCode}{0}
\DoxyCodeLine{var cyclist = require('cyclist')}
\DoxyCodeLine{var list = cyclist(4)}
\DoxyCodeLine{}
\DoxyCodeLine{list.put(42, 'hello 42') // store something and index 42}
\DoxyCodeLine{list.put(43, 'hello 43') // store something and index 43}
\DoxyCodeLine{}
\DoxyCodeLine{console.log(list.get(42)) // prints hello 42}
\DoxyCodeLine{console.log(list.get(46)) // prints hello 42 again since 46 -\/ 42 == list.size }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_cyclist_README_autotoc_md7763}{}\doxysection{API}\label{md_sfcode_node_modules_cyclist_README_autotoc_md7763}

\begin{DoxyItemize}
\item {\ttfamily cyclist(size)} creates a new buffer
\item {\ttfamily cyclist\#get(index)} get an object stored in the buffer
\item {\ttfamily cyclist\#put(index,value)} insert an object into the buffer
\item {\ttfamily cyclist\#del(index)} delete an object from an index
\item {\ttfamily cyclist\#size} property containing current size of buffer
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_cyclist_README_autotoc_md7764}{}\doxysection{License}\label{md_sfcode_node_modules_cyclist_README_autotoc_md7764}
MIT 