0.1.1 • Published 10 years ago

nightmare-hook v0.1.1

Weekly downloads
9
License
-
Repository
-
Last release
10 years ago

nightmare-hook

Hook into each nightmare action and emit events with useful information about the current state.

Installation

$ npm install nightmare-hook

Usage

Nightmare = events(Nightmare)
var nightmare = new Nightmare

var emit = hook(nightmare)

// will get called after .viewport()
emit('viewport', function () {
  return this.page.viewportSize
})

nightmare
  .goto('http://google.com')
  .viewport('1000', '1000')
  .run(function (err, nightmare) {
    if (err) throw err;
  })

License

MIT