File module.
- Source:
Methods
-
<static> appendFile(src, dest)
-
Append file contents to another file.
Parameters:
Name Type Description srcstring File path to append from.
deststring File path to append to.
- Source:
-
<static> copyDir(src, dest, callback)
-
Copy a directory.
Parameters:
Name Type Description srcstring Directory path to copy from.
deststring Directory path to copy to.
callbackfunction Callback when done.
- Source:
-
<static> copyFile(src, dest)
-
Copy a file.
Parameters:
Name Type Description srcstring File path to copy from.
deststring File path to copy to.
- Source:
-
<static> expandGlob(patterns, callback)
-
Expand glob patterns.
Parameters:
Name Type Description patternsstring | Array.<string> Glob patterns.
callbackfunction Callback when done.
-
<static> forceUnlink(filename, callback)
-
Unlink forcefully.
Parameters:
Name Type Description filenamestring File name to unlink.
callbackfunction Callback when done.
-
<static> ignoreFilter(pattern) → {function}
-
File ignore filter. Excludes files which match ignore patterns.
Parameters:
Name Type Description patternstring | Array.<string> Ignore glob pattern(s).
Returns:
- File ignore function.
- Type
- function
-
<static> loadHbsTmpl(filename, callback)
-
Load a handlebars template.
Parameters:
Name Type Description filenamestring File path of a handlebar template.
callbackfunction Callback whit loaded compiled template.
- Source:
- See:
-
<static> matchesGlob(filename, pattern)
-
Returns matches a glob pattern or not
Parameters:
Name Type Description filenamestring Filename.
patternstring Pattern to match.
-
<static> mkdirP(dirname, callback)
-
Make a directory. If any parent directories not exists, make it.(same as mkdir -p)
Parameters:
Name Type Description dirnamestring Directory path to make.
callbackfunction Callback when done.
- Source:
-
<static> prepareCleanDir(dirname, callback)
-
Create a cleaned directory. If already exists, regenerate it. If it's parents were missing, create them.
Parameters:
Name Type Description dirnamestring Directory name to prepare.
callbackfunction Callback when done.
-
<static> readdirRecursive(dirname, callback)
-
Read a directory recursive.
Parameters:
Name Type Description dirnamestring Directory name to read.
callbackfunction Callback with read filenames.
-
<static> readdirRecursiveSync(dirname) → {function}
-
Read a directory recursive synchronically.
Parameters:
Name Type Description dirnamestring Directory name to read.
Returns:
filenames - Filenames relative to the directory.
- Type
- function
-
<static> relativeSymlink(src, dest, callback)
-
Create a symbolic link with relative path.
Parameters:
Name Type Description srcstring Source file (actual file) path.
deststring Destination file (link) path.
callbackfunction Callback when done.
-
<static> rmdirRecursive(dirname, callback)
-
Remove a directory recursive.
Parameters:
Name Type Description dirnamestring Directory path to remove.
callbackfunction Callback when done.
-
<static> writeReadonlyFile(filename, content, callback)
-
Write a readonly file.
Parameters:
Name Type Description filenamestring Filename to write.
contentstring File content to write.
callbackfunction Callback when done.