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

@fabryscript/data-structures

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fabryscript/data-structures

![GitHub license](https://img.shields.io/github/license/fabryscript/alchemical) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/fabryscript/alchemical) ![GitHub last commit](https://img.shields.io/github/last-commit/fabryscript/

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Simple Data Structures Library (TypeScript)

GitHub license GitHub release (latest by date) GitHub last commit

A TypeScript library that provides a collection of simple data structures, designed to help you work with common data organization and manipulation tasks.

Table of Contents

  • Features
  • Installation
  • Usage
  • Available Data Structures
  • Contributing
  • License

Features

  • Easy-to-Use: The library offers straightforward APIs for working with data structures.
  • Type-Safe: Written in TypeScript, ensuring type safety in your code.
  • Well-Documented: Includes detailed documentation and usage examples.
  • Open Source: You can use, modify, and contribute to this library freely.

Installation

You can install this library via your package manager of choice:

npm install @fabryscript/data-structures
# or
yarn add @fabryscript/data-structures
# or
pnpm install @fabryscript/data-structures
# or
bun install @fabryscript/data-structures

Usage

import { Stack, Queue, HashTable } from '@fabryscript/data-structures';

// Create instances of data structures
const stack = new Stack();
const queue = new Queue();
const hashTable = new HashTable<number>();

// Use the data structures
stack.push(42);
queue.push('Hello, World!');
hashTable.add('John', 25);

Available Data Structures

Stack

A simple implementation of a stack data structure.

  • push(item: any): Pushes an item onto the stack.
  • pop(): any | undefined: Pops an item from the stack.
  • peek(): any | undefined: Retrieves the top item without removing it.
  • isEmpty(): boolean: Checks if the stack is empty.
  • length(): number: Returns the current length of the stack.

Queue

A simple implementation of a queue data structure.

  • push(item: any): Adds an item to the back of the queue.
  • pop(): any | undefined: Removes an item from the front of the queue.
  • peek(): any | undefined: Retrieves the front item without removing it.
  • isEmpty(): boolean: Checks if the queue is empty.
  • length(): number: Returns the current length of the queue.

HashTable

A simple implementation of a hash table data structure.

  • add(key: string, data: T): void: Adds data to the hash table.
  • get(key: string): BucketData<T>[]: Retrieves data associated with a key.
  • delete(key: string): void: Deletes data associated with a key.

Contributing

Contributions are welcome! If you have ideas for improvements or new features, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

FAQs

Package last updated on 15 Sep 2023

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