pathwatcher
Advanced tools
Comparing version 6.5.0 to 6.6.0
92
api.json
@@ -6,3 +6,3 @@ { | ||
"filename": "src/directory.coffee", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L13", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L13", | ||
"sections": [ | ||
@@ -35,3 +35,3 @@ { | ||
"sectionName": "Construction", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L26", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L26", | ||
"visibility": "Public", | ||
@@ -58,3 +58,3 @@ "summary": "Configures a new Directory instance, no files are accessed.", | ||
"sectionName": "Construction", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L51", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L51", | ||
"visibility": "Public", | ||
@@ -81,3 +81,3 @@ "summary": "Creates the directory on disk that corresponds to `::getPath()` if\nno such directory already exists.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L73", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L73", | ||
"visibility": "Public", | ||
@@ -104,3 +104,3 @@ "summary": "Invoke the given callback when the directory's contents change.", | ||
"sectionName": "Directory Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L95", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L95", | ||
"visibility": "Public", | ||
@@ -119,3 +119,3 @@ "summary": "", | ||
"sectionName": "Directory Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L98", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L98", | ||
"visibility": "Public", | ||
@@ -134,3 +134,3 @@ "summary": "", | ||
"sectionName": "Directory Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L101", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L101", | ||
"visibility": "Public", | ||
@@ -149,3 +149,3 @@ "summary": "", | ||
"sectionName": "Directory Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L106", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L106", | ||
"visibility": "Public", | ||
@@ -164,3 +164,3 @@ "summary": "", | ||
"sectionName": "Directory Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L110", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L110", | ||
"visibility": "Public", | ||
@@ -179,3 +179,3 @@ "summary": "", | ||
"sectionName": "Directory Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L115", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L115", | ||
"visibility": "Public", | ||
@@ -188,3 +188,3 @@ "summary": "Return a {Boolean}, true if this {Directory} is the root directory\nof the filesystem, or false if it isn't. ", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L126", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L126", | ||
"visibility": "Public", | ||
@@ -203,3 +203,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L132", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L132", | ||
"visibility": "Public", | ||
@@ -218,3 +218,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L143", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L143", | ||
"visibility": "Public", | ||
@@ -233,3 +233,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L148", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L148", | ||
"visibility": "Public", | ||
@@ -248,3 +248,3 @@ "summary": "", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L205", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L205", | ||
"visibility": "Public", | ||
@@ -263,3 +263,3 @@ "summary": "Traverse to the parent directory.", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L214", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L214", | ||
"visibility": "Public", | ||
@@ -286,3 +286,3 @@ "summary": "Traverse within this Directory to a child File. This method doesn't\nactually check to see if the File exists, it just creates the File object.", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L224", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L224", | ||
"visibility": "Public", | ||
@@ -309,3 +309,3 @@ "summary": "Traverse within this a Directory to a child Directory. This method\ndoesn't actually check to see if the Directory exists, it just creates the\nDirectory object.", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L230", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L230", | ||
"visibility": "Public", | ||
@@ -324,3 +324,3 @@ "summary": "Reads file entries in this directory from disk synchronously.", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L251", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L251", | ||
"visibility": "Public", | ||
@@ -355,3 +355,3 @@ "summary": "Reads file entries in this directory from disk asynchronously.", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/directory.coffee#L282", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/directory.coffee#L282", | ||
"visibility": "Public", | ||
@@ -385,3 +385,3 @@ "summary": "Determines if the given path (real or symbolic) is inside this\ndirectory. This method does not actually check if the path exists, it just\nchecks if the path is under this directory.", | ||
"filename": "src/file.coffee", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L18", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L18", | ||
"sections": [ | ||
@@ -418,3 +418,3 @@ { | ||
"sectionName": "Construction", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L31", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L31", | ||
"visibility": "Public", | ||
@@ -441,3 +441,3 @@ "summary": "Configures a new File instance, no files are accessed.", | ||
"sectionName": "Construction", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L53", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L53", | ||
"visibility": "Public", | ||
@@ -456,3 +456,3 @@ "summary": "Creates the file on disk that corresponds to `::getPath()` if no\nsuch file already exists.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L71", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L71", | ||
"visibility": "Public", | ||
@@ -479,3 +479,3 @@ "summary": "Invoke the given callback when the file's contents change.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L80", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L80", | ||
"visibility": "Public", | ||
@@ -502,3 +502,3 @@ "summary": "Invoke the given callback when the file's path changes.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L89", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L89", | ||
"visibility": "Public", | ||
@@ -525,3 +525,3 @@ "summary": "Invoke the given callback when the file is deleted.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L102", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L102", | ||
"visibility": "Public", | ||
@@ -564,3 +564,3 @@ "summary": "Invoke the given callback when there is an error with the watch.\nWhen your callback has been invoked, the file will have unsubscribed from\nthe file watches.", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L124", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L124", | ||
"visibility": "Public", | ||
@@ -579,3 +579,3 @@ "summary": "", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L127", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L127", | ||
"visibility": "Public", | ||
@@ -594,3 +594,3 @@ "summary": "", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L130", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L130", | ||
"visibility": "Public", | ||
@@ -609,3 +609,3 @@ "summary": "", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L135", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L135", | ||
"visibility": "Public", | ||
@@ -624,3 +624,3 @@ "summary": "", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L140", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L140", | ||
"visibility": "Public", | ||
@@ -639,3 +639,3 @@ "summary": "", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L146", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L146", | ||
"visibility": "Public", | ||
@@ -654,3 +654,3 @@ "summary": "Get the SHA-1 digest of this file", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L155", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L155", | ||
"visibility": "Public", | ||
@@ -669,3 +669,3 @@ "summary": "Get the SHA-1 digest of this file", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L165", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L165", | ||
"visibility": "Public", | ||
@@ -686,3 +686,3 @@ "summary": "Sets the file's character set encoding name.", | ||
"sectionName": "File Metadata", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L176", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L176", | ||
"visibility": "Public", | ||
@@ -701,3 +701,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L183", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L183", | ||
"visibility": "Public", | ||
@@ -716,3 +716,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L190", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L190", | ||
"visibility": "Public", | ||
@@ -731,3 +731,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L199", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L199", | ||
"visibility": "Public", | ||
@@ -746,3 +746,3 @@ "summary": "", | ||
"sectionName": "Managing Paths", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L211", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L211", | ||
"visibility": "Public", | ||
@@ -755,3 +755,3 @@ "summary": "Return the {String} filename without any directory information. ", | ||
"sectionName": "Traversing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L219", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L219", | ||
"visibility": "Public", | ||
@@ -764,3 +764,3 @@ "summary": "Return the {Directory} that contains this file. ", | ||
"sectionName": "Reading and Writing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L255", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L255", | ||
"visibility": "Public", | ||
@@ -787,3 +787,3 @@ "summary": "Reads the contents of the file.", | ||
"sectionName": "Reading and Writing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L282", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L282", | ||
"visibility": "Public", | ||
@@ -806,3 +806,3 @@ "summary": "", | ||
"sectionName": "Reading and Writing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L295", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L295", | ||
"visibility": "Public", | ||
@@ -829,3 +829,3 @@ "summary": "Overwrites the file with the given text.", | ||
"sectionName": "Reading and Writing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L306", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L306", | ||
"visibility": "Public", | ||
@@ -848,3 +848,3 @@ "summary": "", | ||
"sectionName": "Reading and Writing", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.5.0/src/file.coffee#L321", | ||
"srcUrl": "https://github.com/atom/node-pathwatcher/blob/v6.6.0/src/file.coffee#L321", | ||
"visibility": "Public", | ||
@@ -851,0 +851,0 @@ "summary": "Overwrites the file with the given text.", |
@@ -386,2 +386,36 @@ (function() { | ||
File.prototype.safeWriteSync = function(text) { | ||
var directoryFD, error, fd; | ||
this.writeSync(text); | ||
try { | ||
fd = fs.openSync(this.getPath(), 'r+'); | ||
fs.fdatasyncSync(fd); | ||
fs.closeSync(fd); | ||
if (process.platform !== 'win32') { | ||
try { | ||
directoryFD = fs.openSync(path.dirname(this.getPath()), 'r'); | ||
fs.fdatasyncSync(directoryFD); | ||
fs.closeSync(directoryFD); | ||
} catch (_error) { | ||
error = _error; | ||
console.warn("Non-fatal error syncing parent directory of " + (this.getPath())); | ||
} | ||
} | ||
} catch (_error) { | ||
error = _error; | ||
if (error.code === 'EACCES' && process.platform === 'darwin') { | ||
if (runas == null) { | ||
runas = require('runas'); | ||
} | ||
if (runas('/bin/sync', [], { | ||
admin: true | ||
}) !== 0) { | ||
throw error; | ||
} | ||
} else { | ||
throw error; | ||
} | ||
} | ||
}; | ||
File.prototype.writeFile = function(filePath, contents) { | ||
@@ -440,3 +474,29 @@ var encoding; | ||
File.prototype.safeRemoveSync = function() { | ||
var err, fd; | ||
try { | ||
fd = fs.openSync(this.getPath(), 'a'); | ||
fs.fdatasyncSync(fd); | ||
fs.closeSync(fd); | ||
fs.removeSync(this.getPath()); | ||
} catch (_error) { | ||
err = _error; | ||
if (err.code === 'EACCES' && process.platform === 'darwin') { | ||
if (runas('/bin/sync', [], { | ||
admin: true | ||
}) !== 0) { | ||
throw error; | ||
} | ||
if (runas('/bin/rm', ['-f', this.getPath()], { | ||
admin: true | ||
}) !== 0) { | ||
throw error; | ||
} | ||
} else { | ||
throw error; | ||
} | ||
} | ||
}; | ||
/* | ||
@@ -443,0 +503,0 @@ Section: Private |
@@ -5,3 +5,3 @@ { | ||
"description": "Watch files and directories for changes", | ||
"version": "6.5.0", | ||
"version": "6.6.0", | ||
"licenses": [ | ||
@@ -8,0 +8,0 @@ { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
99309
1904
2