How do I load a regular NodeJS module (from node_modules
) from within a TypeScript
class?
When I try to compile .ts
file that contains:
var sampleModule = require('modulename');
Compiler prompts that I can't use require in this scope. (That line is at the beginning of the file).