The shelljs configuration.
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).
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.
Files to use.
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
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:
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.
The source.
The destination.
Copies files. The wildcard * is accepted.
Available options: -f (force), -r, -R (recursive)
The source.
The destination.
Copies files. The wildcard * is accepted.
Available options: -f (force), -r, -R (recursive)
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.
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).
Returns array of all files (however deep) in the given paths.
The path(s) to search.
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.
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.)
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.)
The regular expression to use.
The files to process.
Returns a string containing all lines of the file that match the given regex_filter.
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 ..)
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.
Paths to search.
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 ..)
Paths to search.
An array of files in the given path(s).
Creates directories.
Creates directories.
Directories to create.
Creates directories.
Available options: p (full paths, will create intermediate dirs if necessary)
Creates directories.
Available options: p (full paths, will create intermediate dirs if necessary)
The directories to create.
Moves files. The wildcard * is accepted.
The source.
The destination.
Moves files. The wildcard * is accepted.
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)
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)
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)
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)
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.
Files to remove.
Removes files. The wildcard * is accepted.
Available options: -f (force), -r, -R (recursive)
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.
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.
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.
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.
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
Update the access and modification times of each FILE to the current time. A FILE argument that does not exist is created empty, unless -c is supplied