index.js 390 B

123456789101112131415
  1. var bench = require('nanobench');
  2. var path = require('path');
  3. var fs = require('fs');
  4. var insert = require('../');
  5. bench('jquery', function (b) {
  6. var source = fs.readFileSync(path.join(__dirname, 'jquery-3.3.1.js'));
  7. b.start();
  8. var stream = insert();
  9. stream.on('data', function() {});
  10. stream.on('end', function () {
  11. b.end();
  12. });
  13. stream.end(source);
  14. });