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

eter

v1.1.0

Published

Lightweight collections for JavaScript

Downloads

10

Readme

Eter

Build Status

Éter is a conglomerate of lightweight collections for JavaScript running on node and browser.

Usage

For node, install the package and include it

var eter = require('eter');

For the browser, just include the modules you want. You could use Bower to install the package

bower install eter --save

And include the script

<script src="path/to/eter/dist/eter.js"></script>

Types

If you use TypeScript, typings are included

import {Stack} from 'eter';

let s: Stack<number> = new Stack();

Collections

Stack

A Stack is a Last-In-First-Out (LIFO) data structure.

var s = new eter.Stack();

s.push(1);
s.push(2);
s.pop();//2
s.pop();//1
s.isEmpty();//true
s.pop();//Error "Empty stack"

Queue

A Queue is a First-In-First-Out (FIFO) data structure.

var q = new eter.Queue();

q.enqueue(1);
q.enqueue(2);
q.dequeue();//1
q.dequeue();//2
q.isEmpty();//true
q.dequeue();//Error "Empty queue"

LinkedList

A Linked List is a data structure consisting of a group of nodes which together represent a sequence.

var l = new eter.LinkedList();

l.add(1);
l.get(0);//1
l.remove(0);
l.isEmpty();//true
l.get(0);//Error "Index 0 out of bounds"

Trie

A Trie is an ordered tree data structure that is used to store a dynamic set or associative array where the keys are usually strings.

var t = new eter.Trie();

t.insert('one');
t.insert('oh');
t.insert('on');
t.contains('one');//true
t.insert('foo');
t.remove('foo');
t.contains('foo');//false

Hash Map

A Hash Map is a data structure used to implement an associative array, a structure that can map keys to values.

var m = new eter.HashMap();

m.put('key', 'value');
m.get('key');//value
m.contains('key');//true
m.remove('key');
m.contains('key');//false

Binary Tree

A Binary Tree is a data structure used for logarithmic search access.

var t = new eter.BinaryTree();

t.insert(10, 'value');
t.get(10);//value
t.remove(10);
t.get(10);//null