{"bugs":{"url":" https://github.com/sheebz/phantom-proxy/issues","mail":"rob.schieber@gmail.com"},"dist":{"shasum":"2c347796ff7080a1341d51bb4fdd67f55dc78df2","tarball":"https://registry.npmjs.org/phantom-proxy/-/phantom-proxy-0.1.4.tgz","integrity":"sha512-HSh4YTGPlTFFgAVOIm7rtNaJG4coVxvsKYEev0+a0sn9Y1as4xbmfOUbV2jkNAmVcQ9JP79ar8aDZgmemSHQjA==","signatures":[{"sig":"MEUCIQCK9mEDfQIXHuL5kuXYaLA+KV6iBdN6pcBtuApex5q3rAIgTh4ImqW02NWk/YoK/v3JJR76Sgwu2jxfeXQB6qUp5Ps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","name":"phantom-proxy","author":{"url":"https://twitter.com/sheebz","name":"Rob Schieber","email":"rob.schieber@gmail.com"},"readme":"# phantom-proxy\nProvides a proxy interface for phantomjs which runs inside of node.  Now you can run phantom and access the full api from within nodejs.\n\n## Overview\nPhantomJs is an incredibly useful tool for functional and unit testing.  Problem is that it runs in its own process which is outside of node, so you are basically out of luck if you want to integrate with phantomjs from within node.  There are some other libraries - phantom-node, node-phantom, that address the same problem.  \n\n## Why do we need another nodejs runtime for phantom?\nPhantom-proxy takes a different approach to communicating with phantom than these modules.  Phantom-node passes messages using alerts and express.  While this was an ingenious solution to a difficult problem at the time, better solutions are now available.  As of version 1.4, phantomjs provides an embedded webserver called mongoose which can be used to pass messages.  Phantom-proxy leverages this, which is the fastst and most reliable approach.\n\n##Instalation\n`npm install phantom-proxy` \n\n##usage\n\n```javascript\nphantomProxy = require('phantom-proxy');\nphantomProxy.createProxy({}, function (proxy) {\n    proxy.page.onConsoleMessage = function (event) {\n        console.log(JSON.stringify(event));\n    };\n    proxy.page.open('http://www.google.com', function () {\n        proxy.page.waitForSelector('body', function () {\n            proxy.page.render('./scratch/loginTest.png', function () {\n                proxy.phantom.exit(function () {\n                    console.log('test complete');\n                });\n            });\n        });\n    });\n});\n```\n\n","engines":{"node":">0.6.0"},"private":false,"_npmUser":{"name":"sheebz","email":"rob.schieber@gmail.com"},"keywords":["phantom","phantomjs","phantom-node","node-phantom","feature","test","headless","webkit","cucumber"],"licenses":[{"url":"https://github.com/sheebz/phantom-proxy/blob/master/README.md","type":"MIT"}],"repository":{"url":"https://github.com/sheebz/phantom-proxy","type":"git"},"_npmVersion":"1.1.62","description":"A set of proxy objects for driving  phantomjs from node","directories":{"lib":"./lib","test":"./test","example":"./example"},"maintainers":[{"name":"sheebz","email":"rob.schieber@gmail.com"}],"dependencies":{"q":"~0.8.8","mime":"~1.2.7","colors":"~0.6.0-1","form-data":"~0.0.3","underscore":"~1.4.0"},"devDependencies":{"mocha":"~1.5.0","should":"~1.2.0","cucumber":">0.0.0"},"_id":"phantom-proxy@0.1.4","version":"0.1.4"}