{"id":13550754,"url":"https://github.com/samchon/tstl","last_synced_at":"2025-05-15T14:05:45.634Z","repository":{"id":6750503,"uuid":"50482588","full_name":"samchon/tstl","owner":"samchon","description":"TypeScript-STL (Standard Template Library, migrated from C++)","archived":false,"fork":false,"pushed_at":"2024-03-28T17:12:20.000Z","size":20184,"stargazers_count":614,"open_issues_count":3,"forks_count":49,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-14T11:28:18.120Z","etag":null,"topics":["algorithm","collection","container","critical-section","hashmap","iterator","mutex","semaphore","stl","treemap","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samchon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"tstl"}},"created_at":"2016-01-27T04:55:26.000Z","updated_at":"2025-05-03T16:13:21.000Z","dependencies_parsed_at":"2024-03-31T21:03:38.793Z","dependency_job_id":"3cf8d1b1-f0e4-4678-9870-fc1508134922","html_url":"https://github.com/samchon/tstl","commit_stats":{"total_commits":648,"total_committers":8,"mean_commits":81.0,"dds":"0.29166666666666663","last_synced_commit":"d17ed948fefc598e0191734316b4754805729f23"},"previous_names":["samchon/stl"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Ftstl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Ftstl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Ftstl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Ftstl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samchon","download_url":"https://codeload.github.com/samchon/tstl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355334,"owners_count":22057354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","collection","container","critical-section","hashmap","iterator","mutex","semaphore","stl","treemap","typescript"],"created_at":"2024-08-01T12:01:37.152Z","updated_at":"2025-05-15T14:05:45.593Z","avatar_url":"https://github.com/samchon.png","language":"TypeScript","readme":"# TypeScript Standard Template Library\n![tstl](https://user-images.githubusercontent.com/13158709/222362879-3da6c27f-8f73-4b1d-b63a-ec23ff51e71e.png)\n\n```bash\nnpm install --save tstl\n```\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/tstl/blob/master/LICENSE)\n[![npm version](https://badge.fury.io/js/tstl.svg)](https://www.npmjs.com/package/tstl)\n[![Downloads](https://img.shields.io/npm/dm/tstl.svg)](https://www.npmjs.com/package/tstl)\n[![Build Status](https://github.com/samchon/tstl/workflows/build/badge.svg)](https://github.com/samchon/tstl/actions?query=workflow%3Abuild)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fsamchon%2Ftstl.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fsamchon%2Ftstl?ref=badge_shield)\n[![Chat on Gitter](https://badges.gitter.im/samchon/tstl.svg)](https://gitter.im/samchon/tstl?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nImplementation of STL (Standard Template Library) in TypeScript.\n  - Containers\n  - Iterators\n  - Algorithms\n  - Functors\n\n**TSTL** is an open-source project providing features of STL, migrated from *C++* to *TypeScript*. You can enjoy the STL's own specific *containers*, *algorithms* and *functors* in the JavaScript. If TypeScript, you also can take advantage of type restrictions and generic programming with the TypeScript.\n\nBelow components are list of provided objects in the **TSTL**. If you want to know more about the **TSTL**, then please read the [**Guide Documents**](https://github.com/samchon/tstl/wiki).\n\n\n\n\n## Features\n### Containers\n  - **Linear Containers**\n    - [Vector](https://samchon.github.io/tstl/api/classes/std.vector.html)\n    - [Deque](https://samchon.github.io/tstl/api/classes/std.deque.html)\n    - [List](https://samchon.github.io/tstl/api/classes/std.list.html)\n    - [ForwardList](https://samchon.github.io/tstl/api/classes/std.forwardlist.html)\n    - [VectorBoolean](https://samchon.github.io/tstl/api/classes/std.vectorboolean.html)\n  - **Associative Containers**\n    - *Tree-structured Containers*\n      - [TreeSet](https://samchon.github.io/tstl/api/classes/std.treeset.html)\n      - [TreeMultiSet](https://samchon.github.io/tstl/api/classes/std.treemultiset.html)\n      - [TreeMap](https://samchon.github.io/tstl/api/classes/std.treemap.html)\n      - [TreeMultiMap](https://samchon.github.io/tstl/api/classes/std.treemultimap.html)\n    - *Hash-buckets based Container*\n      - [HashSet](https://samchon.github.io/tstl/api/classes/std.hashset.html)\n      - [HashMultiSet](https://samchon.github.io/tstl/api/classes/std.hashmultiset.html)\n      - [HashMap](https://samchon.github.io/tstl/api/classes/std.hashmap.html)\n      - [HashMultiMap](https://samchon.github.io/tstl/api/classes/std.hashmultimap.html)\n  - **Adaptor Containers**\n    - *Linear Adaptors*\n      - [Queue](https://samchon.github.io/tstl/api/classes/std.queue.html)\n      - [Stack](https://samchon.github.io/tstl/api/classes/std.stack.html)\n      - [PriorityQueue](https://samchon.github.io/tstl/api/classes/std.priorityqueue.html)\n    - Associative Adaptors\n      - (experimental) [FlatSet](https://samchon.github.io/tstl/api/classes/std_experimental.flatset.html)\n      - (experimental) [FlatMultiSet](https://samchon.github.io/tstl/api/classes/std_experimental.flatmultiset.html)\n      - (experimental) [FlatMap](https://samchon.github.io/tstl/api/classes/std_experimental.flatmap.html)\n      - (experimental) [FlatMultiMap](https://samchon.github.io/tstl/api/classes/std_experimental.flatmultimap.html)\n\n### Algorithms\n- [`\u003calgorithm\u003e`](http://www.cplusplus.com/reference/algorithm/)\n    - [iterations](https://github.com/samchon/tstl/blob/master/src/algorithm/iterations.ts)\n    - [modifiers](https://github.com/samchon/tstl/blob/master/src/algorithm/modifiers.ts)\n    - [partitions](https://github.com/samchon/tstl/blob/master/src/algorithm/partitions.ts)\n    - [sortings](https://github.com/samchon/tstl/blob/master/src/algorithm/sortings.ts)\n    - [binary searches](https://github.com/samchon/tstl/blob/master/src/algorithm/binary_searches.ts)\n    - [union sets](https://github.com/samchon/tstl/blob/master/src/algorithm/union_sets.ts)\n    - [heaps](https://github.com/samchon/tstl/blob/master/src/algorithm/heaps.ts)\n    - [mathematics](https://github.com/samchon/tstl/blob/master/src/algorithm/mathematics.ts)\n\n### Functors\n  - [`\u003cexception\u003e`](http://www.cplusplus.com/reference/exception/)\n    - [Exception](https://samchon.github.io/tstl/api/classes/std.exception.html)\n      - [LogicError](https://samchon.github.io/tstl/api/classes/std.logicerror.html)\n      - [RuntimeError](https://samchon.github.io/tstl/api/classes/std.runtimeerror.html)\n  - [`\u003cfunctional\u003e`](http://www.cplusplus.com/reference/functional/)\n    - [IComparable](https://samchon.github.io/tstl/api/interfaces/std.icomparable.html)\n    - [IPointer](https://samchon.github.io/tstl/api/interfaces/std.ipointer.html)\n  - [`\u003cutility\u003e`](http://www.cplusplus.com/reference/utility/)\n    - [Pair](https://samchon.github.io/tstl/api/classes/std.pair.html)\n  - [`\u003cnumeric\u003e`](http://en.cppreference.com/w/cpp/numeric)\n    - [IComputable](https://github.com/samchon/tstl/blob/master/src/numeric/IComputable.ts)\n    - [operations](https://github.com/samchon/tstl/blob/master/src/numeric/operations.ts)\n    - [special math](http://en.cppreference.com/w/cpp/numeric/special_math)\n  - [`\u003cthread\u003e`](https://github.com/samchon/tstl/blob/master/src/thread.ts)\n    - [ConditionVariable](https://samchon.github.io/tstl/api/classes/std.conditionvariable.html)\n    - [Mutex](https://samchon.github.io/tstl/api/classes/std.mutex.html) \u0026 [TimedMutex](https://samchon.github.io/tstl/api/classes/std.timedmutex.html)\n    - [SharedMutex](https://samchon.github.io/tstl/api/classes/std.sharedmutex.html) \u0026 [SharedTimeMutex](https://samchon.github.io/tstl/api/classes/std.sharedtimedmutex.html)\n    - [Semaphore](https://samchon.github.io/tstl/api/classes/std.semaphore.html)\n    - [Latch](https://samchon.github.io/tstl/api/classes/std.latch.html)\n    - [Barrier](https://samchon.github.io/tstl/api/classes/std.barrier.html)\n\n\n\n\n## Installation\n### NPM Module\nInstalling **TSTL** in *NodeJS* is very easy. Just install with the `npm`\n\n```bash\n# Install TSTL from the NPM module\nnpm install --save tstl\n```\n\n### Usage\n``` typescript\nimport std from \"tstl\";\n\nfunction main(): void\n{\n    const map: std.TreeMap\u003cnumber, string\u003e = new std.TreeMap();\n\n    map.emplace(1, \"First\");\n    map.emplace(4, \"Fourth\");\n    map.emplace(5, \"Fifth\");\n    map.set(9, \"Nineth\");\n\n    for (const it of map)\n        console.log(it.first, it.second);\n\n    const it: std.TreeMap.Iterator\u003cnumber, string\u003e = map.lower_bound(3);\n    console.log(`lower bound of 3 is: ${it.first}, ${it.second}`);\n}\nmain();\n```\n\n\n\n\n## Appendix\n  - **Repositories**\n    - [GitHub Repository](https://github.com/samchon/tstl)\n    - [NPM Repository](https://www.npmjs.com/package/tstl)\n  - **Documents**\n    - [**Guide Documents**](https://github.com/samchon/tstl/wiki)\n    - [API Documents](https://samchon.github.io/tstl/api)\n    - [Release Notes](https://github.com/samchon/tstl/releases)\n  - **Extensions**\n    - [ASTL](https://github.com/samchon/astl) - C++ STL for AssemblyScript\n    - [ECol](https://github.com/samchon/ecol) - Collections dispatching events\n    - [**TGrid**](https://github.com/samchon/tgrid) - Network \u0026 Thread extension\n    - [Mutex-Server](https://github.com/samchon/mutex-server) - Critical sections in the network level\n","funding_links":["https://opencollective.com/tstl"],"categories":["TypeScript","algorithm","Built with TypeScript","Libraries","TypeScript 工具/库/框架"],"sub_categories":["Libraries","Data Structures","数据结构"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Ftstl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamchon%2Ftstl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Ftstl/lists"}