This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

View File

@@ -1,48 +1,44 @@
{
"_args": [
[
"@cnakazawa/watch@1.0.3",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "@cnakazawa/watch@1.0.3",
"_id": "@cnakazawa/watch@1.0.3",
"_from": "@cnakazawa/watch@^1.0.3",
"_id": "@cnakazawa/watch@1.0.4",
"_inBundle": false,
"_integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==",
"_integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==",
"_location": "/@cnakazawa/watch",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "@cnakazawa/watch@1.0.3",
"raw": "@cnakazawa/watch@^1.0.3",
"name": "@cnakazawa/watch",
"escapedName": "@cnakazawa%2fwatch",
"scope": "@cnakazawa",
"rawSpec": "1.0.3",
"rawSpec": "^1.0.3",
"saveSpec": null,
"fetchSpec": "1.0.3"
"fetchSpec": "^1.0.3"
},
"_requiredBy": [
"/sane"
],
"_resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz",
"_spec": "1.0.3",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
"_shasum": "f864ae85004d0fcab6f50be9141c4da368d1656a",
"_spec": "@cnakazawa/watch@^1.0.3",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/sane",
"author": {
"name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com"
},
"bin": {
"watch": "./cli.js"
"watch": "cli.js"
},
"bugs": {
"url": "https://github.com/mikeal/watch/issues"
},
"bundleDependencies": false,
"dependencies": {
"exec-sh": "^0.3.2",
"minimist": "^1.2.0"
},
"deprecated": false,
"description": "Utilities for watching file trees.",
"directories": {
"lib": "lib"
@@ -69,5 +65,5 @@
"release:minor": "bash scripts/release.sh minor",
"release:patch": "bash scripts/release.sh patch"
},
"version": "1.0.3"
"version": "1.0.4"
}

View File

View File

View File

@@ -1,31 +0,0 @@
var watch = require('../main')
, assert = require('assert')
, path = require('path')
, fs = require('fs')
, target = path.join(__dirname, "d/t")
;
function clearFile() {
fs.writeFileSync(target, '')
}
clearFile()
// test if changed event is fired correctly
watch.createMonitor(__dirname, { interval: 150 },
function (monitor) {
monitor.once('changed', function (f) {
assert.equal(f, target);
clearFile();
process.exit(0)
})
fs.writeFile(target, 'Test Write\n', function (err) {
if (err) throw err;
setTimeout(function () {
// should have got the other assert done by now
assert.ok(false);
}, 300);
})
});

View File

@@ -1,28 +0,0 @@
var fs, watch, watch_original;
watch = require('../main');
watch_original = require('watch');
fs = require('fs');
watch.createMonitor(__dirname, function (monitor) {
monitor.on("created", function (f, stat) {
console.log(f + " created");
});
monitor.on("changed", function (f, curr, prev) {
console.log(f + " changed");
});
monitor.on("removed", function (f, stat) {
console.log(f + " removed");
});
});
watch_original.createMonitor(__dirname, function (monitor) {
monitor.on("created", function (f, stat) {
console.log("ORIGINAL: " + f + " created");
});
monitor.on("changed", function (f, curr, prev) {
console.log("ORIGINAL: " + f + " changed");
});
monitor.on("removed", function (f, stat) {
console.log("ORIGINAL: " + f + " removed");
});
});

View File

@@ -1,23 +0,0 @@
var fs = require('fs')
, watch = require('../main')
, assert = require('assert')
;
//
// Demonstrate that the function of 'filter' is semantically inconsistent with
// usual convention, that returning true means 'keep this'.
//
function isDirOrQ(f, stat) { return stat.isDirectory() || f === 'Q'; }
watch.watchTree(__dirname, { filter: isDirOrQ }, function (f, curr, prev) {
if (typeof f == 'object' && prev === null && curr === null) {
Object.keys(f).forEach(function(name) {
var stat = f[name];
assert(isDirOrQ(name, stat));
});
// If the process never exits then `unwatchTree` failed to unwatch all
// the files.
watch.unwatchTree(__dirname);
}
});