Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

import-typescript

Richienb7MIT1.0.0TypeScript support: included

Import Typescript on the fly.

typescript, import, module, file

readme

import-typescript Travis CI Build Status

Import Typescript on the fly.

NPM Badge

Install

npm install import-typescript

Usage

const importTs = require("import-typescript")
const foo = importTs("./foo.ts")

foo()

API

importTypescript(moduleId, options?)

moduleId

Type: string

The module id.

options

Type: object

cache

Type: boolean\ Default: true

Whether to cache the transpiled code.