Socket
Socket
Sign inDemoInstall

paparazzi-cli

Package Overview
Dependencies
67
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.3.1

.travis.yml

29

index.js

@@ -5,2 +5,3 @@ #!/usr/bin/env node

const URL = require('url').URL;
const lib = require("./lib");

@@ -69,4 +70,4 @@ let browser;

try {
await screenshot(page, q.pop(), args);
await addLinks(page, q, allowedHosts, args);
await lib.screenshot(page, q.pop(), args);
await lib.addLinks(page, q, allowedHosts, args);
} catch (e) {

@@ -81,26 +82,2 @@ throw e;

async function screenshot(page, url, args) {
console.log(`Snapping ${url}`);
let fileName = url.replace(/\//g, '_');
await page.goto(url);
await page.waitFor(args.delay);
await page.screenshot({ path: `${args.output}/${fileName}.png`, type: 'png', fullPage: args.fullPage });
}
async function addLinks(page, q, allowedHosts, args) {
//Get all the links on the page, ignore empty href.
let links = await page.$$eval('a', al => { return al.map(a => a.href).filter(a => a)});
for (let l of links) {
try {
let ul = new URL(l);
if (args.allowAllHosts || allowedHosts.includes(ul.hostname.stripPrefix('www.').trim())) {
q.push(l);
}
} catch (e) {
console.log(`Could not parse ${l}, skipping.`)
}
}
}
let argv = require('yargs')

@@ -107,0 +84,0 @@ .usage('Usage: $0 [options] <URL1> [<URL2> ...]')

{
"name": "paparazzi-cli",
"version": "0.3.0",
"version": "0.3.1",
"description": "CLI tool to snap all the angles of your website",

@@ -14,2 +14,5 @@ "main": "index.js",

],
"scripts": {
"test": "nyc -x **/*.spec.js mocha **/*.spec.js"
},
"dependencies": {

@@ -21,3 +24,7 @@ "puppeteer": "^1.14.0",

"paparazzi": "./index.js"
},
"devDependencies": {
"chai": "^4.2.0",
"sinon": "^7.3.1"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc