JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q40549F
  • License MIT

ES6 JS lightweight data structures (Queue, Stack, Linked-List)

Package Exports

  • esds

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esds) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Contributors Downloads Forks Stargazers Issues MIT License


ESDS

ES Javascript Data Structures (Queue, Stack, Linked List)
Explore the docs ยป

Report Bug ๐Ÿž ยท Request Feature ๐Ÿ—ณ

Table of Contents
  1. Getting Started ๐Ÿšฆ
  2. Usage ๐Ÿ“š
  3. Roadmap ๐Ÿ“
  4. Contributing ๐Ÿ’ช
  5. License ๐Ÿ“
  6. Contact ๐Ÿ“ง

Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. Install NPM package
    npm i esds

Usage

Example Queue / Stack

import {Queue, Stack} from 'esds';

const queue = new Queue();
const stack = new Stack();

queue.add([1,2,3]);
queue.add(4);
queue.add(5);

stack.push([1,2]);
stack.add(3);
stack.add([4,5]);

while (!queue.isEmpty){
    console.log(queue.poll()); // 1, 2, 3, 4, 5
}

while (!stack.isEmpty){
    console.log(stack.pop()); // 5, 4, 3, 2, 1
}

Example Linked List

import {List} from 'esds';

const a = new List();
a.add([1, 2, 3, 4]);
console.log(a.toArray()); // [1, 2, 3, 4]

a.add(5);
a.add("Six");
a.add({value: 7, str: "Seven"});
console.log(a.get(6).val); // "Six"

let head = a.get();
while(head){
    console.log(head.val);
    head = head.next;
}
/*
1
2
3
4
5
"Six"
{value: 7, str: "Seven"}
*/

let b = a.subList(2, 5);
console.log(b.toArray()); // [2, 3, 4, 5]

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/jayalbo/ESDS