I am learning node.js in Visual Studio 2017.
I have this class in it's own file called "logger.ts":
export default class Logger {
log(data)
{
console.log(data);
}
}
I then try to use that in my node project:
declare var require;
var Logger = require('./logger.js');
var anInstance = new Logger();
anInstance.log('test');
I get the error "Logger is not a function".
How am I supposed to do this?
jsfile in the node project but the class is defined in atsfile.jswhen requiring. And you might wanna check out import statements :-)