-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Steve4448 edited this page Oct 16, 2014
·
11 revisions
node-typeinclude is a NPM package that can be installed with npm install -g typeinclude
.
This library, typeinclude, allows you to include TypeScript files at runtime without needing to re-compile every time you need to change something.
There's a few ways to start using typeinclude, dependant on what you need.
To start using typescript in JavaScript, all that's required is to require the module;
var typeinclude = require("typeinclude");
after which you can start including your TypeScript scripts and just call their functionality:
var myTypeScriptClass = typeinclude("./myTypeScriptClass.ts");
myTypeScriptClass.someMethod();
You can 'boot'/load a TypeScript file in JavaScript is to require typeinclude and include your TypeScript file:
var typeinclude = require("typeinclude");
typeinclude("index.ts");
Finally you can load your TypeScript file from command-line with:
nodets index.ts