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

docpad-plugin-cachr

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docpad-plugin-cachr - npm Package Compare versions

Comparing version 2.1.5 to 2.1.6

35

out/cachr.plugin.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.4.0
// Generated by CoffeeScript 1.6.2
var __hasProp = {}.hasOwnProperty,

@@ -6,4 +6,8 @@ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

module.exports = function(BasePlugin) {
var CachrPlugin, balUtil, fsUtil, pathUtil, request;
var CachrPlugin, TaskGroup, balUtil, eachr, fsUtil, pathUtil, request, safefs, _ref;
balUtil = require('bal-util');
safefs = require('safefs');
eachr = require('eachr');
TaskGroup = require('taskgroup').TaskGroup;
request = require('request');

@@ -13,7 +17,7 @@ pathUtil = require('path');

return CachrPlugin = (function(_super) {
__extends(CachrPlugin, _super);
function CachrPlugin() {
return CachrPlugin.__super__.constructor.apply(this, arguments);
_ref = CachrPlugin.__super__.constructor.apply(this, arguments);
return _ref;
}

@@ -35,2 +39,3 @@

var config, details, docpad, name;
docpad = this.docpad;

@@ -52,2 +57,3 @@ config = this.config;

var attempt, docpad, viaRequest;
docpad = this.docpad;

@@ -65,5 +71,5 @@ attempt = 1;

docpad.log('debug', "Cachr is gave up fetching [" + details.sourceUrl + "] to [" + details.cachePath + "]");
return balUtil.exists(details.cachePath, function(exists) {
return safefs.exists(details.cachePath, function(exists) {
if (exists) {
return balUtil.unlink(details.cachePath, function(err2) {
return safefs.unlink(details.cachePath, function(err2) {
return next(err);

@@ -80,3 +86,3 @@ });

docpad.log('debug', "Cachr fetched [" + details.sourceUrl + "] to [" + details.cachePath + "]");
return balUtil.writeFile(details.cachePath, body, function(err) {
return safefs.writeFile(details.cachePath, body, function(err) {
return next(err);

@@ -106,2 +112,3 @@ });

var cachr, templateData;
templateData = _arg.templateData;

@@ -120,2 +127,3 @@ cachr = this;

var cachr, cachrPath, config, docpad, failures, templateData, urlsToCache, urlsToCacheLength;
templateData = _arg.templateData;

@@ -133,14 +141,17 @@ cachr = this;

docpad.log('debug', "Cachr is caching " + urlsToCacheLength + " files...");
balUtil.ensurePath(cachrPath, function(err) {
safefs.ensurePath(cachrPath, function(err) {
var tasks,
_this = this;
if (err) {
return next(err);
}
tasks = new balUtil.Group(function(err) {
tasks = new TaskGroup().setConfig({
concurrency: 0
}).once('complete', function(err) {
docpad.log((failures ? 'warn' : 'debug'), 'Cachr finished caching', (failures ? "with " + failures + " failures" : ''));
return next();
});
balUtil.each(urlsToCache, function(details, sourceUrl) {
return tasks.push(function(complete) {
eachr(urlsToCache, function(details, sourceUrl) {
return tasks.addTask(function(complete) {
return cachr.cacheRemoteUrl(details, function(err) {

@@ -156,3 +167,3 @@ if (err) {

});
tasks.async();
tasks.run();
return this;

@@ -159,0 +170,0 @@ });

{
"name": "docpad-plugin-cachr",
"version": "2.1.5",
"version": "2.1.6",
"description": "Caches remote resources locally",

@@ -33,6 +33,9 @@ "homepage": "http://docpad.org/plugin/cachr",

"request": "~2.16.6",
"bal-util": "~1.18.0"
"bal-util": "~2.0.2",
"safefs": "~3.0.1",
"eachr": "~2.0.2",
"taskgroup": "~3.1.1"
},
"devDependencies": {
"coffee-script": "~1.4.0"
"coffee-script": "~1.6.2"
},

@@ -39,0 +42,0 @@ "main": "./out/cachr.plugin.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