{"_id":"smartlook-node-slimerjs","_rev":"27-4f5653006e8435c0156943cb7628a56e","name":"smartlook-node-slimerjs","description":"Simple and reliable bridge between Node.js and SlimerJS","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"author":{"name":"Mango Tools","url":" info@mango.tools"},"name":"smartlook-node-slimerjs","description":"Simple and reliable bridge between Node.js and SlimerJS","version":"1.0.1","homepage":"https://github.com/MangoTools/node-slimerjs","repository":{"type":"git","url":"git+ssh://git@github.com/MangoTools/node-slimerjs.git"},"main":"node-slimerjs.js","scripts":{"test":"./run_tests"},"dependencies":{},"devDependencies":{"nodeunit":""},"optionalDependencies":{},"engines":{"node":"*"},"gitHead":"54884d67e8cac7a91e4944011776dd599e483a28","bugs":{"url":"https://github.com/MangoTools/node-slimerjs/issues"},"_id":"smartlook-node-slimerjs@1.0.1","_shasum":"f91b22f995d52fcdc1983c855683a7777ada6ee9","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"acro","email":"acrocz@gmail.com"},"dist":{"shasum":"f91b22f995d52fcdc1983c855683a7777ada6ee9","tarball":"https://registry.npmjs.org/smartlook-node-slimerjs/-/smartlook-node-slimerjs-1.0.1.tgz","integrity":"sha512-hk/ane0/+eWTh9Ro/vCT26/LKq9G2MBkTppxe0tfxX/dB93oSzWYRiLOVwtwbp1XLN2/YZ0p8gwPw4xkmSPf2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBlIAfVOpUfOVAlwCNZkTkLYrKjrg3LmXQwdFMJ6A8XwIgcyGtn0KJ0Ibi397m7yCraFyzTUQ/YjQ6zlB6zlqZ11s="}]},"maintainers":[{"name":"acro","email":"acrocz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/smartlook-node-slimerjs-1.0.1.tgz_1488271337821_0.8623853132594377"},"directories":{}},"1.0.2":{"author":{"name":"Mango Tools","url":" info@mango.tools"},"name":"smartlook-node-slimerjs","description":"Simple and reliable bridge between Node.js and SlimerJS","version":"1.0.2","homepage":"https://github.com/Acro/node-slimerjs","repository":{"type":"git","url":"git+ssh://git@github.com/Acro/node-slimerjs.git"},"main":"node-slimerjs.js","scripts":{"test":"./run_tests"},"dependencies":{},"devDependencies":{"nodeunit":""},"optionalDependencies":{},"engines":{"node":"*"},"gitHead":"54884d67e8cac7a91e4944011776dd599e483a28","bugs":{"url":"https://github.com/Acro/node-slimerjs/issues"},"_id":"smartlook-node-slimerjs@1.0.2","_shasum":"3b65818f185fd0af314cc2a5ded48bdfae44cb80","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"acro","email":"acrocz@gmail.com"},"dist":{"shasum":"3b65818f185fd0af314cc2a5ded48bdfae44cb80","tarball":"https://registry.npmjs.org/smartlook-node-slimerjs/-/smartlook-node-slimerjs-1.0.2.tgz","integrity":"sha512-YFwMF3T4bFeAVsKs5toQpGWbE7PaY185ymWyptlSWw4wIDywth+VjwrDDXbZDxcMSf8pC3eiR0GrdxE8MJLygA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrN57Y5ztTaM7M3fI8uFhHldRzeccNJrt9LsaqPA66jgIgW7E/egdVKci/QI0HsO3+PZrevaynDSuLt/FwK8r0rng="}]},"maintainers":[{"name":"acro","email":"acrocz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/smartlook-node-slimerjs-1.0.2.tgz_1488271393310_0.5795976822264493"},"directories":{}},"1.0.3":{"author":{"name":"Mango Tools","url":" info@mango.tools"},"name":"smartlook-node-slimerjs","description":"Simple and reliable bridge between Node.js and SlimerJS","version":"1.0.3","homepage":"https://github.com/Acro/node-slimerjs","repository":{"type":"git","url":"git+ssh://git@github.com/Acro/node-slimerjs.git"},"main":"node-slimerjs.js","scripts":{"test":"./run_tests"},"dependencies":{},"devDependencies":{"nodeunit":""},"optionalDependencies":{},"engines":{"node":"*"},"gitHead":"88a737028312a838e1a434519677c3f4e70a5900","bugs":{"url":"https://github.com/Acro/node-slimerjs/issues"},"_id":"smartlook-node-slimerjs@1.0.3","_shasum":"c1d10bea7077925f666d36508cbad7be3de98c34","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"acro","email":"acrocz@gmail.com"},"dist":{"shasum":"c1d10bea7077925f666d36508cbad7be3de98c34","tarball":"https://registry.npmjs.org/smartlook-node-slimerjs/-/smartlook-node-slimerjs-1.0.3.tgz","integrity":"sha512-WRoKpioRZ8yozN6Y7s9vKqre+eE+5hH3R5t45pooqy1DcI5kS9/IU4KAK4oPyIOPPP/OmRA7/jTpsxejYAMe6A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRJmiQj30C/D23SZq50SDv6C7ViRgNVu7936ghsVgDoQIhANNsVFOldoTed9z2+mG+dtGomSdqkYr8X7VPIbQiOTau"}]},"maintainers":[{"name":"acro","email":"acrocz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/smartlook-node-slimerjs-1.0.3.tgz_1488271857003_0.4571602384094149"},"directories":{}},"1.0.4":{"author":{"name":"Mango Tools","url":" info@mango.tools"},"name":"smartlook-node-slimerjs","description":"Simple and reliable bridge between Node.js and SlimerJS","version":"1.0.4","homepage":"https://github.com/Acro/node-slimerjs","repository":{"type":"git","url":"git+ssh://git@github.com/Acro/node-slimerjs.git"},"main":"node-slimerjs.js","scripts":{"test":"./run_tests"},"dependencies":{},"devDependencies":{"nodeunit":""},"optionalDependencies":{},"engines":{"node":"*"},"gitHead":"45e4d91b029ee49a801ff127e3bb102a694de9fc","bugs":{"url":"https://github.com/Acro/node-slimerjs/issues"},"_id":"smartlook-node-slimerjs@1.0.4","_shasum":"91f612280bc852eaa89757acfe0e0f7ce66a5197","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"acro","email":"acrocz@gmail.com"},"dist":{"shasum":"91f612280bc852eaa89757acfe0e0f7ce66a5197","tarball":"https://registry.npmjs.org/smartlook-node-slimerjs/-/smartlook-node-slimerjs-1.0.4.tgz","integrity":"sha512-PRqvTK22fDf1pnvmmTG41+3b3lfcTHbBgvY0qhilqoXCiwaEvG1IWrxOOFqen14dYuPO2yMGeaN+/rCCBisStQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFjXardVX7TMGmMoQZkAMVPXkOsqVXqprv+AdSf7oFkPAiAxHhEvkNK5rPFL9GAKbKJnKnVajCDWRxi+5CSOzn7WbA=="}]},"maintainers":[{"name":"acro","email":"acrocz@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/smartlook-node-slimerjs-1.0.4.tgz_1488271988455_0.6599995011929423"},"directories":{}}},"readme":"# node-slimerjs\n\n\n---------------\n\nThis is a bridge between [SlimerJs](http://slimerjs.org/) and\n[Node.js](http://nodejs.org/).\n\nThis project is inspired from the excellent [node-phantom-simple](https://github.com/baudehlo/node-phantom-simple) project.\n\n\n\nRequirements\n------------\nYou will need to install SlimerJS first. The bridge assumes that the\n\"slimerjs\" binary is available in the PATH, or you will need to pass its path\ninto the `slimer.create() method.\n\nFor running the tests you will need [Expresso](http://visionmedia.github.com/expresso/).\nThe tests require SlimerJS 0.9.2 or newer to pass.\n\nInstalling\n----------\n\n    npm install node-slimerjs\n\n\nUsage\n-----\nYou can use it exactly like you would use Node-Phantom, and the entire API of\nSlimerJs should work, with the exception that every method call takes a\ncallback (always as the last parameter) instead of returning values.\n\nFor example this is an adaptation of a\n[web scraping example](http://net.tutsplus.com/tutorials/javascript-ajax/web-scraping-with-node-js/) :\n\n```javascript\nvar slimer =require('node-slimerJs');\nslimer.create(function(err,ph) {\n  return sl.createPage(function(err,page) {\n    return page.open(\"http://tilomitra.com/repository/screenscrape/ajax.html\", function(err,status) {\n      console.log(\"opened site? \", status);\n      page.includeJs('http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', function(err) {\n        //jQuery Loaded.\n        //Wait for a bit for AJAX content to load on the page. Here, we are waiting 5 seconds.\n        setTimeout(function() {\n          return page.evaluate(function() {\n            //Get what you want from the page using jQuery. A good way is to populate an object with all the jQuery commands that you need and then return the object.\n            var h2Arr = [],\n            pArr = [];\n            $('h2').each(function() {\n              h2Arr.push($(this).html());\n            });\n            $('p').each(function() {\n              pArr.push($(this).html());\n            });\n\n            return {\n              h2: h2Arr,\n              p: pArr\n            };\n          }, function(err,result) {\n            console.log(result);\n            ph.exit();\n          });\n        }, 5000);\n      });\n\t});\n  });\n});\n```\n\n### slimer.create(callback, options)\n\n`options` is an optional object with options for how to start PhantomJS.\n`options.parameters` is an array of parameters that will be passed to PhantomJS\non the commandline.\n\nFor example\n\n```javascript\nslimer.create(callback, {parameters: {'load-images': 'yes'}})\n```\n\nwill start slimer as:\n\n```bash\nslimerjs --load-images=yes\n```\n\nYou may also pass in a custom path if you need to select a specific instance\nof PhantomJS or it is not present in PATH environment. This can for example\nbe used together with the [SlimerJS package](https://npmjs.org/package/slimerjs)\nlike so:\n\n```javascript\nslimer.create(callback, {slimerPath: require('slimerjs').path})\n```\n\n\n`options.ignoreErrorPattern` is a regular expression that can be used to silence spurious\nwarnings generated by slimerJs.\n\nOn Mavericks, you can use: `{ignoreErrorPattern: /CoreText/}` to suppress some common annoying font-related warnings.\n\nWebPage Callbacks\n-----\n\nAll of the WebPage callbacks have been implemented including `onCallback`, and\nare set the same way as with the core slimerJs library:\n\n```javascript\npage.onResourceReceived = function(response) {\n    console.log('Response (#' + response.id + ', stage \"' + response.stage + '\"): ' + JSON.stringify(response));\n};\n```\n\nThis includes the `onPageCreated` callback which receives a new `page` object.\n\nProperties\n-----\n\nProperties on the [WebPage](https://github.com/laurentj/slimerjs)\nand [SlimerJs](https://github.com/laurentj/slimerjs)\nobjects are accessed via the `get()/set()` method calls:\n\n```javascript\npage.get('content', function (err,html) {\n  console.log(\"Page HTML is: \" + html);\n})\npage.set('zoomfactor', 0.25, function () {\n  page.render('capture.png');\n})\n```\n\nLicense - MIT\n-----\n\nCopyright (c) 2013 Matt Sergeant\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n\nOther\n-----\nMade by Jean-Baptiste Blanc for [Mango Tools](http://mango.tools).\nMade by Adrien Boscfor [Mango Tools](http://mango.tools).\n","maintainers":[{"email":"smartlook.npm@cisco.com","name":"smartlook.npm"},{"email":"martin.budinsky@smartlook.com","name":"c0mtru1se"},{"email":"sami@aldury.com","name":"samialdury"},{"email":"jakubpetriska@gmail.com","name":"jakubpetriska"},{"email":"pajkycz@gmail.com","name":"pjk"},{"email":"david@smartlook.com","name":"amertak"},{"email":"acrocz@gmail.com","name":"acro"},{"email":"honzicekz@gmail.com","name":"janzal"},{"email":"vojacem@gmail.com","name":"millcek"},{"email":"32jojo32@gmail.com","name":"joozty"},{"email":"petr.klobas@gmail.com","name":"klobinoid"}],"time":{"modified":"2024-01-09T12:23:16.645Z","created":"2017-02-28T08:42:26.777Z","1.0.1":"2017-02-28T08:42:26.777Z","1.0.2":"2017-02-28T08:43:22.260Z","1.0.3":"2017-02-28T08:51:05.960Z","1.0.4":"2017-02-28T08:53:19.503Z"},"homepage":"https://github.com/Acro/node-slimerjs","repository":{"type":"git","url":"git+ssh://git@github.com/Acro/node-slimerjs.git"},"author":{"name":"Mango Tools","url":" info@mango.tools"},"bugs":{"url":"https://github.com/Acro/node-slimerjs/issues"},"readmeFilename":"README.md"}