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

glob-watcher

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-watcher - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

test/fixtures/test.coffee

13

index.js
var gaze = require('gaze');
var EventEmitter = require('events').EventEmitter;
module.exports = function(glob, cb) {
module.exports = function(glob, opts, cb) {
var out = new EventEmitter();
var watcher = gaze(glob, function(err, rwatcher){
if (typeof opts === 'function') {
cb = opts;
opts = {};
}
var watcher = gaze(glob, opts, function(err, rwatcher){
rwatcher.on('all', function(evt, path, old){

@@ -27,3 +32,3 @@ var outEvt = {type: evt, path: path};

out.add = function(){
return watcher.add.call(watcher, arguments);
return watcher.add.apply(watcher, arguments);
};

@@ -36,2 +41,2 @@ out.remove = function(){

return out;
};
};
{
"name": "glob-watcher",
"description": "Watch globs",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "http://github.com/wearefractal/glob-watcher",

@@ -6,0 +6,0 @@ "repository": "git://github.com/wearefractal/glob-watcher.git",

@@ -33,3 +33,3 @@ var watch = require('../');

it('should return a valid file struct via vallback', function(done) {
it('should return a valid file struct via callback', function(done) {
var expectedName = join(__dirname, "./fixtures/stuff/test.coffee");

@@ -56,2 +56,21 @@ var fname = join(__dirname, "./fixtures/**/test.coffee");

});
it('should not return a non-matching file struct via callback', function(done) {
var expectedName = join(__dirname, "./fixtures/test123.coffee");
var fname = join(__dirname, "./fixtures/**/test.coffee");
fs.writeFileSync(expectedName, "testing");
var watcher = watch(fname, function(evt) {
throw new Error("Should not have been called! "+evt.path);
});
setTimeout(function(){
fs.writeFileSync(expectedName, "test test");
}, 200);
setTimeout(function(){
rimraf.sync(expectedName);
done();
}, 1500);
});
});
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