0.1.7 • Published 3 years ago

@weichwarenprojekt/ts-importer v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Quickstart

Ts importer is a small library that allows you to load typescript files at runtime.

Installation

npm i --save-dev @weichwarenprojekt/ts-importer

Usage

The library only offers the "loadModule" function. You can simply call it like this:

import { loadModule } from "@weichwarenprojekt/ts-importer";

loadModule("/absolute/path/to/the/module.ts");

In case you have special requirements you can also override the transpileOptions for the typescript transpiler by providing the TranspileOptions as second parameter:

import { loadModule } from "@weichwarenprojekt/ts-importer";
import { ScriptTarget } from "typescript";

loadModule("/absolute/path/to/the/module.ts", {
    compilerOptions: { target: ScriptTarget.ES2016, module: ModuleKind.CommonJS },
    fileName: "whatever",
});
0.1.7

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago