github.com/igggame/nebulas-go@v2.1.0+incompatible/nf/nvm/v8/test/node_instruction_counter.js (about)

     1  #!/usr/bin/env node
     2  
     3  const fs = require('fs');
     4  const instCounter = require('../lib/instruction_counter.js');
     5  
     6  function help() {
     7      console.log('JS file missing.');
     8  };
     9  
    10  if (process.argv.length < 3) {
    11      help();
    12      return;
    13  }
    14  
    15  var source_file = process.argv[2];
    16  fs.readFile(source_file, (err, data) => {
    17      if (err) throw err;
    18      var source = data.toString();
    19      var ret = instCounter.processScript(source);
    20      console.log(ret.traceableSource);
    21  });