Comparing version 2.3.1 to 2.4.0
@@ -1,10 +0,5 @@ | ||
// builtin | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var walk = require('walk').walk; | ||
// handle simple flow control | ||
var after = require('after'); | ||
// handle async helpers | ||
var async = require('./async'); | ||
@@ -26,3 +21,3 @@ | ||
this.Utils = this.handlebars.Utils; | ||
} | ||
}; | ||
@@ -115,3 +110,3 @@ // express 3.x template engine compliance | ||
layout_filename += extension; | ||
}; | ||
} | ||
@@ -144,3 +139,3 @@ var layout_template = cache[layout_filename]; | ||
// express 2.x template engine compliance | ||
Instance.prototype.compile = function (str, options) { | ||
Instance.prototype.compile = function (str) { | ||
if (typeof str !== 'string') { | ||
@@ -180,4 +175,5 @@ return str; | ||
if (!err) { | ||
var templateName = path.basename(filepath, path.extname(filepath)); | ||
templateName = templateName.replace(/[ -]/g, '_'); | ||
var ext = path.extname(filepath); | ||
var templateName = path.relative(directory, filepath) | ||
.slice(0, -(ext.length)).replace(/[ -]/g, '_'); | ||
handlebars.registerPartial(templateName, data); | ||
@@ -190,13 +186,6 @@ } | ||
fs.readdir(directory, function(err, filenames) { | ||
if (err) { | ||
return done(err); | ||
} | ||
walk(directory).on('file', function(root, stat, next) { | ||
register(path.join(root, stat.name), next); | ||
}).on('end', done || function() {}); | ||
var next = after(filenames.length, done || function() {}); | ||
filenames.forEach(function(filename) { | ||
register(path.join(directory, filename), next); | ||
}); | ||
}); | ||
}; | ||
@@ -212,3 +201,3 @@ | ||
module.exports.create = function() { | ||
return new Instance(); | ||
return new Instance(); | ||
}; |
{ | ||
"name": "hbs", | ||
"description": "Express.js template engine plugin for Handlebars", | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"homepage": "https://github.com/donpark/hbs", | ||
@@ -13,3 +13,3 @@ "author": "Don Park <donpark@docuverse.com> (http://blog.docuverse.com)", | ||
"handlebars": "1.0.12", | ||
"after": "0.8.1" | ||
"walk": "2.2.1" | ||
}, | ||
@@ -16,0 +16,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14753
288
+ Addedwalk@2.2.1
+ AddedforEachAsync@2.2.1(transitive)
+ Addedsequence@2.2.1(transitive)
+ Addedwalk@2.2.1(transitive)
- Removedafter@0.8.1
- Removedafter@0.8.1(transitive)