Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/fsrouter/deps.ts

A file system based router for Deno.
Go to Latest
import * as fsrouter from "https://deno.land/x/fsrouter@2.11.1/deps.ts";

Namespaces

A library of assertion functions.

String formatters and utilities for dealing with ANSI color codes.

Command line arguments parser based on minimist.

Helpers for working with the filesystem.

Provides user-friendly serve on top of Deno's native HTTP server and other utilities for creating HTTP servers and clients.

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

Provides an way to manage cookies in a request and response on the server as a single iterable collection.

The base class that all derivative HTTP extend, providing a status and an expose property.

Provides an way to manage cookies in a request and response on the server as a single iterable collection, as well as the ability to sign and verify cookies to prevent tampering.

Used to construct an HTTP server.

Enums

EndOfLine character enum

Standard HTTP status codes.

Get log level numeric values through enum constants

Variables

Symbol which is used in mergeHeaders to extract a [string | string][] from an instance to generate the final set of headers.

A map of HttpErrors that are unique instances for each HTTP error status code.

A record of all the status codes text.

Functions

Make an assertion, error will be thrown if expr does not have truthy value.

Make an assertion that actual and expected are almost equal numbers through a given tolerance. It can be used to take into account IEEE-754 double-precision floating-point representation limitations. If the values are not almost equal then throw.

Make an assertion that actual includes the expected values. If not then an error will be thrown.

Make an assertion that actual and expected are equal, deeply. If not deeply equal, then throw.

Make an assertion that actual is not null or undefined. If not then throw.

Make an assertion, error will be thrown if expr have truthy value.

Make an assertion that obj is an instance of type. If not then throw.

Make an assertion that error is an Error. If not then an error will be thrown. An error class and a string that should be included in the error message can also be asserted.

Make an assertion that actual match RegExp expected. If not then throw.

Make an assertion that actual and expected are not equal, deeply. If not then throw.

Make an assertion that obj is not an instance of type. If so, then throw.

Make an assertion that actual not match RegExp expected. If match then throw.

Make an assertion that actual and expected are not strictly equal. If the values are strictly equal then throw.

Make an assertion that actual object is a subset of expected object, deeply. If not, then throw.

Executes a function which returns a promise, expecting it to reject.

Make an assertion that actual and expected are strictly equal. If not then throw.

Make an assertion that actual includes expected. If not then throw.

Executes a function, expecting it to throw. If it does not, then it throws.

Deep equality comparison used in assertions

Forcefully throws a failed assertion

Use this to stub out methods that will throw when invoked.

Use this to assert unreachable code.

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.

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.

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. If the directory structure does not exist, it is created.

Ensures that the link exists. If the directory structure does not exist, it is created.

f
fs.exists
deprecated

Test whether or not the given path exists by checking with the file system

f
fs.existsSync
deprecated

Test whether or not the given path exists by checking with the file system

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. The files are walked in lexical order, which makes the output deterministic but means that for very large directories walk() can be inefficient.

Same as walk() but uses synchronous ops

Returns an array of media types accepted by the request, in order of preference. If there are no media types supplied in the request, then any media type selector will be returned.

Returns an array of content encodings accepted by the request, in order of preference. If there are no encoding supplied in the request, then ["*"] is returned, implying any encoding is accepted.

Returns an array of languages accepted by the request, in order of preference. If there are no languages supplied in the request, then ["*"] is returned, imply any language is accepted.

Create an instance of an HttpError based on the status code provided.

Set the cookie header with empty value in the headers to delete it

Parse cookies of a header

Parse set-cookies of a header

A type guard that determines if the status code is a client error.

A type guard that determines if the status code is an error.

A type guard that determines if the value is an HttpError or not.

A type guard that determines if the status code is informational.

A type guard that determines if the status code is a redirection.

A type guard that determines if the status code is a server error.

A type guard that determines if the status code is successful.

Allows merging of various sources of headers into a final set of headers which can be used in a Response.

Serves HTTP requests with the given handler.

Constructs a server, accepts incoming connections on the given listener, and handles requests on these connections with the given handler.

Serves HTTPS requests with the given handler.

Set the cookie header properly in the headers

Log with critical level, using default logger.

Log with debug level, using default logger.

Log with error level, using default logger.

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.

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

Convert a glob string to a regular expression.

Test whether the given string is a glob

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

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

Interfaces

The options for the parse call.

Information about the connection a request arrived on.

Provides a iterable map interfaces for managing cookies server side.

An object which contains a headers property which has a value of an instance of Headers, like Request and Response.

An interface which describes the methods that SecureCookieMap uses to sign and verify cookies.

Additional serve options.

Options for running an HTTP server.

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

Type Aliases

The value returned from parse.

An HTTP status that is a client error (4XX).

Types of data that can be signed cryptographically.

An HTTP status that is an error (4XX and 5XX).

A handler for HTTP requests. Consumes a request and connection information and returns a response.

An HTTP status that is a informational (1XX).

An HTTP status that is a redirect (3XX).

An HTTP status that is a server error (5XX).

An HTTP status that is a success (2XX).

Union of valid log level strings