We try to keep non-standard, Deno specific, APIs in the
Deno namespace. We have grouped the APIs into the following functional categories.
A set of error constructors that are raised by Deno APIs.
A controller object that allows you to abort one or more DOM requests as and when desired.
The Deno abstraction for reading and writing files.
An event which takes place in the DOM.
EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them.
This Fetch API interface allows you to perform various actions on HTTP request and response headers. These actions include retrieving, setting, adding to, and removing. A Headers object has an associated header list, which is initially empty and consists of zero or more name and value pairs. You can add to this using methods like append() (see Examples). In all methods of this interface, header names are matched by case-insensitive byte sequence.
The location (URL) of the object it is linked to. Changes done on it are
reflected on the object it relates to. Accessible via
The MessageChannel interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties.
The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
Deno supports user timing Level 3 (see: https://w3c.github.io/user-timing)
which is not widely supported yet in other runtimes. These types are here
so that these features are still available when using the Deno namespace
in conjunction with other type libs, like
Encapsulates a single performance metric that is part of the performance
timeline. A performance entry can be directly created by making a performance
mark or measure (for example by calling the
Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an , , , or ).
This Fetch API interface represents a resource request.
This Fetch API interface represents the response to a request.
The URL interface represents an object providing static methods used for creating object URLs.
The URLPattern API provides a web platform primitive for matching URLs based on a convenient pattern syntax.
Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object.
This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.
The CryptoKey dictionary of the Web Crypto API represents a cryptographic key.
The CryptoKeyPair dictionary of the Web Crypto API represents a key pair for an asymmetric cryptography algorithm, also known as a public-key algorithm.
A FileInfo describes a file and is returned by
FsWatcher is returned by
A generic network listener for stream-oriented protocols.
UNSTABLE: New option, yet to be vetted.
Specialized listener that accepts TLS connections.
Options for writing to a file.
Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read.
Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
Deno provides extra properties on
This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object.
This Web Storage API interface provides access to a particular domain's session or local storage. It allows, for example, the addition, modification, or deletion of stored data items.
This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto).
The value returned from
This Streams API interface provides a standard abstraction for writing streaming data to a destination, known as a sink. This object comes with built-in backpressure and queuing.
This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate.
This Streams API interface is the object returned by WritableStream.getWriter() and once created locks the < writer to the WritableStream ensuring that no other streams can write to the underlying sink.
Permission descriptors which define a permission and can be queried, requested, or revoked.
The name of a "powerful feature" which needs permission.
The current status of the permission.
The type of the resource record. Only the listed types are supported currently.
Returns the script arguments to the program. If for example we run a program:
Build related information.
The URL of the entrypoint module entered from the command-line.
Deno's permission management API.
The current process id of the runtime.
The pid of the current process's parent.
A handle for
A handle for
A handle for
Version related information.
Registers an event listener in the global scope, which will be called
synchronously whenever the event
Shows the given message and waits for the enter key pressed. If the stdin is not interactive, it does nothing.
Decodes a string of data which has been encoded using base-64 encoding.
Creates a base-64 ASCII encoded string from the input string.
Cancels a timed, repeating action which was previously started by a call
Cancels a scheduled action initiated by
Shows the given message and waits for the answer. Returns the user's answer as boolean.
Change the current working directory to the specified path.
Changes the permission of a specific file/directory of specified path. Ignores the process's umask.
Synchronously changes the permission of a specific file/directory of specified path. Ignores the process's umask.
Change owner of a regular file or directory. This functionality is not available on Windows.
Synchronously change owner of a regular file or directory. This functionality is not available on Windows.
Close the given resource ID (rid) which has been previously opened, such as via opening or creating a file. Closing a file when you are finished with it is important to avoid leaking resources.
Connects to the hostname (default is "127.0.0.1") and port on the named
transport (default is "tcp"), and resolves to the connection (
Establishes a secure connection over TLS (transport layer security) using an optional cert file, hostname (default is "127.0.0.1") and port. The cert file is optional and if not included Mozilla's root certificates will be used (see also https://github.com/ctz/webpki-roots for specifics)
Copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. Fails if target path is a directory or is unwritable.
Synchronously copies the contents and permissions of one file to another specified path, by default creating a new file if needed, else overwriting. Fails if target path is a directory or is unwritable.
Creates a file if none exists or truncates an existing file and resolves to
an instance of
Creates a file if none exists or truncates an existing file and returns
an instance of
Return a string representing the current working directory.
Returns the path to the current deno executable.
Exit the Deno process with optional exit code. If no exit code is supplied then Deno will exit with return code of 0.
Flushes any pending data operations of the given file stream to disk.
Synchronously returns a
Flushes any pending data and metadata operations of the given file stream to disk.
Synchronously flushes any pending data and metadata operations of the given file stream to disk.
Truncates or extends the specified file stream, to reach the specified
Synchronously truncates or extends the specified file stream, to reach the
Converts the input into a string that has the same format as printed by
Check if a given resource id (
Send a signal to process under given
Listen announces on the local transport address.
Listen announces on the local transport address over TLS (transport layer security).
Resolves to a
Synchronously returns a
Creates a new temporary directory in the default directory for temporary
Synchronously creates a new temporary directory in the default directory
for temporary files, unless
Creates a new temporary file in the default directory for temporary
Synchronously creates a new temporary file in the default directory for
temporary files, unless
Returns an object describing the memory usage of the Deno process measured in bytes.
Creates a new directory with the specified path.
Synchronously creates a new directory with the specified path.
Open a file and resolve to an instance of
Synchronously open a file and return an instance of
Read from a resource ID (
Reads the directory given by
Synchronously reads the directory given by
Reads and resolves to the entire contents of a file as an array of bytes.
Synchronously reads and returns the entire contents of a file as an array
Resolves to the full path destination of the named symbolic link.
Returns the full path destination of the named symbolic link.
Synchronously read from a resource ID (
Asynchronously reads and returns the entire contents of a file as utf8 encoded string. Reading a directory throws an error.
Synchronously reads and returns the entire contents of a file as utf8 encoded string. Reading a directory throws an error.
Resolves to the absolute normalized path, with symbolic links resolved.
Returns absolute normalized path, with symbolic links resolved.
Removes the named file or directory.
Synchronously removes the named file or directory.
Synchronously renames (moves)
Performs DNS resolution against the given query, returning resolved records. Fails in the cases such as:
Returns a map of open resource ids (rid) along with their string
representations. This is an internal API and as such resource
Spawns new subprocess. RunOptions must contain at a minimum the
Seek a resource ID (
Synchronously seek a resource ID (
Services HTTP requests given a TCP or TLS socket.
Shutdown socket send operations.
Start TLS handshake from an existing connection using an optional list of CA certificates, and hostname (default is "127.0.0.1"). Specifying CA certs is optional. By default the configured root certificates are used. Using this function requires that the other end of the connection is prepared for a TLS handshake.
Resolves to a
Synchronously returns a
Register a test which will be run when
Truncates or extends the specified file, to reach the specified
Synchronously truncates or extends the specified file, to reach the
Used to upgrade an incoming HTTP request to a WebSocket.
Watch for file system events against one or more
Write to the resource ID (
Synchronously write to the resource ID (
Asynchronously write string
Synchronously write string
Dispatches an event in the global scope, synchronously invoking any registered event listeners for this event in the appropriate order. Returns false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault(). Otherwise it returns true.
Fetch a resource from the network. It returns a Promise that resolves to the Response to that request, whether it is successful or not.
Shows the given message and waits for the user's input. Returns the user's input as string. If the default value is given and the user inputs the empty string, then it returns the given default value. If the default value is not given and the user inputs the empty string, it returns null. If the stdin is not interactive, it returns null.
Remove a previously registered event listener from the global scope
Repeatedly calls a function , with a fixed time delay between each call.
Sets a timer which executes a function once after the timer expires. Returns an id which may be used to cancel the timeout.
The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.