0.1.7 • Published 2 years ago

@weichwarenprojekt/ts-importer v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

0.1.6

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago