Helpers for working with the filesystem.
Classes
Error thrown in move or moveSync when the
destination is a subdirectory of the source.
Functions
Copy a file or directory. The directory can have contents. Like cp -r.
Requires the --allow-read and --allow-write flag.
Copy a file or directory. The directory can have contents. Like cp -r.
Requires the --allow-read and --allow-write flag.
Detect the EOL character for string input. returns null if no newline.
Ensures that a directory is empty.
Deletes directory contents if the directory is not empty.
If the directory does not exist, it is created.
The directory itself is not deleted.
Requires the --allow-read and --allow-write flag.
Ensures that a directory is empty.
Deletes directory contents if the directory is not empty.
If the directory does not exist, it is created.
The directory itself is not deleted.
Requires the --allow-read and --allow-write flag.
Ensures that the directory exists.
If the directory structure does not exist, it is created. Like mkdir -p.
Requires the --allow-read and --allow-write flag.
Ensures that the directory exists.
If the directory structure does not exist, it is created. Like mkdir -p.
Requires the --allow-read and --allow-write flag.
Ensures that the file exists.
If the file that is requested to be created is in directories that do not
exist.
these directories are created. If the file already exists,
it is NOTMODIFIED.
Requires the --allow-read and --allow-write flag.
Ensures that the file exists.
If the file that is requested to be created is in directories that do not
exist,
these directories are created. If the file already exists,
it is NOT MODIFIED.
Requires the --allow-read and --allow-write flag.
Ensures that the hard link exists. If the directory structure does not exist, it is created.
Ensures that the hard link exists. If the directory structure does not exist, it is created.
Ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created.
Ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created.
Test whether or not the given path exists by checking with the file system. Please consider to check if the path is readable and either a file or a directory by providing additional options:
Test whether or not the given path exists by checking with the file system. Please consider to check if the path is readable and either a file or a directory by providing additional options:
Expand the glob string from the specified root directory and yield each
result as a WalkEntry object.
Synchronous version of expandGlob().
Format the file to the targeted EOL.
Moves a file or directory.
Moves a file or directory synchronously.
Walks the file tree rooted at root, yielding each file or directory in the tree filtered according to the given options.
Same as walk but uses synchronous ops
Interfaces
Options for copy and copySync.
- overwrite: boolean
overwrite existing file or directory.
- preserveTimestamps: boolean
When
true, will set last modification and access times to the ones of the original source files. Whenfalse, timestamp behavior is OS-dependent.
Options for exists and existsSync.
- isDirectory: boolean
When
true, will check if the path is a directory as well. Directory symlinks are included. - isFile: boolean
When
true, will check if the path is a file as well. File symlinks are included. - isReadable: boolean
When
true, will check if the path is readable by the user as well.
Options for expandGlob and expandGlobSync.
- canonicalize: boolean
Indicates whether the followed symlink's path should be canonicalized. This option works only if
followSymlinksis notfalse. - exclude: string[]
List of glob patterns to be excluded from the expansion.
- followSymlinks: boolean
Whether to follow symbolic links.
- includeDirs: boolean
Whether to include directories in entries.
- root: string
File path where to expand from.
Options for move and moveSync.
- overwrite: boolean
Whether the destination file should be overwritten if it already exists.
Walk entry for walk, walkSync,
expandGlob and expandGlobSync.
- path: string
Full path of the entry.
Options for walk and walkSync.
- canonicalize: boolean
Indicates whether the followed symlink's path should be canonicalized. This option works only if
followSymlinksis notfalse. - exts: string[]
List of file extensions used to filter entries. If specified, entries without the file extension specified by this option are excluded.
- followSymlinks: boolean
Indicates whether symlinks should be resolved or not.
- includeDirs: boolean
Indicates whether directory entries should be included or not.
- includeFiles: boolean
Indicates whether file entries should be included or not.
- includeSymlinks: boolean
Indicates whether symlink entries should be included or not. This option is meaningful only if
followSymlinksis set tofalse. - match: RegExp[]
List of regular expression patterns used to filter entries. If specified, entries that do not match the patterns specified by this option are excluded.
- maxDepth: number
The maximum depth of the file tree to be walked recursively.
- skip: RegExp[]
List of regular expression patterns used to filter entries. If specified, entries matching the patterns specified by this option are excluded.
Variables
Functions
Copy a file or directory. The directory can have contents. Like cp -r.
Requires the --allow-read and --allow-write flag.
Copy a file or directory. The directory can have contents. Like cp -r.
Requires the --allow-read and --allow-write flag.
Interfaces
Options for copy and copySync.
- overwrite: boolean
overwrite existing file or directory.
- preserveTimestamps: boolean
When
true, will set last modification and access times to the ones of the original source files. Whenfalse, timestamp behavior is OS-dependent.
Functions
Ensures that a directory is empty.
Deletes directory contents if the directory is not empty.
If the directory does not exist, it is created.
The directory itself is not deleted.
Requires the --allow-read and --allow-write flag.
Ensures that a directory is empty.
Deletes directory contents if the directory is not empty.
If the directory does not exist, it is created.
The directory itself is not deleted.
Requires the --allow-read and --allow-write flag.
Functions
Ensures that the directory exists.
If the directory structure does not exist, it is created. Like mkdir -p.
Requires the --allow-read and --allow-write flag.
Ensures that the directory exists.
If the directory structure does not exist, it is created. Like mkdir -p.
Requires the --allow-read and --allow-write flag.
Functions
Ensures that the file exists.
If the file that is requested to be created is in directories that do not
exist.
these directories are created. If the file already exists,
it is NOTMODIFIED.
Requires the --allow-read and --allow-write flag.
Ensures that the file exists.
If the file that is requested to be created is in directories that do not
exist,
these directories are created. If the file already exists,
it is NOT MODIFIED.
Requires the --allow-read and --allow-write flag.
Functions
Ensures that the hard link exists. If the directory structure does not exist, it is created.
Ensures that the hard link exists. If the directory structure does not exist, it is created.
Functions
Ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created.
Ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created.
Functions
Variables
Functions
Test whether or not the given path exists by checking with the file system. Please consider to check if the path is readable and either a file or a directory by providing additional options:
Test whether or not the given path exists by checking with the file system. Please consider to check if the path is readable and either a file or a directory by providing additional options:
Interfaces
Options for exists and existsSync.
- isDirectory: boolean
When
true, will check if the path is a directory as well. Directory symlinks are included. - isFile: boolean
When
true, will check if the path is a file as well. File symlinks are included. - isReadable: boolean
When
true, will check if the path is readable by the user as well.
Functions
Expand the glob string from the specified root directory and yield each
result as a WalkEntry object.
Synchronous version of expandGlob().
Interfaces
Options for expandGlob and expandGlobSync.
- canonicalize: boolean
Indicates whether the followed symlink's path should be canonicalized. This option works only if
followSymlinksis notfalse. - exclude: string[]
List of glob patterns to be excluded from the expansion.
- followSymlinks: boolean
Whether to follow symbolic links.
- includeDirs: boolean
Whether to include directories in entries.
- root: string
File path where to expand from.
Classes
Error thrown in move or moveSync when the
destination is a subdirectory of the source.
Functions
Interfaces
Options for move and moveSync.
- overwrite: boolean
Whether the destination file should be overwritten if it already exists.
Classes
Functions
Walks the file tree rooted at root, yielding each file or directory in the tree filtered according to the given options.
Same as walk but uses synchronous ops
Interfaces
Walk entry for walk, walkSync,
expandGlob and expandGlobSync.
- path: string
Full path of the entry.
Options for walk and walkSync.
- canonicalize: boolean
Indicates whether the followed symlink's path should be canonicalized. This option works only if
followSymlinksis notfalse. - exts: string[]
List of file extensions used to filter entries. If specified, entries without the file extension specified by this option are excluded.
- followSymlinks: boolean
Indicates whether symlinks should be resolved or not.
- includeDirs: boolean
Indicates whether directory entries should be included or not.
- includeFiles: boolean
Indicates whether file entries should be included or not.
- includeSymlinks: boolean
Indicates whether symlink entries should be included or not. This option is meaningful only if
followSymlinksis set tofalse. - match: RegExp[]
List of regular expression patterns used to filter entries. If specified, entries that do not match the patterns specified by this option are excluded.
- maxDepth: number
The maximum depth of the file tree to be walked recursively.
- skip: RegExp[]
List of regular expression patterns used to filter entries. If specified, entries matching the patterns specified by this option are excluded.