Function
mergeAn alias for this package's mergeArgs().
Inputs can be undefined, and if so, the default is returned.
Default object type.
Default values (if not specified in inputs).
Optional
inputs: undefinedOverriding values (changes to make).
Optional
recursive: booleanOptional. Whether to merge the object recursively. Default false.
Resulting object with all the defaults
and inputs
keys with
either default values or input values, as appropriate.
Passing recursive
as false means that the input type must be a Partial
(not RecursivePartial).
Optional
recursive: falsePassing recursive
as true means that the input type may actually be a
RecursivePartial.
Universal overload.
Optional
inputs: IOptional
recursive: booleanReadonly
argsA completed args object.
Default args for this stage.
Build a complete args object.
Optional
args: Partial<FileSystemType.Args> | RecursivePartial<FileSystemType.Args>Readonly
consoleInstance used to log messages within the class.
Readonly
ncThe instance of NodeConsole used within this class.
Instance used to log messages and debugging info.
Override arguments.
Overrides the default function to return a string representation of this object.
Copies files from one directory to another, maintaing their relative directory structure.
Glob patterns for paths to copy.
Depth level for output to the console.
Path to directory where matched files will be copied.
Optional
sourceDir: null | stringRelative source directory. If any, the globs are resolved as relative to that directory and the path/dir structure copied to the outputDir is relative to this sourceDir.
Optional
args: Partial<FileSystemType.Copy.Args>Overrides for default options.
Array of paths to the newly-copied files/etc.
FileSystem.Error — If copying a file fails.
Experimental
Copies a file to another path.
Location to write file.
Location to copy the source path to.
Optional
args: Partial<CopyFileArgs>Optional configuration.
Path to file if written, or false on failure.
Deletes given globs (via node.NodeFiles.delete).
This catches any errors from node.NodeFiles.delete, ignores ENOTEMPTY errors, and re-throws the rest.
Glob patterns for paths to delete.
Depth level for output to the console.
Optional
dryRun: booleanIf true, files that would be deleted are printed to the console and not deleted.
Optional
args: Partial<FileSystemType.Glob.Args>Optional glob configuration.
Experimental
Read the paths within a directory.
Directory to read.
Optional
args: Partial<ReadDirArgs>Optional configuration.
Paths within the given directory.
Reads a file.
File to read.
Optional
args: Partial<ReadFileArgs>Optional configuration.
Contents of the file.
Writes a file.
Location to write file.
Contents to write.
Optional
args: Partial<WriteFileArgs>Optional configuration.
Path to file if written, or false on failure.
Changes just the file name of a path
Full path with updated basename.
Gets the valid paths matched against the input globs.
Glob patterns to match.
Optional glob configuration.
Matched paths.
Returns relative paths, based on the root defined the the opts.
Path to make relative.
Resolves relative to the root defined the the opts.
Paths to resolve.
Returns a unique version of the inputPath (i.e., where no file exists) by appending a number.
Path to make unique.
Absolute, unique version of the given inputPath
.
NodeFiles.changeBaseName Used to update the basename to test for uniqueness.
Runs minify on the given file globs.
Glob patterns for paths to minify.
File format for the input globs.
Depth level for output to the console.
Optional
args: Partial<FileSystemType.Minify.Args>Overrides for default options.
Optional
renamer: (path: string) => stringFunction used to define the new basename for the minified files, if any.
Paths to the minified files (both source and output).
Runs prettier on the given file globs.
Glob patterns for paths to run through prettier.
File format for the input globs.
Optional
args: Partial<FileSystemType.Prettier.Args>Overrides for default options.
Paths to the formatted files.
FileSystem.Error — If no parser was given or could be automatically assigned based on the format (this is unlikely if you respect the FileSystemType.Prettier.Format type).
Replaces the given text or regex in the given file globs.
Glob patterns for paths to replace in.
Replacements to make. The first tuple item is a string or RegExp to find and the second item is a string to replace.
Depth level for output to the console.
Optional
args: Partial<FileSystemType.Glob.Args>Optional glob configuration.
Paths to the replaced files.
Extends the node.NodeFiles class with some custom logic useful to this package.
Since
0.1.0-alpha