https://github.com/richienb/import-typescript
Import Typescript on the fly.
https://github.com/richienb/import-typescript
Last synced: 4 months ago
JSON representation
Import Typescript on the fly.
- Host: GitHub
- URL: https://github.com/richienb/import-typescript
- Owner: Richienb
- License: mit
- Created: 2020-09-19T03:44:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-19T05:27:50.000Z (over 5 years ago)
- Last Synced: 2025-08-24T14:41:33.299Z (5 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# import-typescript [](https://travis-ci.com/Richienb/import-typescript)
Import Typescript on the fly.
[](https://npmjs.com/package/import-typescript)
## Install
```sh
npm install import-typescript
```
## Usage
```js
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.