Package Exports
- tstl
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tstl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
TypeScript-STL
GitHub Repository: https://github.com/samchon/tstl
Introduction
STL (Standard Template Library) Containers and Algorithms for TypeScript.
TypeScript-STL is an open-source JavaScript library providing containers and algorithms migrated from C++ STL. You can enjoy STL containers and algorithms in JavaScript. If TypeScript, you will be much happier feeling like using originla STL with type restriction and template programming.
Containers
- Linear containers
- Associative Containers
- Adaptor Containers
Global Functions
References
You can learn and explore about TSTL more deeply with such below:
Installation
Installing TSTL in node is very easy. Just install with npm and tsd.
Node
# Install TSTL from NPM modules
npm install --save tstl
# If you need only header, then fetch from the @types
npm install --save @types/tstl
TypeScript
/// <reference types="tstl" />
import std = require("tstl");
let map: std.TreeMap<string, number> = new std.TreeMap<string, number>();
map.insert(std.make_pair("First", 1));
map.insert(["Second", 2]);
map.insert_or_assign("Third", 3); // C++17 Feature.
map.set("Fourth", 4); // Non-standard Feature.
for (let it = map.begin(); !it.equals(map.end()); it = it.next())
console.log(it.first, it.second); // key => string, value => number
Browser
TSTL follows CommonJS module.
Use browserify or just include TSTL's js file with <script>
tag.
In HTML Document
<script src="tstl.js"></script>