circularlist

0.1.0 • Public • Published

A minimal Circular List in javascript

Build Status

This only aims at iterating a list, in order to handle transformations use native array methods and reset the data structure.

var CircularList = require('circularlist');
 
var list = new CircularList([1, 2, 3, 4]);
 
list.next() // 1
list.next() // 2
list.prev() // 1
list.last() // 4
 
// Modify list by resetting
 
list.reset(list.toArray().slice(1)); // [1, 2, 3]

Install

  • bower install CircularList
  • npm install CircularList

Supported environments:

  • node: var CircularList = require('circularlist');
  • browser:
    • AMD: define(['CircularList'], function(CircularList) {});
    • Global: window.CircularList

Run tests

npm install; npm test

Readme

Keywords

none

Package Sidebar

Install

npm i circularlist

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • nervetattoo