require()
Get underlying CommonJS/ES6 module with Simple function to determine whether a require()
'd object is an ES6 module, and return its .default
implementation if so.
Written in Typescript.
How to use
Simply wrap any call to require
to get the underlying module:
meaningOfLife.ts
; ;
; // Doesn't matter if `require` uses `module.exports` or ES6 exports; // 42
License
MIT