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

crushit

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crushit - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

50

lib/crushit.js

@@ -6,3 +6,3 @@

var request = require('request'),
var http = require('http'),
cheerio = require('cheerio'),

@@ -65,10 +65,10 @@ uglify = require('uglify-js'),

if (err) {
callback(err, '');
callback(err, '');
}
else {
self.scripts = scripts;
if (self.externalScripts) {
self.echoMsg('Preparing to download external scripts....');
}
self.loadScripts();
self.scripts = scripts;
if (self.externalScripts) {
self.echoMsg('Preparing to download external scripts....');
}
self.loadScripts();
}

@@ -94,4 +94,10 @@ });

request(website, function (err, response, body) {
if (!err && response.statusCode === 200) {
http.get(website, function (res) {
var body = '';
res.on('data', function (chunk) {
body += chunk;
});
res.on('end', function () {
var $ = cheerio.load(body);

@@ -121,6 +127,6 @@

fn(false, scripts);
}
else {
fn(err);
}
});
})
.on('error', function (err) {
fn(err);
});

@@ -143,4 +149,10 @@ },

request(parsedUrl, function (error, response, script) {
if (!error && response.statusCode === 200) {
http.get(parsedUrl, function (res) {
var script = '';
res.on('data', function (chunk) {
script += chunk;
});
res.on('end', function () {
if (flag) {

@@ -154,5 +166,7 @@ self.echoMsg('Success: Loaded url without pathname: ' + parsedUrl);

fn(false, script);
}
});
})
.on('error', function (error) {
// Try again using base url without pathname
else if (!flag) {
if (!flag) {
self.echoMsg('failed to load ' + parsedUrl + '\n Try again using base url without pathname');

@@ -164,3 +178,3 @@ self.loadScript(urlStr, website, fn, true);

fn(error, '');
}
}
});

@@ -167,0 +181,0 @@ },

{
"name": "crushit",
"version": "0.3.4",
"version": "0.3.5",
"description": "CrushIt is a commandline tool for crawling web pages and compiling scripts",

@@ -29,3 +29,2 @@ "homepage": "http://qawemlilo.github.io/crushit/",

"dependencies": {
"request": "~2.34.0",
"cheerio": "~0.13.1",

@@ -32,0 +31,0 @@ "uglify-js": "~2.4.12",

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