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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sidll

v0.0.2

Published

Sparse Indexed Doubly Linked List is a linked list that is linked in both directions and which has indices distributed throughout for fast lookups.

Downloads

298

Readme

sidll.js

What is it?

A Sparse Indexed Doubly Linked List (SIDLL) is a linked list that is linked in both directions and which has indices (or pointers) distributed throughout the list which enables O(k + log p) worst case time complexity for inserts, deletes and lookups where p is the number of the indices/pointers and k is the maximum distance travelled between the pointer and a given node. Sparse distribution gives the user choice to trade-off between lookup times (faster if the interpointer distance is small) and memory (less if the interpointer distance is large).

What can it be used for?

Given that it is always sorted by key, it can be used to keep track of metrics like the streaming mean, median, head/tail as well as min/max (and their associated values).

Installing

npm i sidll

Methods

  • insertNode(key,value)
    key: number, value: any javascript data type

  • deleteNode(key)
    key: number

  • keyExist(key)
    key: number

  • getMinKey()

  • getMaxKey()

  • getMean()

  • getMedian()

  • getLength()

  • head(length)
    length: int (optional)

  • tail(length)
    length: int (optional)

  • getValue(key,index)
    key: number, index: int (optional)

  • setInterpointerDistance(distance)
    distance: int

  • setVerbosity(verbosity)
    verbosity: 0: low, 1: medium, 2: high

  • _delete()

Example

import { SIDLL } from 'sidll';

const sidll = await SIDLL();
sidll.setInterpointerDistance(20);
sidll.setVerbosity(0);

console.log("Inserting...");
for (var i=0;i<100;i++) {
	sidll.insertNode(i,0);
}

console.log("Median:",sidll.getMedian());
console.log("Mean:",sidll.getMean());
console.log("Length:",sidll.getLength());
console.log("Head:",sidll.head(20));
console.log("Tail:",sidll.tail(20));

console.log("Deleting...");
for (var i=100;i>=0;i--) {
	sidll.deleteNode(i);
}

console.log("Median:",sidll.getMedian());
console.log("Mean:",sidll.getMean());
console.log("Length:",sidll.getLength());
console.log("Head:",sidll.head(20));
console.log("Tail:",sidll.tail(20));

sidll._delete();

Important: Don't forget to delete once completed to free up memory.

Languages

Also available for Python at PyPI.

Change log

Version 0.0.2: Initial release