Socket
Socket
Sign inDemoInstall

@js-sdsl/ordered-map

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @js-sdsl/ordered-map

javascript standard data structure library which benchmark against C++ STL


Version published
Maintainers
1
Install size
88.3 kB
Created

Changelog

Source

[4.1.5] - 2022.09.30

Added

  • Add find, remove, updateItem and toArray functions to PriorityQueue.
  • Support single package release (use scope @js-sdsl).

Readme

Source

js-sdsl logo

A javascript standard data structure library which benchmark against C++ STL

NPM Version Build Status Coverage Status GITHUB Star NPM Downloads Gzip Size Rate this package MIT-license GITHUB-language

English | 简体中文

Included data structures

  • Vector
  • Stack
  • Queue
  • LinkList
  • Deque
  • PriorityQueue
  • OrderedSet (using RBTree)
  • OrderedMap (using RBTree)
  • HashSet
  • HashMap

Benchmark

We are benchmarking against other popular data structure libraries. In some ways we're better than the best library. See benchmark.

Supported platforms

  • node.js (using es6)
  • react/vue (using es5)
  • browser (support most browsers)

Download

Download directly

Or install js-sdsl using npm

npm install js-sdsl

Usage

You can visit our official website to get more information.

To help you have a better use, we also provide this API document.

For browser

<script src="https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js"></script>
<script>
    const {
      Vector,
      Stack,
      Queue,
      LinkList,
      Deque,
      PriorityQueue,
      OrderedSet,
      OrderedMap,
      HashSet,
      HashMap
    } = sdsl;
    const myOrderedMap = new OrderedMap();
    myOrderedMap.setElement(1, 2);
    console.log(myOrderedMap.getElementByKey(1)); // 2
</script>

For npm

// esModule
import { OrderedMap } from 'js-sdsl';
// commonJs
const { OrderedMap } = require('js-sdsl');
const myOrderedMap = new OrderedMap();
myOrderedMap.setElement(1, 2);
console.log(myOrderedMap.getElementByKey(1)); // 2

Build by source code

You can pull this repository and run yarn build to rebuild this library.

Test

Unit test

We use jest library to write unit tests, you can see test coverage on coveralls. You can run yarn test:unit command to reproduce it.

For performance

We tested most of the functions for efficiency. You can go to gh-pages/performance.md to see our running results or reproduce it with yarn test:performance command.

You can also visit here to get the result.

Maintainers

@ZLY201

Contributing

Feel free to dive in! Open an issue or submit PRs. It may be helpful to read the Contributor Guide.

Contributors

Thanks goes to these wonderful people:


Takatoshi Kondo

💻 ⚠️

noname

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © ZLY201

Keywords

FAQs

Last updated on 02 Oct 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc