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

cdnwhaaat

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cdnwhaaat - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

test/fixtures/test.js

4

bin/cdnwhaaat.js

@@ -24,2 +24,4 @@ #!/usr/bin/env node

sleep: argv.sleep || 3
});
}, function(err) {
if (err) throw err;
});

@@ -29,13 +29,22 @@ var shisha = require('shisha');

*/
function smoke(resources, currentTry, config) {
function smoke(resources, currentTry, config, callback) {
shisha.smoke(resources, function(report){
var failedResources = _.filter(report, function(resource){
var failedResources = _(report).filter(function(resource){
return !(resource.result);
})
}).map(function(item) {
item.url = item.url();
item.status = 200;
return item;
}).value();
if (Object.keys(failedResources).length) {
setTimeout(function(){
retry(failedResources, currentTry, config);
try {
retry(failedResources, currentTry, config, callback);
} catch (err) {
callback(err);
}
}, config.sleep * 1000)
} else {
callback();
console.log("All resources are on the CDN");

@@ -59,3 +68,3 @@ }

*/
function retry(failedResources, currentTry, config){
function retry(failedResources, currentTry, config, callback){
console.log("Attempting to verify everything is on the CDN (" + currentTry + ")");

@@ -67,3 +76,3 @@

currentTry += 1;
smoke(failedResources, currentTry, config);
smoke(failedResources, currentTry, config, callback);
}

@@ -95,7 +104,7 @@ }

*/
function run(dir, config) {
function run(dir, config, callback) {
var currentTry = 1;
getResources(dir, config).then(function(resources){
smoke(resources, currentTry, config);
smoke(resources, currentTry, config, callback);
}).done()

@@ -102,0 +111,0 @@ }

{
"name": "cdnwhaaat",
"version": "1.2.0",
"version": "1.2.1",
"description": "Check that your files are on the CDN.",
"main": "index.js",
"scripts": {
"test": "mocha"
"test": "mocha -t 4000"
},

@@ -38,4 +38,6 @@ "bin": {

"devDependencies": {
"mocha": "^2.0.1"
"chai": "^3.5.0",
"mocha": "^2.5.3",
"nock": "^8.1.0"
}
}
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