Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Disable file watching on Windows #17

Closed
wants to merge 3 commits into from

3 participants

@jbuck

I played with the fs.watch API, but it is pretty awful right now. If the file doesn't exist, then you need to watch the directory for renames, then watch the file if it exists. This small change at least allows for devs to use node-config on Windows rather than erroring out.

@lorenwest
Owner

Thanks for the pull request, Jon. I ran into this issue a couple months ago, and think it's a matter of using the new file watching API when we're running in node > 0.6. I'd rather put that into place vs. disabling file watching on windows. For node-config, we're not watching for new files - just changes on existing files.

Give me a day or two, and if I can't get it running well on windows I'll merge in your pull request.

@lorenwest
Owner

0.4.12 was just published to npm with updated file watching. If the new style fs.watch is available (0.6.0 and above), otherwise it fails back to the older style fs.watchFile functionality.

@lorenwest lorenwest closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 6, 2012
  1. @timoxley
  2. Merge pull request #16 from timoxley/patch-1

    authored
    Take people to latest docs straight away
Commits on Apr 25, 2012
  1. @jbuck

    Disable file watching on Windows

    jbuck authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +6 −1 lib/config.js
  2. +1 −1  package.json
View
7 lib/config.js
@@ -1022,5 +1022,10 @@ global.NODE_CONFIG = global.NODE_CONFIG ? global.NODE_CONFIG : new Config();
// aren't a part of the object namespace when inspected.
module.exports = global.NODE_CONFIG;
-// Watch for configuration file changes
+// Watch for configuration file changes, unless we're on Windows
+if (process.platform == 'win32') {
+
+ console.warn("node-config: Configuration file monitoring is disabled on Windows");
+ return;
+}
global.NODE_CONFIG.watchForConfigFileChanges();
View
2  package.json
@@ -4,7 +4,7 @@
"main": "./lib/config.js",
"description": "Configuration control for production node deployments",
"author": "Loren West <open_source@lorenwest.com>",
- "homepage": "http://lorenwest.github.com/node-config/",
+ "homepage": "http://lorenwest.github.com/node-config/latest/index.html",
"directories": {"lib": "./lib", "config": "./config", "test": "./test"},
"dependencies": {
"yaml" : "0.2.x",
Something went wrong with that request. Please try again.