百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

js-sdsl

> 编程语言
开源

一个与 C++ STL 进行基准测试的 JavaScript 标准数据结构库。

800 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个与 C++ STL 进行基准测试的 JavaScript 标准数据结构库。

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

English | 简体中文

✨ Included data structures

  • Stack - First-in, last-out stack.
  • Queue - First-in, first-out queue.
  • PriorityQueue - Priority queue implemented using heap.
  • Vector - Protected array, cannot directly operate on properties like length.
  • LinkedList - Linked list using non-contiguous memory addresses.
  • Deque - Double-ended queue, O(1) time complexity to unshift or getting elements by index.
  • OrderedSet - Sorted set implemented using red black tree.
  • OrderedMap - Sorted map implemented using red black tree.
  • HashSet - Refer to the polyfill of ES6 Set.
  • HashMap - Refer to the polyfill of ES6 Map.

⚔️ Benchmark

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

Supported platforms

| IE / Edge | Firefox | Chrome | Safari | Opera |

NodeJs | |:----------------------------:|:-----------------------------:|:---------------------------:|:---------------------------:|:-------------------------:|:---------------------------:| | Edge 12 | 36 | 49 | 10 | 36 | 10 |

Download

Download directly by cdn:

  • js-sdsl.js (for development)
  • js-sdsl.min.js (for production)

Or install js-sdsl using npm:

bash
npm install js-sdsl

Or you can download the isolation packages containing only the containers you want:

package npm size docs
@js-sdsl/stack NPM Package GZIP Size link
@js-sdsl/queue NPM Package GZIP Size link
@js-sdsl/priority-queue NPM Package GZIP Size link
@js-sdsl/vector NPM Package GZIP Size link
@js-sdsl/link-list NPM Package GZIP Size link
@js-sdsl/deque NPM Package GZIP Size link
@js-sdsl/ordered-set NPM Package GZIP Size link
@js-sdsl/ordered-map NPM Package GZIP Size link
@js-sdsl/hash-set NPM Package GZIP Size link
@js-sdsl/hash-map NPM Package [GZIP Size][hash-map-umd-link] [link][hash-map-docs]

Usage

You can visit our official website to get more information.

To help you use the library more effectively, we also provide this API document.

For previous versions of the documentation, please visit:

https://js-sdsl.org/js-sdsl/previous/v${version}/index.html

E.g.

https://js-sdsl.org/js-sdsl/previous/v4.1.5/index.html

For browser

xml

For npm

javascript
// 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

Test

Unit test

We use Karma and Mocha to run unit tests and synchronize coverage to Coveralls. You can run yarn test:unit command to reproduce it.

For performance

We benchmark most functions for performance. 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.

⌨️ Development

Use Gitpod, a free online dev environment for GitHub. Or clone locally:

bash
$ git clone https://github.com/js-sdsl/js-sdsl.git
$ cd js-sdsl
$ npm install
$ npm run dev   # development mode

Then you can see the output in dist/cjs folder.

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: This project follows the all-contributors specification. Contributions of any kind welcome!

❤️ Sponsors and Backers

The special thanks to these sponsors or backers because they provided support at a very early stage:

Thanks also give to these sponsors or backers:

License

MIT © ZLY201

[hash-map-umd-link]:

Issues· 19 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptdata-structure-librarydata-structuresdata-structures-and-algorithmsdeque

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言