A quick test, this relies on the fact that this
will not exist and point to the global scope when running in strict mode.
console.log('strict:',(function() { return (this === undefined); })());
Tip
Strict mode is enabled by default within ES module enabled packages.
In package.json
:
{
"type": "module"
}