fixedqueue

0.0.1 • Public • Published

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i fixedqueue

    Weekly Downloads

    5

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • ussballantyne