TypeScript Exports Module for Node.js
Long Story Short
const func = () => {
console.log('Hello World');
}
// Export for TypeScript module system
export default func;
// Export for Node.js module system, by doing this you can use `require` to import the module in Node.js
if (typeof module !== 'undefined') {
module.exports = Object.assign(func, module.exports)
}