Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fresh/src/dev/deps.ts

The next-gen web framework.
Extremely Popular
Go to Latest
import * as fresh from "https://deno.land/x/fresh@1.4.0/src/dev/deps.ts";

Namespaces

String formatters and utilities for dealing with ANSI color codes.

Helpers for working with the filesystem.

parse function for parsing JSONC (JSON with Comments) strings.

The semantic version parser.

Enums

Platform-specific conventions for the line ending format (i.e., the "end-of-line").

Variables

The number of milliseconds in a day.

A comparator which will span all valid semantic versions

ANY is a sentinel value used by some range calculations. It is not a valid SemVer object and should not be used directly.

A sentinel value used to denote an invalid SemVer object which may be the result of impossible ranges or comparator operations.

MAX is a sentinel value used by some range calculations. It is equivalent to ∞.∞.∞.

The minimum valid SemVer object. Equivalent to 0.0.0.

A comparator which will not span any semantic versions

The number of milliseconds in a week.

Functions

Set background color to black.

Set background color to blue.

Set background color to bright black.

Set background color to bright blue.

Set background color to bright cyan.

Set background color to bright green.

Set background color to bright magenta.

Set background color to bright red.

Set background color to bright white.

Set background color to bright yellow.

Set background color to cyan.

Set background color to green.

Set background color to magenta.

Set background color to red.

Set background color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Set background color to white.

Set background color to yellow.

Set text color to black.

Set text color to blue.

Make the text bold.

Set text color to bright black.

Set text color to bright blue.

Set text color to bright cyan.

Set text color to bright green.

Set text color to bright magenta.

Set text color to bright red.

Set text color to bright white.

Set text color to bright yellow.

Set text color to cyan.

The text emits only a small amount of light.

Get whether text color change is enabled or disabled.

Set text color to gray.

Set text color to green.

Make the text hidden.

Invert background color and text color.

Make the text italic.

Set text color to magenta.

Set text color to red.

Reset the text modified

Set text color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set text color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Set changing text color to enabled or disabled

Put horizontal line through the center of the text.

Remove ANSI escape codes from the string.

Make the text underline.

Set text color to white.

Set text color to yellow.

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:

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

Greater than or equal to comparison

Converts a JSON with Comments (JSONC) string into an object. If a syntax error is found, throw a SyntaxError.

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.

Do a comparison of two semantic version objects based on the given operator

Formats the comparator into a string

Returns true if the range of possible versions intersects with the other comparators set of possible versions

The maximum version that could match this comparator.

The minimum semantic version that could match this comparator

Compare two semantic version objects.

Compare two semantic version objects including build metadata.

Returns difference between two versions by the release type, or undefined if the versions are the same.

Returns true if they're logically equivalent, even if they're not the exact same version object.

Format a SemVer object into a string.

Greater than comparison

Greater than or equal to comparison

Checks to see if the version is greater than all possible versions of the range.

Returns the new version resulting from an increment by release type.

Checks to see if value is a valid SemVer object. It does a check into each field including prerelease and build.

Does a deep check on the value to see if it is a valid SemVerComparator object.

Does a deep check on the object to determine if its a valid range.

Less than comparison

Less than or equal to comparison

Greater than range comparison

f
semver.major
deprecated

Returns the highest version in the list that satisfies the range, or undefined if none of them do.

f
semver.minor
deprecated

Returns the lowest version in the list that satisfies the range, or undefined if none of them do.

Not equal comparison

Returns 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.)

Attempt to parse a string as a semantic version, returning either a SemVer object or throws a TypeError.

Parses a comparator string into a valid SemVerComparator.

Parses a range string into a SemVerRange object or throws a TypeError.

f
semver.patch
deprecated

Formats the range into a string

The ranges intersect every range of AND comparators intersects with a least one range of OR ranges.

The maximum valid SemVer for a given range or INVALID

The minimum valid SemVer for a given range or INVALID

A reverse comparison of two versions. Same as compare but 1 and -1 are inverted.

Sorts a list of semantic versions in descending order.

f
semver.satisfies
deprecated

Sorts a list of semantic versions in ascending order.

Test to see if a semantic version falls within the range of the comparator.

Test to see if the version satisfies the range.

f
semver.valid
deprecated

Walks the file tree rooted at root, yielding each file or directory in the tree filtered according to the given options.

Interfaces

A SemVer object parsed into its constituent parts.

The shape of a valid semantic version comparator

A type representing a semantic version range. The ranges consist of a nested array, which represents a set of OR comparisons while the inner array represents AND comparisons.

Type Aliases

The type of the result of parsing JSON.

The style to use when formatting a SemVer object into a string

SemVer comparison operators.

The possible release types are used as an operator for the increment function and as a result of the difference function.