Object containing environment variables (both getter and setter). Shortcut to process.env.
Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.
A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).
Changes to directory dir for the duration of the script. Changes to home directory if no argument is supplied.
Directory to change in.
Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
The access mode. Octal.
The file to use.
Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
Available options: -v (output a diagnostic for every file processed), -c (like -v but report only when a change is made), -R (change files and directories recursively)
The access mode. Octal.
The file to use.
Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
The access mode. Can be an octal string or a symbolic mode string.
The file to use.
Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
Available options: -v (output a diagnostic for every file processed), -c (like -v but report only when a change is made), -R (change files and directories recursively)
The access mode. Can be an octal string or a symbolic mode string.
The file to use.
Copies files. The wildcard * is accepted.
The source.
The destination.
Copies files. The wildcard * is accepted.
Available options: -f: force (default behavior) -n: no-clobber -u: only copy if source is newer than dest -r, -R: recursive -L: follow symlinks -P: don't follow symlinks
The source.
The destination.
Clears the directory stack by deleting all of the elements.
Clears the directory stack by deleting all of the elements.
Returns an array of paths in the stack, or a single path if +N or -N was specified.
Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.
Returns an array of paths in the stack, or a single path if +N or -N was specified.
Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.
Returns an array of paths in the stack, or a single path if +N or -N was specified.
Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
Available options: -c, -N, +N. You can only use those.
Returns an array of paths in the stack, or a single path if +N or -N was specified.
Prints string to stdout, and returns string with additional utility methods like .to().
Returns the string that was passed as argument.
Prints string to stdout, and returns string with additional utility methods like .to().
Available options: -e: interpret backslash escapes (default) -n: remove trailing newline from output
Returns the string that was passed as argument.
Tests if error occurred in the last command.
Returns null if no error occurred, otherwise returns string explaining the error
Executes the given command synchronously.
The command to execute.
Returns an object containing the return code and output as string.
Executes the given command synchronously.
The command to execute.
Silence and synchronous options.
Returns an object containing the return code and output as string, or if {async:true} was passed, a ChildProcess.
Executes the given command synchronously.
The command to execute.
Silence and synchronous options.
Receives code and output asynchronously.
Executes the given command synchronously.
The command to execute.
Receives code and output asynchronously.
Exits the current process with the given exit code.
The exit code.
Returns array of all files (however deep) in the given paths.
An array of all files (however deep) in the given path(s).
Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
The regular expression to use.
Returns a string containing all lines of the file that match the given regex_filter.
Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.) -l: Print only filenames of matching files
The regular expression to use.
Returns a string containing all lines of the file that match the given regex_filter.
Read the start of a file.
Read the start of a file.
Links source to dest. Use -f to force the link, should dest already exist.
The source.
The destination.
Links source to dest. Use -f to force the link, should dest already exist.
Available options: s (symlink), f (force)
The source.
The destination.
Returns array of files in the given path, or in current directory if no path provided.
An array of files in the given path(s).
Returns array of files in the given path, or in current directory if no path provided.
Available options: -R: recursive -A: all files (include files beginning with ., except for . and ..) -L: follow symlinks -d: list directories themselves, not their contents -l: list objects representing each file, each with fields containing ls -l output fields. See fs.Stats for more info
An array of files in the given path(s).
Creates directories.
Creates directories.
Available options: p (full paths, will create intermediate dirs if necessary)
Moves files. The wildcard * is accepted.
The source.
The destination.
Moves files. The wildcard * is accepted.
Available options: -f: force (default behavior) -n: no-clobber
The source.
The destination.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
Returns an array of paths in the stack.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
Returns an array of paths in the stack.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
Returns an array of paths in the stack.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
You can only use -N and +N.
Returns an array of paths in the stack.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated) -q: Supresses output to the console.
Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
Returns an array of paths in the stack.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated) -q: Supresses output to the console.
Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
Returns an array of paths in the stack.
When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated) -q: Supresses output to the console.
You can only use -N and +N.
Returns an array of paths in the stack.
Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
Returns an array of paths in the stack.
Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
Returns an array of paths in the stack.
Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.
Returns an array of paths in the stack.
Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated) -q: Supresses output to the console.
Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
Returns an array of paths in the stack.
Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)
Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
Returns an array of paths in the stack.
Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)
Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.
Returns an array of paths in the stack.
Returns the current directory.
The current directory.
Removes files. The wildcard * is accepted.
Removes files. The wildcard * is accepted.
Available options: -f (force), -r, -R (recursive)
Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
The regular expression to use for search.
The replacement.
The file to process.
The new string after replacement.
Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)
The regular expression to use for search.
The replacement.
The file to process.
The new string after replacement.
Sets global configuration variables
Available options: +/-e
: exit upon error (config.fatal
), +/-v
: verbose: show all commands (config.verbose
), +/-f
: disable filename expansion (globbing)
Return the contents of the files, sorted line-by-line. Sorting multiple files mixes their content (just as unix sort does).
Return the contents of the files, sorted line-by-line. Sorting multiple files mixes their content (just as unix sort does).
Available options: -r: Reverse the results -n: Compare according to numerical value
Read the end of a file.
Read the end of a file.
Searches and returns string containing a writeable, platform-dependent temporary directory. Follows Python's tempfile algorithm.
The temp file path.
Evaluates expression using the available primaries and returns corresponding value.
'-b': true if path is a block device; '-c': true if path is a character device; '-d': true if path is a directory; '-e': true if path exists; '-f': true if path is a regular file; '-L': true if path is a symboilc link; '-p': true if path is a pipe (FIFO); '-S': true if path is a socket
The path.
See option parameter.
Filter adjacent matching lines from input.
Filter adjacent matching lines from input.
Available options: -i: Ignore case while comparing -c: Prefix lines by the number of occurrences -d: Only print duplicate lines, one for each group of identical lines
Searches for command in the system's PATH. On Windows looks for .exe, .cmd, and .bat extensions.
The command to search for.
Returns string containing the absolute path to the command.
Generated using TypeDoc
The shelljs configuration.