Use absence of 'window' to detect Node.js since 'require' will be present in the browser when using browserify or another module loader/bundler. Also move import inside in case JSZip hasn't been loaded yet, and use another name so the global isn't masked.