-
-
Notifications
You must be signed in to change notification settings - Fork 49
Home
GitHub Repository: https://github.com/samchon/typescript-stl
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.
-
Associative Containers
-
Adaptor Containers
You can learn and explore about TypeScript-STL more deeply with such below:
Installing TypeScript-STL in node is very easy. Just install with npm.
npm install -g typescript-stl
Don't forget to referencing header files, typescript-stl.d.ts
and node.d.ts
/// <reference path="node.d.ts" />
/// <reference path="typescript-stl.d.ts" />
import std = require("typescript-stl");
let list: std.List<string> = new std.List<string>();
If you want to use TypeScript-STL in pure JavaScript, importing is much easier.
However, it is not recommended because without TypeScript, you can't take advantage of enforcement of using type and template inspection. Note that, full name of STL is Standard Template Library.
var std = require("typescript-stl");
var list = new std.List();
TypeScript-STL follows CommonJS module. You can't use require
statement of RequireJS, which is following AMD module. Just include TypeScript-STL's js file with <script>
tag.
<script src="typescript-stl.js"></script>