gulp-watch-jade
Advanced tools
Comparing version 1.0.0 to 1.0.1
23
index.js
'use strict'; | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var glob = require('glob'); | ||
var es = require('event-stream'); | ||
@@ -53,5 +55,26 @@ var vinyl = require('vinyl-file'); | ||
var mtime_cache = {}; | ||
stream = es.through(function (file) { | ||
var abs_path = path.resolve(file.path); | ||
try { | ||
// Prevent unchanged files from triggering | ||
var mtime = fs.statSync(abs_path).mtime.getTime(); | ||
var last_mtime = mtime_cache[abs_path]; | ||
mtime_cache[abs_path] = mtime; | ||
if (last_mtime === mtime) { | ||
return; | ||
} | ||
if (!last_mtime) { | ||
// Initial scan, skip dependency graph | ||
add_file(abs_path, file); | ||
return; | ||
} | ||
} catch (e) { | ||
// File might be gone. | ||
} | ||
add_file(abs_path, file); | ||
dependency.file_changed(abs_path); | ||
@@ -58,0 +81,0 @@ dependency.find_dependents(abs_path).map(add_path); |
{ | ||
"name": "gulp-watch-jade", | ||
"description": "Find jade files that are affected by dependencies for use with gulp-watch", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "https://github.com/lishid/gulp-watch-jade", | ||
@@ -18,2 +18,3 @@ "repository": "git://github.com/lishid/gulp-watch-jade.git", | ||
"event-stream": "^3.3.2", | ||
"glob": "^7.0.3", | ||
"jade-dependency": "^1.0.1", | ||
@@ -20,0 +21,0 @@ "vinyl-file": "^2.0.0" |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
5762
67
4
2
+ Addedglob@^7.0.3