Skip to content
Steve4448 edited this page Oct 16, 2014 · 11 revisions

Introduction

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.

Getting Started

There's a few ways to start using typeinclude, dependant on what you need.

Inclusion in JavaScript

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:

myTypeScriptClass.someMethod();```

### 'Booting' in JavaScript
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");```

### Loading from Command-Line
Finally you can load your TypeScript file from command-line with:

`nodets index.ts`
Clone this wiki locally