From 42e5c1996c129688598755aa1286aecbd89872ef Mon Sep 17 00:00:00 2001 From: Justin Schwartzenberger Date: Wed, 21 Dec 2016 17:20:21 -0800 Subject: [PATCH] Add more info about programmatic usage (#251) --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d8afc74a2..c02de1357 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,13 @@ require('ts-node').register({ /* options */ }) require('ts-node/register') ``` +This will register the TypeScript compiler for "on the fly" compilation support of `.ts` and `.tsx` files during the run +of the script. From here you can use `require` to bring in modules from TypeScript files: + +```js +var someModule = require('path_to_a_typescript_file'); +``` + ## License MIT