Check if your current js-runtime is node.js.
yarn add is-nodejs
# or
npm install is-nodejs --save
const isNodejs = require('is-nodejs')
import isNodejs from 'is-nodejs'
function isNodejs () {
return typeof process !== 'undefined' && !!process.versions && !!process.versions.node
}