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,iBAAmB,SAAS,EAAM,GAgBtC,YAfuB,IAAZ,GACP,EAAQ,WAAiC,IAAlB,EAAQ,MAAwB,EAAQ,MAAQ,IACvE,EAAQ,cAAuC,IAArB,EAAQ,SAA2B,EAAQ,SAAW,KAChF,EAAQ,QAA2B,IAAf,EAAQ,GAAqB,EAAQ,GAAK,KAC9D,EAAQ,UAA+B,IAAjB,EAAQ,KAAuB,EAAQ,KAAO,IACpE,EAAQ,eAAyC,IAAtB,EAAQ,WAA4B,EAAQ,WAEvE,EAAU,CACN,MAAO,IACP,SAAU,KACV,GAAI,KACJ,KAAM,IACN,WAAW,GAGZ,OAAO,iBAAiB,EAAM,EACzC,EAYA,QAAQ,kBAAoB,SAAS,EAAM,GAYvC,YAXuB,IAAZ,GACP,EAAQ,WAAiC,IAAlB,EAAQ,MAAwB,EAAQ,MAAQ,IACvE,EAAQ,cAAuC,IAArB,EAAQ,SAA2B,EAAQ,SAAW,KAChF,EAAQ,UAA+B,IAAjB,EAAQ,KAAuB,EAAQ,KAAO,KAEpE,EAAU,CACN,MAAO,IACP,SAAU,KACV,KAAM,KAGP,OAAO,iBAAiB,EAAM,EACzC","file":"/npm/qfs-node@0.0.1/qfs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/qfs-node@0.0.1/qfs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * qfs node module provides wrappers with exposed q promise capabilities for fs asynchronous methods\n * For full description of core node fs module please refer to official node fs documentation: http://nodejs.org/api/fs.html#fs_file_system\n *\n * This module requires module {@link module:node_modules/q}\n * @class\n * @requires module:node_modules/q\n */\n\n/**\n * A promise object provided by the q promise library.\n * @external Promise\n * @see {@link https://github.com/kriskowal/q/wiki/API-Reference}\n */\n\nvar QFS_Q = require(\"q\");\nvar QFS_FS = require('fs');\n\n/**\n * q-wrapper for fs.rename\n * @param  {string} oldPath old path\n * @param  {string} newPath new path\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.rename = function(oldPath, newPath) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.rename(oldPath, newPath, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.ftruncate\n * @param  {number} fd file descriptor\n * @param  {integer} len  amount of data to be truncated\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.ftruncate = function(fd, len) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.ftruncate(fd, len, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.truncate\n * @param  {number} fd file descriptor\n * @param  {integer} len  amount of data to be truncated\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.truncate = function(fd, len) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.truncate(fd, len, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.chown\n * @param  {string} path path to file\n * @param  {integer} uid  owner ID\n * @param  {integer} gid  group ID\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.chown = function(path, uid, gid) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.chown(path, uid, gid, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.fchown\n * @param  {number} fd file descriptor\n * @param  {integer} uid  owner ID\n * @param  {integer} gid  group ID\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.fchown = function(fd, uid, gid) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.fchown(fd, uid, gid, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.lchown\n * @param  {string} path path to file\n * @param  {integer} uid  owner ID\n * @param  {integer} gid  group ID\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.lchown = function(path, uid, gid) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.lchown(path, uid, gid, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.chmod\n * @param  {string} path path to file\n * @param  {integer} mode value of mode in octal or integer format\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.chmod = function(path, mode) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.chmod(path, mode, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.fchmod\n * @param  {number} fd file descriptor\n * @param  {integer} mode value of mode in octal or integer format\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.fchmod = function(fd, mode) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.fchmod(fd, mode, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.lchmod\n * @param  {string} path path to file\n * @param  {integer} mode value of mode in octal or integer format\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.lchmod = function(path, mode) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.lchmod(path, mode, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.stat\n * @param  {string} path path to file\n * @return {external:Promise} On success the promise will be resolved with fs.Stats object.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.stat = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.stat(path, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.lstat\n * @param  {string} path path to file\n * @return {external:Promise} On success the promise will be resolved with fs.Stats object.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.lstat = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.lstat(path, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.fstat\n * @param  {number} fd file descriptor\n * @return {external:Promise} On success the promise will be resolved with fs.Stats object.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.fstat = function(fd) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.fstat(fd, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.link\n * @param  {string} srcpath path to source file\n * @param  {string} dstpath path to destination\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.link = function(srcpath, dstpath) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.link(srcpath, dstpath, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.symlink\n * @param  {string} srcpath path to source file\n * @param  {string} dstpath path to destination file\n * @param  {string} type can be set to 'dir', 'file', or 'junction' (default is 'file'), only for Windows platform\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.symlink = function(srcpath, dstpath, type) {\n    var deferred = QFS_Q.defer();\n    type = typeof type !== 'undefined' ? type : 'file';\n    QFS_FS.symlink(srcpath, dstpath, type, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.readlink\n * @param  {string} path path to link file\n * @return {external:Promise} On success the promise will be resolved with string content of link file.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.readlink = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.readlink(path, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.realpath\n * @param  {string} path  path to some location\n * @param  {object} cache object literal of mapped paths that can be used to force a specific path resolution or avoid additional fs.stat calls for known real paths\n * @return {external:Promise} On success the promise will be resolved with string containg resolved path.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.realpath = function(path, cache) {\n    var deferred = QFS_Q.defer();\n    cache = typeof cache !== 'undefined' ? cache : {};\n    QFS_FS.realpath(path, cache, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.unlink\n * @param  {string} path path to file\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.unlink = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.unlink(path, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.rmdir\n * @param  {string} path path to directory\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.rmdir = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.rmdir(path, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.mkdir\n * @param  {string} path path to directory\n * @param  {integer} mode value of mode in octal or integer format, defaults to 0777\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.mkdir = function(path, mode) {\n    var deferred = QFS_Q.defer();\n    mode = typeof mode !== 'undefined' ? mode : 0777;\n    QFS_FS.mkdir(path, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.readdir\n * @param  {string} path  path to directory\n * @param  {object} cache object literal of mapped paths that can be used to force a specific path resolution or avoid additional fs.stat calls for known real paths\n * @return {external:Promise} On success the promise will be resolved with array of the names of the files in the directory excluding '.' and '..'.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.readdir = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.readdir(path, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.close\n * @param  {number} fd file descriptor\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.close = function(fd) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.close(fd, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.open\n * @param  {string} path  path to file\n * @param  {string} flags specify mode in which we open file, acceptable values:\n *                        'r' - Open file for reading. An exception occurs if the file does not exist.\n *                        'r+' - Open file for reading and writing. An exception occurs if the file does not exist.\n *                        'rs' - Open file for reading in synchronous mode. Instructs the operating system to bypass the local file system cache.\n *                        This is primarily useful for opening files on NFS mounts as it allows you to skip the potentially stale local cache. It has a very real impact on I/O performance so don't use this flag unless you need it.\n *                        Note that this doesn't turn fs.open() into a synchronous blocking call. If that's what you want then you should be using fs.openSync()\n *                        'rs+' - Open file for reading and writing, telling the OS to open it synchronously. See notes for 'rs' about using this with caution.\n *                        'w' - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\n *                        'wx' - Like 'w' but fails if path exists.\n *                        'w+' - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\n *                        'wx+' - Like 'w+' but fails if path exists.\n *                        'a' - Open file for appending. The file is created if it does not exist.\n *                        'ax' - Like 'a' but fails if path exists.\n *                        'a+' - Open file for reading and appending. The file is created if it does not exist.\n *                        'ax+' - Like 'a+' but fails if path exists.\n * @param  {integer} mode value of mode in octal or integer format, defaults 0666\n * @return {external:Promise} On success the promise will be resolved with file descriptor (fd).<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.open = function(path, flags, mode) {\n    var deferred = QFS_Q.defer();\n    mode = typeof mode !== 'undefined' ? mode : 0666;\n    QFS_FS.open(path, flags, mode, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.utimes\n * @param  {string} path  path to file\n * @param  {integer} atime access time\n * @param  {integer} mtime modification time\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.utimes = function(path, atime, mtime) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.utimes(path, atime, mtime, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.futimes\n * @param  {number} fd file descriptor\n * @param  {integer} atime access time\n * @param  {integer} mtime modification time\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.futimes = function(fd, atime, mtime) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.futimes(fd, atime, mtime, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.fsync\n * @param  {number} fd file descriptor\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.fsync = function(fd) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.fsync(fd, function(err) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.write</br>\n * Original fs.write method return 3 arguments to callback: error, written & buffer. </br> Author of this wrapper wants to stick to q mantra as close as possible so every method provide to resolver 1 argument. Resolving method combines 2 arguments into one: {written: result, buffer: buffer}\n * @param  {number} fd file descriptor\n * @param  {string|buffer} buffer   buffer of data that have to be written to the file\n * @param  {integer} offset   determine the starting point of datafrom buffer to be written\n * @param  {integer} length   specifying the number of bytes to read\n * @param  {integer} position refers to the offset from the beginning of the file where this data should be written. If position is null, the data will be written at the current position (defaults to null)\n * @return {external:Promise} On success the promise will be resolved with object in following notation {written: result, buffer: buffer}.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.write = function(fd, buffer, offset, length, position) {\n    var deferred = QFS_Q.defer();\n    position = typeof position !== 'undefined' ? position : null;\n    QFS_FS.write(fd, buffer, offset, length, position, function(err, result, buffer) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve({\n                written: result,\n                buffer: buffer\n            });\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.read</br>\n * Original fs.read method return 3 arguments to callback: error, bytesRead & buffer. </br> Author of this wrapper wants to stick to q mantra as close as possible so every method provide to resolver 1 argument. Resolving method combines 2 arguments into one: {bytesRead: bytesRead, buffer: buffer}\n * @param  {number} fd file descriptor\n * @param  {string|buffer} buffer   is the buffer that the data will be written to\n * @param  {integer} offset   offset in the buffer to start writing at\n * @param  {integer} length   specifying the number of bytes to read\n * @param  {integer} position specifying where to begin reading from in the file. If position is null, data will be read from the current file position (defaults to null)\n * @return {external:Promise} On success the promise will be resolved with object in following notation {bytesRead: bytesRead, buffer: buffer}.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.read = function(fd, buffer, offset, length, position) {\n    var deferred = QFS_Q.defer();\n    position = typeof position !== 'undefined' ? position : null;\n    QFS_FS.read(fd, buffer, offset, length, position, function(err, result, buffer) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve({\n                bytesRead: result,\n                buffer: buffer\n            });\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.readFile\n * @param  {string} path    path to file\n * @param  {object} options can contain one of following options: encoding (string, defaults to null), flag (string, defaults to 'r')\n * @return {external:Promise} On success the promise will be resolved with readed data.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.readFile = function(path, options) {\n    var deferred = QFS_Q.defer();\n    if (typeof options !== 'undefined') {\n        options.encoding = typeof options.encoding !== 'undefined' ? options.encoding : null;\n        options.flag = typeof options.flag !== 'undefined' ? options.flag : 'r';\n    } else {\n        options = {\n            encoding: null,\n            flag: 'r'\n        };\n    }\n    QFS_FS.readFile(path, options, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(result);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.writeFile\n * @param  {string} path    path to file\n * @param  {string|buffer} data    data to be written to file\n * @param  {object} options can contain one of following options: encoding (string, defaults to 'utf8'), mode (integer or octal, defaults to 0666), flag (string, defaults to 'w')\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.writeFile = function(path, data, options) {\n    var deferred = QFS_Q.defer();\n    if (typeof options !== 'undefined') {\n        options.encoding = typeof options.encoding !== 'undefined' ? options.encoding : 'utf8';\n        options.mode = typeof options.mode !== 'undefined' ? options.mode : 0666;\n        options.flag = typeof options.flag !== 'undefined' ? options.flag : 'w';\n    } else {\n        options = {\n            encoding: 'utf8',\n            mode: 0666,\n            flag: 'w'\n        };\n    }\n    QFS_FS.writeFile(path, data, options, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.appendFile\n * @param  {string} path    path to file\n * @param  {string|buffer} data    data to be written to file\n * @param  {object} options can contain one of following options: encoding (string, defaults to 'utf8'), mode (integer or octal, defaults to 0666), flag (string, defaults to 'a')\n * @return {external:Promise} On success the promise will be resolved with true.<br> On error the promise will be rejected with an {@link Error}.\n */\nexports.appendFile = function(path, data, options) {\n    var deferred = QFS_Q.defer();\n    if (typeof options !== 'undefined') {\n        options.encoding = typeof options.encoding !== 'undefined' ? options.encoding : 'utf8';\n        options.mode = typeof options.mode !== 'undefined' ? options.mode : 0666;\n        options.flag = typeof options.flag !== 'undefined' ? options.flag : 'a';\n    } else {\n        options = {\n            encoding: 'utf8',\n            mode: 0666,\n            flag: 'a'\n        };\n    }\n    QFS_FS.appendFile(path, data, options, function(err, result) {\n        if (err) {\n            deferred.reject(new Error(err));\n        } else {\n            deferred.resolve(true);\n        }\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.watchFile</br>\n * Original fs.watchFile method accept listener as one of arguments. This listener is used as a callback in case of any change made to the watched file.</br> By utilizing q notification capabilities we are able to mimic above listener behavior without loosing beauty of q premises. lease use .progress(function(result_object){...}); notation to receive events regarding watched file.</br> Method return 2 arguments to listener: current_stat & previous_stat. Author of this wrapper wants to stick to q manta as close as possible so this method provide to progress listener 1 argument. Resolver method combines 2 arguments into one: {current: current_stat, previous: previous_stat}\n * @param  {string} path    path to file\n * @param  {object} options can contain one of following options: persistent (boolean, defaults to true), interval (integer, defaults to 5007 miliseconds)\n * @return {external:Promise} On event this promisse will be notified with object in following notation {current: current_stat, previous: previous_stat}.\n */\nexports.watchFile = function(path, options) {\n    var deferred = QFS_Q.defer();\n    if (typeof options !== 'undefined') {\n        options.persistent = typeof options.persistent !== 'undefined' ? options.persistent : true;\n        options.interval = typeof options.interval !== 'undefined' ? options.interval : 5007;\n    } else {\n        options = {\n            persistent: true,\n            interval: 5007\n        };\n    }\n    QFS_FS.watchFile(path, options, function(current_stat, previous_stat) {\n        deferred.notify({\n            current: current_stat,\n            previous: previous_stat\n        });\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.unwatchFile</br>\n * In its pure form this method really don't require wrapper, but because we used q progress as a listenerit will be difficult for user to provide proper function to detach watcher from file. This method will remove all listeners.\n * @param  {string} path path to watched file\n * @return {boolean}      Always return true.\n */\nexports.unwatchFile = function(path) {\n    QFS_FS.unwatchFile(path);\n    return true;\n};\n\n/**\n * q-wrapper for fs.watch</br>\n * This method is very specific and its port is not so straightforward. To keep simplicity of q promises & to avoid injecting any extra argument to deffered object this method return object that contains promise & object of type fswatch. Usage of promise is straightforward. Object of type fswatch have to be closed to delete handler.</br>\n * E.g.\n * var a = require('qfs').watch('path/to/file.txt');\n * a.promise.progress(function(...){...}).error(function(...){...});\n * ...\n * a.handler.close();\n * </br>\n * Original fs.watch method accept listener as one of arguments. This listener is used as a callback in case of any change made to the watched file. By utilizing q notification capabilities we are able to mimic above listener behavior without loosing beauty of q premises. Please use .progress(function(result_object){...}); notation to receive events regarding watched file.</br>\n * Resolver method return 1 argument to progress listener: filename. This progress event / call == 'change' of file & is not specified (can be related to any type of action against watched file).</br>\n * Author of this wrapper wants to stick to q manta as close as possible so this method provide error event only once. After that event user is expected to close handler on its own.\n * @param  {string} path    path to file\n * @param  {object} options can contain one of following options: persistent (boolean, defaults to true)\n * @return {external:Promise} Returns object with the following notation: {handler: handler, promise:promise}. On event this promisse will be notified with object in following notation {event: event, filename: filename}. On error the promise will be rejected with an {@link Error}. Please remember to close handler after error.\n */\nexports.watch = function(path, options) {\n    var deferred = QFS_Q.defer();\n    if (typeof options !== 'undefined') {\n        options.persistent = typeof options.persistent !== 'undefined' ? options.persistent : true;\n    } else {\n        options = {\n            persistent: true\n        };\n    }\n    var handler = QFS_FS.watch(path, options, function(event, filename) {\n        if (event == \"change\") deferred.notify(filename);\n        if (event == \"error\") deferred.reject({\n            event: event,\n            filename: filename\n        });\n    });\n    return {\n        handler: handler,\n        promise: deferred.promise\n    };\n};\n\n/**\n * q-wrapper for fs.exists\n * @param  {string} path    path to file\n * @return {external:Promise} On success the promise will be resolved with true or false depanding on fact if file exists.\n */\nexports.exists = function(path) {\n    var deferred = QFS_Q.defer();\n    QFS_FS.exists(path, function(result) {\n        deferred.resolve(result)\n    });\n    return deferred.promise;\n};\n\n/**\n * q-wrapper for fs.createReadStream</br>\n * In its pure form this method really don't require wrapper, created for convinience of usage\n * @param  {string} path    path to file\n * @param  {object} options can contain one of following options: flags (string, defaults to 'r'), encoding (string, defaults to null), fd (file, defaults to null), mode (integer or octal, defaults to 0666), autoClose (boolean, defaults to true)\n * @return {ReadStream} Returns read stream object\n */\nexports.createReadStream = function(path, options) {\n    if (typeof options !== 'undefined') {\n        options.flags = typeof options.flags !== 'undefined' ? options.flags : 'r';\n        options.encoding = typeof options.encoding !== 'undefined' ? options.encoding : null;\n        options.fd = typeof options.fd !== 'undefined' ? options.fd : null;\n        options.mode = typeof options.mode !== 'undefined' ? options.mode : 0666;\n        options.autoClose = typeof options.autoClose !== 'undefined' ? options.autoClose : true;\n    } else {\n        options = {\n            flags: 'r',\n            encoding: null,\n            fd: null,\n            mode: 0666,\n            autoClose: true\n        };\n    }\n    return QFS_FS.createReadStream(path, options)\n};\n\n//wrapper for fs.createWriteStream\n////additional info: in its pure form this method really don't require wrapper, created for convinience of usage\n//returns WriteStream object\n/**\n * q-wrapper for fs.createReadStream</br>\n * In its pure form this method really don't require wrapper, created for convinience of usage\n * @param  {string} path    path to file\n * @param  {object} options can contain one of following options: flags (string, defaults to 'w'), encoding (string, defaults to null), mode (integer or octal, defaults to 0666)\n * @return {WriteStream} Returns read stream object\n */\nexports.createWriteStream = function(path, options) {\n    if (typeof options !== 'undefined') {\n        options.flags = typeof options.flags !== 'undefined' ? options.flags : 'w';\n        options.encoding = typeof options.encoding !== 'undefined' ? options.encoding : null;\n        options.mode = typeof options.mode !== 'undefined' ? options.mode : 0666;\n    } else {\n        options = {\n            flags: 'r',\n            encoding: null,\n            mode: 0666,\n        };\n    }\n    return QFS_FS.createReadStream(path, options)\n};\n"]}