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

watchify

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

watchify - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

37

index.js
var through = require('through2');
var fs = require('fs');
var path = require('path');
var chokidar = require('chokidar');
var xtend = require('xtend');
module.exports = watchify;
module.exports.args = {
cache: {}, packageCache: {}, fullPaths: true
cache: {}, packageCache: {}
};

@@ -18,11 +18,21 @@

b.on('dep', function (dep) {
if (typeof dep.id === 'string') {
cache[dep.id] = dep;
}
if (typeof dep.file === 'string') {
watchFile(dep.file);
}
});
b.on('reset', collect);
collect();
function collect () {
b.pipeline.get('deps').push(through.obj(function(row, enc, next) {
if (cache) {
cache[row.file] = {
id: row.file,
source: row.source,
deps: xtend({}, row.deps),
file: row.file
};
}
watchFile(row.file);
this.push(row);
next();
}));
}
b.on('file', function (file) {

@@ -73,9 +83,2 @@ watchFile(file);

function watchFile (file) {
fs.lstat(file, function (err, stat) {
if (err || stat.isDirectory()) return;
watchFile_(file);
});
}
function watchFile_ (file) {
if (!fwatchers[file]) fwatchers[file] = [];

@@ -82,0 +85,0 @@ if (!fwatcherFiles[file]) fwatcherFiles[file] = [];

{
"name": "watchify",
"version": "2.4.0",
"version": "2.5.0",
"description": "watch mode for browserify builds",

@@ -10,3 +10,4 @@ "main": "index.js",

"chokidar": "~0.12.1",
"through2": "~0.5.1"
"through2": "~0.5.1",
"xtend": "^4.0.0"
},

@@ -13,0 +14,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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