(name, opts)
| 546 | |
| 547 | return new(class { |
| 548 | constructor(name, opts) { |
| 549 | this.name = name |
| 550 | this.http = new Http(this) |
| 551 | this.data = null |
| 552 | this.dataFile = 'box.dat' |
| 553 | this.logs = [] |
| 554 | this.isMute = false |
| 555 | this.isNeedRewrite = false |
| 556 | this.logSeparator = '\n' |
| 557 | this.startTime = new Date().getTime() |
| 558 | Object.assign(this, opts) |
| 559 | this.log('', `🔔${this.name}, 开始!`) |
| 560 | } |
| 561 | |
| 562 | isNode() { |
| 563 | return 'undefined' !== typeof module && !!module.exports |