(bundle, opts)
| 163 | }) |
| 164 | |
| 165 | const formatted = (bundle, opts) => new Promise((resolve, reject) => { |
| 166 | try { |
| 167 | const analysis = analyzer(bundle, opts) |
| 168 | return resolve(reporter(analysis, opts)) |
| 169 | } catch (ex) { return resolve(ex.toString()) } |
| 170 | }) |
| 171 | |
| 172 | const plugin = (opts = {}) => { |
| 173 | const writeTo = opts.writeTo || (opts.stdout ? console.log : console.error) |