face-api/src/env/isNodejs.ts

8 lines
293 B
TypeScript
Raw Normal View History

2020-08-18 13:54:53 +02:00
export function isNodejs(): boolean {
return typeof global === 'object'
&& typeof require === 'function'
&& typeof module !== 'undefined'
// issues with gatsby.js: module.exports is undefined
// && !!module.exports
&& typeof process !== 'undefined' && !!process.version
}