Skip to content

A collection of general purpose data structures for JavaScript/TypeScript

License

Notifications You must be signed in to change notification settings

errmayank/structs

Repository files navigation

structs

Installation

Using npm:

$ npm i structs

Using yarn:

$ yarn add structs

Using jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/structs"></script>

Using unpkg CDN:

<script src="https://unpkg.com/structs"></script>

Usage

In Node.js:

// Load a specific class using destructuring (recommended)
const { HashSet } = require('structs')
const set = new HashSet([7, 69, 999, 'chidori', 7, 'chidori'])
// > [ 7, 69, 999, 'chidori' ]

// Load full build
const structs = require('structs')
const set = new structs.HashSet([7, 69, 999, 94, 69, 420])
// > [ 7, 69, 94, 420, 999 ]

With TypeScript:

import { HashSet } from 'structs'
const set = new HashSet<string>(['rick', 'patrick', 'madara', 'bulma'])
// > [ 'rick', 'patrick', 'madara', 'bulma' ]

License

structs is MIT licensed