Skip to main content
Module

x/gustwind/server-deps.ts

🐳💨 – Deno powered JSON oriented site generator
Go to Latest
import * as gustwind from "https://deno.land/x/gustwind@v0.31.0/server-deps.ts";

Namespaces

Provide help with asynchronous tasks like delays, debouncing, deferring, or pooling.

Command line arguments parser based on minimist.

Helpers for working with the filesystem.

Utilities for working with OS-specific file paths.

parse and stringify for handling YAML encoded data.

Classes

The MuxAsyncIterator class multiplexes multiple async iterators into a single stream. It currently makes an assumption:

  • The final result (the value returned and not yielded from the iterator) does not matter; if there is any, it is discarded.

Used to construct an HTTP server.

Compose a stream of CST nodes into a stream of YAML Documents.

Splits an input string into lexical tokens, i.e. smaller strings that are easily identifiable by tokens.tokenType().

Tracks newlines during parsing in order to provide an efficient API for determining the one-indexed { line, col } position for any offset within the input.

A YAML concrete syntax tree (CST) parser

Enums

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

Functions

Make Promise or AsyncIterable abortable with the given signal.

Make AsyncIterable abortable with the given signal.

Make Promise abortable with the given signal.

Create a promise which will be rejected with DeadlineError when a given delay is exceeded.

Creates a debounced function that delays the given func by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

Creates a Promise with the reject and resolve functions placed as methods on the promise object itself. It allows you to do:

pooledMap transforms values from an (async) iterable into another async iterable. The transforms are done concurrently, with a max concurrency defined by the poolLimit.

Branches the given async iterable into the n branches.

Pretty-prints an analysis of the metafile JSON to a string. This is just for convenience to be able to match esbuild's pretty-printing exactly. If you want to customize it, you can just inspect the data in the metafile yourself.

A synchronous version of "analyzeMetafile".

This function invokes the "esbuild" command-line tool for you. It returns a promise that either resolves with a "BuildResult" object or rejects with a "BuildFailure" object.

A synchronous version of "build".

Converts log messages to formatted message strings suitable for printing in the terminal. This allows you to reuse the built-in behavior of esbuild's log message formatter. This is a batch-oriented API for efficiency.

A synchronous version of "formatMessages".

This configures the browser-based version of esbuild. It is necessary to call this first and wait for the returned promise to be resolved before making other API calls when using esbuild in the browser.

This function is similar to "build" but it serves the resulting files over HTTP on a localhost address with the specified port.

This function transforms a single JavaScript file. It can be used to minify JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript to older JavaScript. It returns a promise that is either resolved with a "TransformResult" object or rejected with a "TransformFailure" object.

A synchronous version of "transform".

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

Given an extension, lookup the appropriate media type for that extension. Likely you should be using contentType() though instead.

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.

Create a new scalar token with value

Get a printable representation of a lexer token

If token is a CST flow or block scalar, determine its string value and a few other attributes. Otherwise, return null.

Set the value of token to the given string value, overwriting any previous contents and type that it may have.

Identify the type of a lexer token. May return null for unknown tokens.

Apply a visitor to a CST document or item.

Parse an input string into JavaScript.

Parse the input as a stream of YAML documents.

Parse an input string into a single YAML.Document

Stringify a value as a YAML document.

Apply a visitor to an AST node or document.

Apply an async visitor to an AST node or document.

Parses content as single YAML document.

Same as parse(), but understands multi-document sources. Applies iterator to each document if specified, or returns array of documents.

Serializes object as a YAML document.

Interfaces

A debounced function that will be delayed by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

The options for the parse call.

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