Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zly201/js-sdsl
A javascript standard data structure library which benchmark against C++ STL.
https://github.com/zly201/js-sdsl
Last synced: about 2 months ago
JSON representation
A javascript standard data structure library which benchmark against C++ STL.
- Host: GitHub
- URL: https://github.com/zly201/js-sdsl
- Owner: ZLY201
- License: mit
- Archived: true
- Fork: true (js-sdsl/js-sdsl)
- Created: 2022-08-27T07:54:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-27T08:00:47.000Z (about 2 years ago)
- Last Synced: 2024-04-28T14:34:49.125Z (5 months ago)
- Language: TypeScript
- Homepage: https://js-sdsl.github.io/
- Size: 479 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# This repository has been migrated to [js-sdsl/js-sdsl](https://github.com/js-sdsl/js-sdsl).
A javascript standard data structure library which benchmark against C++ STL
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](https://js-sdsl.github.io/#/test/benchmark-analyze).
## Supported platforms
- node.js (using commonjs)
- react/vue (using es5)
- browser (support most browsers)## Download
Download directly
- [js-sdsl.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.js) (for development)
- [js-sdsl.min.js](https://unpkg.com/js-sdsl/dist/umd/js-sdsl.min.js) (for production)Or install js-sdsl using npm
```bash
npm install js-sdsl
```## Usage
You can visit our [official website](https://js-sdsl.github.io/) to get more information.
To help you have a better use, we also provide this [API document](https://zly201.github.io/js-sdsl/index.html).
### For browser
```html
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```
### 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
```## 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](https://coveralls.io/github/ZLY201/js-sdsl). 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`](https://github.com/ZLY201/js-sdsl/blob/gh-pages/performance.md) to see our running results or reproduce it with `yarn test:performance` command.
You can also visit [here](https://js-sdsl.github.io/#/test/performance-test) to get the result.
## Maintainers
[@ZLY201](https://github.com/ZLY201)
## Contributing
Feel free to dive in! Open an issue or submit PRs. It may be helpful to read the [Contributor Guide](https://github.com/ZLY201/js-sdsl/blob/main/.github/CONTRIBUTING.md).
### Contributors
Thanks goes to these wonderful people:
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## License
[MIT](https://github.com/ZLY201/js-sdsl/blob/main/LICENSE) Š ZLY201