Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An Easy DSL to manage a stack that puts the first node in the back for next time.

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

readme.md

Stop-N-Go

Your favorite array stack that retreived the first item in the array and then removes it and add it into the back of the array. This module will create a continuous stack of items in array that always keeps the first one in the array as the one that is least used.

Install

npm install stop-n-go

Usage

var list = require('stop-n-go');

list.add('foo');
list.add('foo2');
list.add('foo3');

list.all();
#> ['foo', 'foo2', 'foo3']
list.get();
#> 'foo'
list.all();
#> ['foo2', 'foo3', 'foo']
list.remove('foo3');
#> ['foo2','foo']
list.get();
#> 'foo2'
list.all();
#> ['foo','foo2']

License

See LICENSE

Contributions

pull requests welcome

Something went wrong with that request. Please try again.