Skip to main content
Module

x/dnit/dnit/deps.ts

dnit: typescript (deno) task executor
Latest
import * as dnit from "https://deno.land/x/dnit@dnit-v1.14.4/dnit/deps.ts";

Namespaces

N
flags
deprecated

Command line arguments parser based on minimist.

Helpers for working with the filesystem.

Logging library with the support for terminal and file outputs. Also provides interfaces for building custom loggers.

Utilities for working with OS-specific file paths.

Classes

Error thrown in move or moveSync when the destination is a subdirectory of the source.

Error thrown in walk or walkSync during iteration.

This is the default logger. It will output color coded log messages to the console via console.log().

This handler will output to a file using an optional mode (default is a, e.g. append). The file will grow indefinitely. It uses a buffer for writing to file. Logs can be manually flushed with fileHandler.flush(). Log messages with a log level greater than error are immediately flushed. Logs are also flushed on process completion.

An object that encapsulates provided message and arguments as well some metadata that can be later used when formatting a message.

This handler extends the functionality of the FileHandler by "rotating" the log file when it reaches a certain size. maxBytes specifies the maximum size in bytes that the log file can grow to before rolling over to a new one. If the size of the new log message plus the current log file size exceeds maxBytes then a roll-over is triggered. When a roll-over occurs, before the log message is written, the log file is renamed and appended with .1. If a .1 version already existed, it would have been renamed .2 first and so on. The maximum number of log files to keep is specified by maxBackupCount. After the renames are complete the log message is written to the original, now blank, file.

Variables

End-of-line character for Windows platforms.

End-of-line character evaluated for the current platform.

End-of-line character for POSIX platforms such as macOS and Linux.

Permitted log level names

Use this to retrieve the numeric log level by it's associated name. Defaults to INFO.

v
path.posix
deprecated
v
path.win32
deprecated

Functions

Generate a trackedfile for tracking

f
flags.parse
deprecated

Take a set of command line arguments, optionally with a set of options, and return an object representing the flags found in the passed arguments.

Asynchronously copy a file or directory. The directory can have contents. Like cp -r.

Synchronously copy a file or directory. The directory can have contents. Like cp -r.

Returns the detected EOL character(s) detected in the input string. If no EOL character is detected, null is returned.

Asynchronously ensures that a directory is empty deletes the directory contents it is not empty. If the directory does not exist, it is created. The directory itself is not deleted.

Synchronously ensures that a directory is empty deletes the directory contents it is not empty. If the directory does not exist, it is created. The directory itself is not deleted.

Asynchronously ensures that the directory exists. If the directory structure does not exist, it is created. Like mkdir -p.

Synchronously ensures that the directory exists. If the directory structure does not exist, it is created. Like mkdir -p.

Asynchronously 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.

Synchronously 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.

Asynchronously ensures that the hard link exists. If the directory structure does not exist, it is created.

Synchronously ensures that the hard link exists. If the directory structure does not exist, it is created.

Asynchronously ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created. If the link already exists, it is not modified but error is thrown if it is not point to the given target.

Synchronously ensures that the link exists, and points to a valid file. If the directory structure does not exist, it is created. If the link already exists, it is not modified but error is thrown if it is not point to the given target.

Asynchronously test whether or not the given path exists by checking with the file system.

Synchronously test whether or not the given path exists by checking with the file system.

Returns an async iterator that yields each file path matching the given glob pattern. The file paths are relative to the provided root directory. If root is not provided, the current working directory is used. The root directory is not included in the yielded file paths.

Returns an iterator that yields each file path matching the given glob pattern. The file paths are relative to the provided root directory. If root is not provided, the current working directory is used. The root directory is not included in the yielded file paths.

Normalize the input string to the targeted EOL.

Asynchronously moves a file or directory.

Synchronously moves a file or directory.

Recursively walks through a directory and yields information about each file and directory encountered.

Same as walk but uses synchronous ops

Log with critical level, using default logger.

Log with debug level, using default logger.

Log with error level, using default logger.

Returns the numeric log level associated with the passed, stringy log level name.

Returns the stringy log level name provided the numeric log level.

Get a logger instance. If not specified name, get the default logger.

Log with info level, using default logger.

Setup logger config.

Log with warning level, using default logger.

Return the last portion of a path. Trailing directory separators are ignored, and optional suffix is removed.

Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator.

Return the directory path of a path.

Return the extension of the path with leading period.

Generate a path from FormatInputPathObject object. It does the opposite of parse.

Converts a file URL to a path string.

Convert a glob string to a regular expression.

Verifies whether provided path is absolute

Test whether the given string is a glob

Join all given a sequence of paths,then normalizes the resulting path.

Like join(), but doesn't collapse "**/.." when globstar is true.

Normalize the path, resolving '..' and '.' segments. Note that resolving these segments does not necessarily mean that all will be eliminated. A '..' at the top-level will be preserved, and an empty path is canonically '.'.

Like normalize(), but doesn't collapse "**/.." when globstar is true.

Return a ParsedPath object of the path. Use format to reverse the result.

Return the relative path from from to to based on current working directory.

Resolves path segments into a path

Converts a path string to a file URL.

Resolves path to a namespace path

Coerces a string to semver if possible

Return true if version is greater than all the versions possible in the range.

Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid.

Return true if any of the ranges comparators intersect

Return true if version is less than all the versions possible in the range.

Return the major version number.

Return the minor version number.

Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.)

Return the patch version number.

Generate a task

Interfaces

The options for the parse call.

Options for copy and copySync.

Options for exists and existsSync.

Options for expandGlob and expandGlobSync.

Options for globToRegExp.

Options for move and moveSync.

Walk entry for walk, walkSync, expandGlob and expandGlobSync.

Options for walk and walkSync.

Options for globToRegExp.

A parsed path object generated by path.parse() or consumed by path.format().