Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@coya/puppy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coya/puppy - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

15

index.js

@@ -11,2 +11,4 @@ const fs = require('fs');

let screenshotsFolder = '';
let proxy = null;
let displayConsole = false;

@@ -43,2 +45,7 @@ const browserOptions = {

if(options.screenshotsFolder) screenshotsFolder = options.screenshotsFolder;
if(options.proxy) {
proxy = options.proxy;
browserOptions.args.push('--proxy-server=' + proxy.url);
}
if(options.displayConsole) displayConsole = true;
return await puppeteer.launch(Object.assign(browserOptions, options));

@@ -54,2 +61,3 @@ }

if (cookiesFile) await loadCookies(page, cookiesFile);
if (proxy && proxy.username && proxy.password) await page.authenticate(proxy);
process.on('unhandledRejection', (error) => {

@@ -59,5 +67,6 @@ logger.error(error);

});
page.on('console', (msg) => {
for (let i = 0; i < msg.args().length; ++i) logger.info(`${i}: ${msg.args()[i]}`);
});
if(displayConsole)
page.on('console', (msg) => {
for (let i = 0; i < msg.args().length; ++i) logger.info(`${i}: ${msg.args()[i]}`);
});
logger.debug('Page created.');

@@ -64,0 +73,0 @@ return page;

2

package.json
{
"name": "@coya/puppy",
"version": "0.0.2",
"version": "0.1.0",
"description": "Utility methods for better handle of Puppeteer",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc