0.1.7 • Published 1 year ago

@weichwarenprojekt/ts-importer v0.1.7

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

1 year ago

0.1.6

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.5

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago