npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

js-structures

v1.0.5

Published

Set of data structures implemented in Javascript. Currently the following structures are implemented:

Downloads

3

Readme

JS Structures

Set of data structures implemented in Javascript. Currently the following structures are implemented:

LinkedList

This a a doubly linked list implementation. Each node of the list is always linked to the previus and successive node with the properties prev and next.

The node object stored in the list has the following schema

{
    "title": "List node",
    "type": "object",
    "properties": {
        "data": {
            "type": "any"
        },
        "prev": {
            "type": "object"
        },
        "next": {
            "type": "object"
        }
    }
}

Methods

  • add(data) - Append a node with arbitrary data to the end of the list list.
  • addFirst(data) - Insert a node with arbitrary data at the beginning of the list.
  • remove(index) - Remove the node at the given index without retrieving it. Throws RangeError if the list is empty or if the index is too small or too big.
  • removeFirst() - Removes the first node of the list, it's a shortcut for remove(0)
  • removeLast() - Removes the last node of the list, it's a shortcut for remove(List.size() - 1)
  • peek(index) - Retrieve the node at the given position
  • get(index) - Retrieve and remove the node at the given position
  • size() - Get the current size of the list

Queue

It's a collection that order elements with FIFO order. It's baked by the LinkedList so the elements contained in the queue are the same as the list but without access to the other elements.

Methods

  • enqueue(data) - Add data to the queue
  • dequeue() - Retrieve and remove the next element in the queue if any, otherwise return null
  • peek() - Retrieve just the next element from the queue, without removing it.
  • size() - Return the queue size.

Stack

It's a collection that order elements with LIFO order. It's baked by the LinkedList so the elements contained in the stack are the same as the list but without access to the other elements.

Methods

  • push(data) - Add data to the stack
  • pop() - Retrieve the next element of the stack if any, otherwise return null
  • size() - Return the stack size

Swag

NPM Status

NPM

Build

wercker status

Code climate

Code Climate Test Coverage