Socket
Book a DemoInstallSign in
Socket

dom-queue

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-queue

A queue for the DOM

latest
Source
npmnpm
Version
0.7.1
Version published
Weekly downloads
217
-14.57%
Maintainers
1
Weekly downloads
 
Created
Source

dom-queue

browser support

A queue for the DOM. Not really a queue, but whatevs.

Example

var Queue = require('dom-queue');
var q = Queue({container: 'some-list'});

q.push('a');
q.push('b');
q.push('c');

Outputs:

<ul class="some-list">
    <li class="item">a</li>
    <li class="item">b</li>
    <li class="item">c</li>
</ul>

Queue

var q = Queue(options={})

options consist of:

  • container default: queue
  • tag default: ul
  • parent default: body
  • childTag default: li if parent is ul. span otherwise.

q.push(item)

Push an item onto the queue.

q.pop()

Remove the last item that was pushed.

q.shift()

Remove the first item.

q.remove(index)

Remove the item where index is in the list.

q.clear()

Clears items in the queue, but leaves the container.

Keywords

dom

FAQs

Package last updated on 19 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts