A tool for Require typescript modules in node.
Installation
npm install require-typescript-module --save
Usage
// config.ts
export default {
name: 'config'
}
const { requireTypescriptModule } = require('require-typescript-module');
const path = require('path');
const config = requireTypescriptModule(path.resolve(__dirname, './config.ts')); // { name: 'config' }