FixedQueue
Implementation of a fixed queue in javascript. (Original concept found here: http://www.bennadel.com/blog/2308-Creating-A-Fixed-Length-Queue-In-JavaScript-Using-Arrays.htm)
Installation
npm install fixedqueue
Use from the command line:
> var fixedQueue = require('fixedqueue').FixedQueue
> var queue = fixedQueue(2, ['first', 'second'])
> queue.enqueue('third')
> queue.enqueue('fourth', 'fifth')
> queue.enqueue('sixth', 'seventh')
> queue
[ 'third',
'fourth',
'fifth',
'sixth',
'seventh',
permittedAmount: 5,
trimTail: [Function],
trimHead: [Function],
push: [Function],
unshift: [Function],
splice: [Function],
enqueue: [Function],
dequeue: [Function] ]
an so on...
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request