Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eter

Lightweight collections for JavaScript

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

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

<script src="build/stack.js"></script>

Collections

Stack

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

var s = new eter.Stack();

s.pushAll([1, 2, 3]);
s.toArray();//[3, 2, 1]

s.pop();//3
s.toArray();//[2, 1]

Queue

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

var q = new eter.Queue();

q.enqueueAll([1, 2, 3]);
q.toArray();//[1, 2, 3]

q.remove();//1
q.toArray();//[2, 3]

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.addAll([1, 2, 3]);
l.toArray();//[1, 2, 3]

l.get(2);//3

l.insert(1, 2);
l.toArray();//[1, 2, 2, 3]

l.remove();
l.toArray();//[2, 2, 3]

l.contains(2);//true

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.insertAll(['one', 'oh', 'on']);
t.getAll();//['on', 'oh', 'one']

t.contains('one');//true

t.insert('foo');
t.getAll();//['foo', 'on', 'oh', 'one']

t.remove('foo');
t.getAll();//['on', 'oh', 'one']

t.getPrefixed('on');//['on', 'one']

Keywords

FAQs

Package last updated on 01 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc