javascrript-convert-to-nodejs

原始页面的js如下: 
!function (t, e) {
  t.CryptoJS = e()
}(this, function () { /* 内部核心逻辑 */ })

改为nodejs: 
// 1. 判断是否为Node.js环境,若为Node.js则导出,否则挂载到window
const root = typeof module !== 'undefined' && module.exports ? module.exports : window;

!function (t, e) {
  t.CryptoJS = e()
}(root, function () { /* 内部核心逻辑(保持不变) */ })


webstorm内调用: 
const CryptoJS = require('./crypto-js.js');