Skip to content

Release 0.0.9

Compare
Choose a tag to compare
@miniflycn miniflycn released this 15 Sep 12:23
· 76 commits to master since this release
  • There are two config now, one is global config, another is job config.
  • global config can be used by .opt
  var urlExtract = require('../');

  urlExtract.opt({
    viewportSize: {
      width: 800, 
      height: 400
    },
    clipRect: {
      top: 0, 
      left: 0, 
      width: 800, 
      height: 400 
    }
  });
  urlExtract.snapshot('http://www.baidu.com', function (job) {
    console.log('This is a snapshot example.');
    console.log(job);
    process.exit();
  });

* job config can be used by .extract or .snapshot
```js
  var urlExtract = require('../');

  urlExtract.snapshot('http://www.baidu.com', {
    viewportSize: {
      width: 800, 
      height: 400
    },
    clipRect: {
      top: 0, 
      left: 0, 
      width: 800, 
      height: 400 
    },
    callback: function (job) {
      console.log('This is a snapshot example.');
      console.log(job);
      process.exit();
    }
  });