Handle NodeJS and browser support