Skip to main content

There are APIs that are built into the Deno CLI that are beyond those that are built-ins for JavaScript. They are a combination of web platform APIs Deno has implemented and Deno specific APIs.

We try to keep non-standard, Deno specific, APIs in the Deno namespace. We have grouped the APIs into the following functional categories.

Compression Streams API

An API for compressing a stream of data.

An API for decompressing a stream of data.

Console and Debugging

Option which can be specified when performing Deno.inspect.

A symbol which can be used as a key for a custom method which will be called when Deno.inspect() is called, or when the object is logged to the console.

Converts the input into a string that has the same format as printed by console.log().

Cron

CronSchedule is the interface used for JSON format cron schedule.

CronScheduleExpression is used as the type of minute, hour, dayOfMonth, month, and dayOfWeek in CronSchedule.

Create a cron job that will periodically execute the provided handler callback based on the specified schedule.

DOM APIs

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.

This type has been renamed to StructuredSerializeOptions. Use that type for new code.

Creates a deep copy of a given value using the structured clone algorithm.

DOM Events

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.

Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an , , , or ).

Registers an event listener in the global scope, which will be called synchronously whenever the event type is dispatched.

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.

Remove a previously registered event listener from the global scope

Encoding API

Decodes a string of data which has been encoded using base-64 encoding.

Creates a base-64 ASCII encoded string from the input string.

Errors

A set of error constructors that are raised by Deno APIs.

Raised when attempting to open a server listener on an address and port that already has a listener.

Raised when the underlying operating system reports an EADDRNOTAVAIL error.

Raised when trying to create a resource, like a file, that already exits.

The underlying IO resource is invalid or closed, and so the operation could not be performed.

Raised when trying to write to a resource and a broken pipe error occurs. This can happen when trying to write directly to stdout or stderr and the operating system is unable to pipe the output for a reason external to the Deno runtime.

Raised when the underlying IO resource is not available because it is being awaited on in another block of code.

Raised when the underlying operating system reports an ECONNABORTED error.

Raised when the underlying operating system reports that a connection to a resource is refused.

Raised when the underlying operating system reports that a connection has been reset. With network servers, it can be a normal occurrence where a client will abort a connection instead of properly shutting it down.

Raised when too many symbolic links were encountered when resolving the filename.

Raised in situations where when attempting to load a dynamic import, too many redirects were encountered.

Raised when the underlying operating system reports an EINTR error. In many cases, this underlying IO error will be handled internally within Deno, or result in an @{link BadResource} error instead.

Raised when an operation to returns data that is invalid for the operation being performed.

Raised when trying to open, create or write to a directory.

Raised when performing a socket operation but the remote host is not reachable.

Raised when trying to perform an operation on a path that is not a directory, when directory is required.

Raised when the underlying operating system reports an ENOTCONN error.

Raised when the underlying operating system indicates that the file was not found.

Raised when the underlying Deno API is asked to perform a function that is not currently supported.

Raised when the underlying operating system indicates the current user which the Deno process is running under does not have the appropriate permissions to a file or resource, or the user did not provide required --allow-* flag.

Raised when the underlying operating system reports that an I/O operation has timed out (ETIMEDOUT).

Raised when attempting to read bytes from a resource, but the EOF was unexpectedly encountered.

Raised when the underlying operating system would need to block to complete but an asynchronous (non-blocking) API is used.

Raised when expecting to write to a IO buffer resulted in zero bytes being written.

ES Modules

Deno provides extra properties on import.meta. These are included here to ensure that these are still available when using the Deno namespace in conjunction with other type libs, like dom.

Fetch API

Basic authentication credentials to be used with a Deno.Proxy server when specifying Deno.CreateHttpClientOptions.

The options used when creating a Deno.HttpClient.

A custom HttpClient for use with fetch function. This is designed to allow custom certificates or proxies to be used with fetch().

The definition of a proxy when specifying Deno.CreateHttpClientOptions.

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

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.

This Fetch API interface represents a resource request.

This Fetch API interface represents the response to a request.

Create a custom HttpClient to use with fetch. This is an extension of the web platform Fetch API which allows Deno to use custom TLS certificates and connect via a proxy while using fetch().

Fetch a resource from the network. It returns a Promise that resolves to the Response to that Request, whether it is successful or not.

FFI

An unsafe function pointer for passing JavaScript functions as C function pointers to foreign function calls.

An unsafe pointer to a function, for calling functions that are not present as symbols.

A collection of static functions for interacting with pointer objects.

An unsafe pointer view to a memory location as specified by the pointer value. The UnsafePointerView API follows the standard built in interface DataView for accessing the underlying types at an memory location (numbers, strings and raw bytes).

A dynamic library resource. Use Deno.dlopen to load a dynamic library and return this interface.

The interface for a foreign function as defined by its parameter and result types.

A foreign library interface descriptor.

Definition of a unsafe callback function.

This magic code used to implement better type hints for Deno.dlopen

Type conversion for foreign symbol return types.

Type conversion for foreign symbol return types and unsafe callback parameters.

All BigInt number types for interfacing with foreign functions.

The native boolean type for interfacing to foreign functions.

The native buffer type for interfacing to foreign functions.

The native function type for interfacing with foreign functions.

All plain number types for interfacing with foreign functions.

The native pointer type for interfacing to foreign functions.

The native struct type for interfacing with foreign functions.

All supported types for interfacing with foreign functions.

The native void type for interfacing with foreign functions.

A non-null pointer, represented as an object at runtime. The object's prototype is null and cannot be changed. The object cannot be assigned to either and is thus entirely read-only.

Pointers are represented either with a PointerObject object or a null if the pointer is null.

A utility type that infers a foreign library interface.

A utility type that infers a foreign symbol.

A utility type for conversion of parameter types of foreign functions.

Type conversion for unsafe callback return types.

Type conversion for foreign symbol parameters and unsafe callback return types.

An unsafe callback function.

Opens an external dynamic library and registers symbols, making foreign functions available to be called.

File System

The Deno abstraction for reading and writing files.

Information about a directory entry returned from Deno.readDir and Deno.readDirSync.

Provides information about a file and is returned by Deno.stat, Deno.lstat, Deno.statSync, and Deno.lstatSync or from calling stat() and statSync() on an Deno.FsFile instance.

Represents a unique file system event yielded by a Deno.FsWatcher.

Returned by Deno.watchFs. It is an async iterator yielding up system events. To stop watching the file system by calling .close() method.

Options which can be set when using Deno.mkdir and Deno.mkdirSync.

Options which can be set when doing Deno.open and Deno.openSync.

Options which can be set when using Deno.readFile or Deno.readFileSync.

Options which can be set when using Deno.remove and Deno.removeSync.

Options that can be used with symlink and symlinkSync.

Options for writing to a file.

Additional information for FsEvent objects with the "other" kind.

v
Deno.File
deprecated

The Deno abstraction for reading and writing files.

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.

Synchronously change owner of a regular file or directory.

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 Deno.FsFile.

Creates a file if none exists or truncates an existing file and returns an instance of Deno.FsFile.

Flushes any pending data operations of the given file stream to disk.

Synchronously flushes any pending data operations of the given file stream to disk.

Acquire an advisory file-system lock for the provided file.

Acquire an advisory file-system lock synchronously for the provided file.

f
Deno.fstat
deprecated

Returns a Deno.FileInfo for the given file stream.

f
Deno.fstatSync
deprecated

Synchronously returns a Deno.FileInfo for the given file stream.

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.

f
Deno.ftruncate
deprecated

Truncates or extends the specified file stream, to reach the specified len.

Synchronously truncates or extends the specified file stream, to reach the specified len.

Release an advisory file-system lock for the provided file.

Release an advisory file-system lock for the provided file synchronously.

f
Deno.futime
deprecated

Changes the access (atime) and modification (mtime) times of a file stream resource referenced by rid. Given times are either in seconds (UNIX epoch time) or as Date objects.

f
Deno.futimeSync
deprecated

Synchronously changes the access (atime) and modification (mtime) times of a file stream resource referenced by rid. Given times are either in seconds (UNIX epoch time) or as Date objects.

Creates newpath as a hard link to oldpath.

Synchronously creates newpath as a hard link to oldpath.

Resolves to a Deno.FileInfo for the specified path. If path is a symlink, information for the symlink will be returned instead of what it points to.

Synchronously returns a Deno.FileInfo for the specified path. If path is a symlink, information for the symlink will be returned instead of what it points to.

Creates a new temporary directory in the default directory for temporary files, unless dir is specified. Other optional options include prefixing and suffixing the directory name with prefix and suffix respectively.

Synchronously creates a new temporary directory in the default directory for temporary files, unless dir is specified. Other optional options include prefixing and suffixing the directory name with prefix and suffix respectively.

Creates a new temporary file in the default directory for temporary files, unless dir is specified.

Synchronously creates a new temporary file in the default directory for temporary files, unless dir is specified.

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 Deno.FsFile. The file does not need to previously exist if using the create or createNew open options. The caller may have the resulting file automatically closed by the runtime once it's out of scope by declaring the file variable with the using keyword.

Synchronously open a file and return an instance of Deno.FsFile. The file does not need to previously exist if using the create or createNew open options. The caller may have the resulting file automatically closed by the runtime once it's out of scope by declaring the file variable with the using keyword.

Reads the directory given by path and returns an async iterable of Deno.DirEntry. The order of entries is not guaranteed.

Synchronously reads the directory given by path and returns an iterable of Deno.DirEntry. The order of entries is not guaranteed.

Reads and resolves to the entire contents of a file as an array of bytes. TextDecoder can be used to transform the bytes to string if required. Reading a directory returns an empty data array.

Synchronously reads and returns the entire contents of a file as an array of bytes. TextDecoder can be used to transform the bytes to string if required. Reading a directory returns an empty data array.

Resolves to the full path destination of the named symbolic link.

Synchronously returns the full path destination of the named symbolic link.

Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.

Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.

Resolves to the absolute normalized path, with symbolic links resolved.

Synchronously returns absolute normalized path, with symbolic links resolved.

Removes the named file or directory.

Synchronously removes the named file or directory.

Renames (moves) oldpath to newpath. Paths may be files or directories. If newpath already exists and is not a directory, rename() replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.

Synchronously renames (moves) oldpath to newpath. Paths may be files or directories. If newpath already exists and is not a directory, renameSync() replaces it. OS-specific restrictions may apply when oldpath and newpath are in different directories.

Resolves to a Deno.FileInfo for the specified path. Will always follow symlinks.

Synchronously returns a Deno.FileInfo for the specified path. Will always follow symlinks.

Creates newpath as a symbolic link to oldpath.

Creates newpath as a symbolic link to oldpath.

Truncates (or extends) the specified file, to reach the specified len. If len is not specified then the entire file contents are truncated.

Synchronously truncates (or extends) the specified file, to reach the specified len. If len is not specified then the entire file contents are truncated.

Retrieve the process umask. If mask is provided, sets the process umask. This call always returns what the umask was before the call.

Changes the access (atime) and modification (mtime) times of a file system object referenced by path. Given times are either in seconds (UNIX epoch time) or as Date objects.

Synchronously changes the access (atime) and modification (mtime) times of a file system object referenced by path. Given times are either in seconds (UNIX epoch time) or as Date objects.

Watch for file system events against one or more paths, which can be files or directories. These paths must exist already. One user action (e.g. touch test.file) can generate multiple file system events. Likewise, one user action can result in multiple file paths in one event (e.g. mv old_name.txt new_name.txt).

Write data to the given path, by default creating a new file if needed, else overwriting.

Synchronously write data to the given path, by default creating a new file if needed, else overwriting.

Write string data to the given path, by default creating a new file if needed, else overwriting.

Synchronously write string data to the given path, by default creating a new file if needed, else overwriting.

HTTP Server

I
Deno.HttpConn
deprecated

The async iterable that is returned from Deno.serveHttp which yields up RequestEvent events, representing individual requests on the HTTP server connection.

An instance of the server created using Deno.serve() API.

The event yielded from an HttpConn which represents an HTTP request from a remote client.

Information for a HTTP request.

Options which can be set when calling Deno.serve.

Additional options which are used when opening a TLS (HTTPS) server.

Information for a unix domain socket HTTP request.

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

T
Deno.Server
deprecated

A handler for unix domain socket HTTP requests. Consumes a request and returns a response.

Serves HTTP requests with the given handler.

f
Deno.serveHttp
deprecated

Provides an interface to handle HTTP request and responses over TCP or TLS connections. The method returns an HttpConn which yields up RequestEvent events, which utilize the web platform standard Request and Response objects to handle the request.

I/O

c
Deno.Buffer
deprecated

A variable-sized buffer of bytes with read() and write() methods.

I
Deno.Closer
deprecated

An abstract interface which when implemented provides an interface to close files/resources that were previously opened.

I
Deno.Reader
deprecated

An abstract interface which when implemented provides an interface to read bytes into an array buffer asynchronously.

I
Deno.ReaderSync
deprecated

An abstract interface which when implemented provides an interface to read bytes into an array buffer synchronously.

An abstract interface which when implemented provides an interface to seek within an open file/resource asynchronously.

An abstract interface which when implemented provides an interface to seek within an open file/resource synchronously.

I
Deno.Writer
deprecated

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource asynchronously.

I
Deno.WriterSync
deprecated

An abstract interface which when implemented provides an interface to write bytes from an array buffer to a file/resource synchronously.

A reference to stderr which can be used to write directly to stderr. It implements the Deno specific Writer, WriterSync, and Closer interfaces as well as provides a WritableStream interface.

A reference to stdin which can be used to read directly from stdin. It implements the Deno specific Reader, ReaderSync, and Closer interfaces as well as provides a ReadableStream interface.

A reference to stdout which can be used to write directly to stdout. It implements the Deno specific Writer, WriterSync, and Closer interfaces as well as provides a WritableStream interface.

f
Deno.close
deprecated

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.

Gets the size of the console as columns/rows.

f
Deno.copy
deprecated

Copies from src to dst until either EOF (null) is read from src or an error occurs. It resolves to the number of bytes copied or rejects with the first error encountered while copying.

f
Deno.isatty
deprecated

Check if a given resource id (rid) is a TTY (a terminal).

f
Deno.iter
deprecated

Turns a Reader, r, into an async iterator.

f
Deno.iterSync
deprecated

Turns a ReaderSync, r, into an iterator.

f
Deno.read
deprecated

Read from a resource ID (rid) into an array buffer (buffer).

f
Deno.readAll
deprecated

Read Reader r until EOF (null) and resolve to the content as Uint8Array`.

f
Deno.readAllSync
deprecated

Synchronously reads Reader r until EOF (null) and returns the content as Uint8Array.

f
Deno.readSync
deprecated

Synchronously read from a resource ID (rid) into an array buffer (buffer).

f
Deno.seek
deprecated

Seek a resource ID (rid) to the given offset under mode given by whence. The call resolves to the new position within the resource (bytes from the start).

f
Deno.seekSync
deprecated

Synchronously seek a resource ID (rid) to the given offset under mode given by whence. The new position within the resource (bytes from the start) is returned.

f
Deno.write
deprecated

Write to the resource ID (rid) the contents of the array buffer (data).

f
Deno.writeAll
deprecated

Write all the content of the array buffer (arr) to the writer (w).

Synchronously write all the content of the array buffer (arr) to the writer (w).

f
Deno.writeSync
deprecated

Synchronously write to the resource ID (rid) the contents of the array buffer (data).

A enum which defines the seek mode for IO related APIs that support seeking.

Jupyter

A namespace containing runtime APIs available in Jupyter notebooks.

A collection of supported media types and data for Jupyter frontends.

Broadcast a message on IO pub channel.

Display function for Jupyter Deno Kernel. Mimics the behavior of IPython's display(obj, raw=True) function to allow asynchronous displaying of objects in Jupyter.

Format an object for displaying in Deno

Show HTML in Jupyter frontends with a tagged template function.

Show Markdown in Jupyter frontends with a tagged template function.

SVG Tagged Template Function.

KV

An operation on a Deno.Kv that can be performed atomically. Atomic operations do not auto-commit, and must be committed explicitly by calling the commit method.

A key-value database that can be used to store and retrieve data.

An iterator over a range of data entries in a Deno.Kv.

Wrapper type for 64-bit unsigned integers for use as values in a Deno.Kv.

A check to perform as part of a Deno.AtomicOperation. The check will fail if the versionstamp for the key-value pair in the KV store does not match the given versionstamp. A check with a null versionstamp checks that the key-value pair does not currently exist in the KV store.

Options for listing key-value pairs in a Deno.Kv.

Consistency level of a KV operation.

A versioned pair of key and value in a Deno.Kv.

An optional versioned pair of key and value in a Deno.Kv.

A key to be persisted in a Deno.Kv. A key is a sequence of Deno.KvKeyParts.

A single part of a Deno.KvKey. Parts are ordered lexicographically, first by their type, and within a given type by their value.

A selector that selects the range of data returned by a list operation on a Deno.Kv.

A mutation to a key in a Deno.Kv. A mutation is a combination of a key, a value, and a type. The type determines how the mutation is applied to the key.

Open a new Deno.Kv connection to persist data.

Network

If Deno.resolveDns is called with "CAA" record type specified, it will resolve with an array of objects with this interface.

A generic transport listener for message-oriented protocols.

A generic network listener for stream-oriented protocols.

Represents membership of a IPv4 multicast group.

Represents membership of a IPv6 multicast group.

If Deno.resolveDns is called with "MX" record type specified, it will return an array of objects with this interface.

If Deno.resolveDns is called with "NAPTR" record type specified, it will return an array of objects with this interface.

The information for a network interface returned from a call to Deno.networkInterfaces.

Options which can be set when using Deno.resolveDns.

If Deno.resolveDns is called with "SOA" record type specified, it will return an array of objects with this interface.

If Deno.resolveDns is called with "SRV" record type specified, it will return an array of objects with this interface.

Unstable options which can be set when opening a datagram listener via Deno.listenDatagram.

Options which can be set when opening a Unix listener via Deno.listen or Deno.listenDatagram.

The type of the resource record to resolve via DNS using Deno.resolveDns.

Specialized listener that accepts TLS connections.

Connects to the hostname (default is "127.0.0.1") and port on the named transport (default is "tcp"), and resolves to the connection (Conn).

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)

Listen announces on the local transport address.

Listen announces on the local transport address.

Listen announces on the local transport address over TLS (transport layer security).

Returns an array of the network interface information.

Performs DNS resolution against the given query, returning resolved records.

f
Deno.shutdown
deprecated

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.

Observability

I
Deno.Metrics
deprecated
I
Deno.OpMetrics
deprecated
I
Deno.ResourceMap
deprecated

A map of open resources that Deno is tracking. The key is the resource ID (rid) and the value is its representation.

Returns an array containing the 1, 5, and 15 minute load averages. The load average is a measure of CPU and IO utilization of the last one, five, and 15 minute periods expressed as a fractional number. Zero means there is no load. On Windows, the three values are always the same and represent the current load, not the 1, 5 and 15 minute load averages.

f
Deno.metrics
deprecated

Receive metrics from the privileged side of Deno. This is primarily used in the development of Deno. Ops, also called bindings, are the go-between between Deno JavaScript sandbox and the rest of Deno.

f
Deno.resources
deprecated

Returns a map of open resource IDs (rid) along with their string representations. This is an internal API and as such resource representation has unknown type; that means it can change any time and should not be depended upon.

Performance

Deno supports User Timing Level 3 which is not widely supported yet in other runtimes.

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 .mark() method) at an explicit point in an application.

PerformanceMark is an abstract interface for PerformanceEntry objects with an entryType of "mark". Entries of this type are created by calling performance.mark() to add a named DOMHighResTimeStamp (the mark) to the performance timeline.

Options which are used in conjunction with performance.mark. Check out the MDN performance.mark() documentation for more details.

PerformanceMeasure is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the performance timeline.

Options which are used in conjunction with performance.measure. Check out the MDN performance.mark() documentation for more details.

Permissions

Deno's permission management API.

An EventTarget returned from the Deno.permissions API which can provide updates to any state changes of the permission.

The permission descriptor for the allow-env and deny-env permissions, which controls access to being able to read and write to the process environment variables as well as access other information about the environment. The option variable allows scoping the permission to a specific environment variable.

The permission descriptor for the allow-ffi and deny-ffi permissions, which controls access to loading foreign code and interfacing with it via the Foreign Function Interface API available in Deno. The option path allows scoping the permission to a specific path on the host.

The permission descriptor for the allow-hrtime and deny-hrtime permissions, which controls if the runtime code has access to high resolution time. High resolution time is considered sensitive information, because it can be used by malicious code to gain information about the host that it might not otherwise have access to.

The permission descriptor for the allow-net and deny-net permissions, which controls access to opening network ports and connecting to remote hosts via the network. The option host allows scoping the permission for outbound connection to a specific host and port.

A set of options which can define the permissions within a test or worker context at a highly specific level.

The interface which defines what event types are supported by PermissionStatus instances.

The permission descriptor for the allow-read and deny-read permissions, which controls access to reading resources from the local host. The option path allows scoping the permission to a specific path (and if the path is a directory any sub paths).

The permission descriptor for the allow-run and deny-run permissions, which controls access to what sub-processes can be executed by Deno. The option command allows scoping the permission to a specific executable.

The permission descriptor for the allow-sys and deny-sys permissions, which controls access to sensitive host system information, which malicious code might attempt to exploit. The option kind allows scoping the permission to a specific piece of information.

The permission descriptor for the allow-write and deny-write permissions, which controls access to writing to resources from the local host. The option path allow scoping the permission to a specific path (and if the path is a directory any sub paths).

Permission descriptors which define a permission and can be queried, requested, or revoked.

The name of a privileged feature which needs permission.

Options which define the permissions within a test or worker context.

The current status of the permission:

Deno's permission management API.

Runtime Environment

An interface containing methods to interact with the process environment variables.

Information returned from a call to Deno.systemMemoryInfo.

Operating signals which can be listened for or sent to sub-processes. What signals and what their standard behaviors are OS dependent.

Returns the script arguments to the program.

Information related to the build of the current Deno runtime.

An interface containing methods to interact with the process environment variables.

The URL of the entrypoint module entered from the command-line. It requires read permission to the CWD.

Reflects the NO_COLOR environment variable at program start.

The current process ID of this instance of the Deno CLI.

The process ID of parent process of this instance of the Deno CLI.

Version information related to the current Deno CLI runtime environment.

Registers the given function as a listener of the given signal event.

Change the current working directory to the specified path.

Return a string representing the current working directory.

Returns the path to the current deno executable.

Exit the Deno process with optional exit code.

Returns the group id of the process on POSIX platforms. Returns null on windows.

Get the hostname of the machine the Deno process is running on.

Returns an object describing the memory usage of the Deno process and the V8 subsystem measured in bytes.

Returns the release version of the Operating System.

Returns the Operating System uptime in number of seconds.

Removes the given signal listener that has been registered with Deno.addSignalListener.

Displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel.

Returns the user id of the process on POSIX platforms. Returns null on Windows.

Scheduling

A microtask is a short function which is executed after the function or module which created it exits and only if the JavaScript execution stack is empty, but before returning control to the event loop being used to drive the script's execution environment. This event loop may be either the main event loop or the event loop driving a web worker.

Streams API

This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams.

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

Sub Process

The interface for handling a child process returned from Deno.Command.spawn.

Create a child process.

c
Deno.Process
deprecated

Represents an instance of a sub process that is returned from Deno.run which can be used to manage the sub-process.

Options which can be set when calling Deno.Command.

The interface returned from calling Deno.Command.output or Deno.Command.outputSync which represents the result of spawning the child process.

I
Deno.RunOptions
deprecated

Options which can be used with Deno.run.

These are unstable options which can be used with Deno.run.

The status resolved from the .status() method of a Deno.Process instance.

Send a signal to process under given pid. The value and meaning of the signal to the process is operating system and process dependant. Signal provides the most common signals. Default signal is "SIGTERM".

f
Deno.run
deprecated

Spawns new subprocess. RunOptions must contain at a minimum the opt.cmd, an array of program arguments, the first of which is the binary.

Temporal

A Temporal.Calendar is a representation of a calendar system. It includes information about how many days are in each year, how many months are in each year, how many days are in each month, and how to do arithmetic in that calendar system.

A Temporal.Duration represents an immutable duration of time which can be used in date/time arithmetic.

A Temporal.Instant is an exact point in time, with a precision in nanoseconds. No time zone or calendar information is present. Therefore, Temporal.Instant has no concept of days, months, or even hours.

A Temporal.PlainDate represents a calendar date. "Calendar date" refers to the concept of a date as expressed in everyday usage, independent of any time zone. For example, it could be used to represent an event on a calendar which happens during the whole day no matter which time zone it's happening in.

A Temporal.PlainDateTime represents a calendar date and wall-clock time, with a precision in nanoseconds, and without any time zone. Of the Temporal classes carrying human-readable time information, it is the most general and complete one. Temporal.PlainDate, Temporal.PlainTime, Temporal.PlainYearMonth, and Temporal.PlainMonthDay all carry less information and should be used when complete information is not required.

A Temporal.PlainMonthDay represents a particular day on the calendar, but without a year. For example, it could be used to represent a yearly recurring event, like "Bastille Day is on the 14th of July."

A Temporal.PlainTime represents a wall-clock time, with a precision in nanoseconds, and without any time zone. "Wall-clock time" refers to the concept of a time as expressed in everyday usage — the time that you read off the clock on the wall. For example, it could be used to represent an event that happens daily at a certain time, no matter what time zone.

A Temporal.PlainYearMonth represents a particular month on the calendar. For example, it could be used to represent a particular instance of a monthly recurring event, like "the June 2019 meeting".

A Temporal.TimeZone is a representation of a time zone: either an IANA time zone, including information about the time zone such as the offset between the local time and UTC at a particular time, and daylight saving time (DST) changes; or simply a particular UTC offset with no DST.

Options to control the result of until() and since() methods in Temporal types.

Options to control behavior of Duration.compare(), Duration.add(), and Duration.subtract()

A plain object implementing the protocol for a custom time zone.

Options for arithmetic operations like add() and subtract()

Options for assigning fields using with() or entire objects with from().

Any of these types can be passed to Temporal methods instead of a Temporal.Calendar.

Options for assigning fields using Duration.prototype.with() or entire objects with Duration.from(), and for arithmetic with Duration.prototype.add() and Duration.prototype.subtract().

The round method of the Temporal.Duration accepts one required parameter. If a string is provided, the resulting Temporal.Duration object will be rounded to that unit. If an object is provided, the smallestUnit and/or largestUnit property is required, while other properties are optional. A string parameter is treated the same as an object whose smallestUnit property value is that string.

Options to control behavior of Duration.prototype.total()

When the name of a unit is provided to a Temporal API as a string, it is usually singular, e.g. 'day' or 'hour'. But plural unit names like 'days' or 'hours' are aso accepted too.

round methods take one required parameter. If a string is provided, the resulting Temporal.Duration object will be rounded to that unit. If an object is provided, its smallestUnit property is required while other properties are optional. A string is treated the same as an object whose smallestUnit property value is that string.

Any of these types can be passed to Temporal methods instead of a Temporal.TimeZone.

Options for conversions of Temporal.PlainDateTime to Temporal.Instant

Options for outputting precision in toString() on types with seconds

The Temporal.Now object has several methods which give information about the current date, time, and time zone.

Testing

Context that is passed to a benchmarked function. The instance is shared between iterations of the benchmark. Its methods can be used for example to override of the measured portion of the function.

The interface for defining a benchmark test using Deno.bench.

Context that is passed to a testing function, which can be used to either gain information about the current test, or register additional test steps within the current test.

Register a test which will be run when deno test is used on the command line and the containing module looks like a test module.

Register a benchmark test which will be run when deno bench is used on the command line and the containing module looks like a bench module.

Timers

Cancels a timed, repeating action which was previously started by a call to setInterval()

Cancels a scheduled action initiated by setTimeout()

Make the timer of the given id block the event loop from finishing.

Make the timer of the given id not block the event loop from finishing.

Repeatedly calls a function , with a fixed time delay between each call.

Sets a timer which executes a function once after the delay (in milliseconds) elapses. Returns an id which may be used to cancel the timeout.

Web APIs

A controller object that allows you to abort one or more DOM requests as and when desired.

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.

The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

I
v
URL

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.

URLPatternResult is the object returned from URLPattern.exec.

Shows the given message and waits for the enter key pressed.

Shows the given message and waits for the answer. Returns the user's answer as boolean.

Shows the given message and waits for the user's input. Returns the user's input as string.

Dispatch an uncaught exception. Similar to a synchronous version of:

Web Crypto API

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.

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

Web File API

A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.

Provides information about files and allows JavaScript in a web page to access their content.

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.

Web Sockets

Options which can be set when performing a Deno.upgradeWebSocket upgrade of a Request

The object that is returned from a Deno.upgradeWebSocket request.

Provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.

Upgrade an incoming HTTP request to a WebSocket.

Web Storage API

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.

WebAssembly

The WebAssembly.CompileError object indicates an error during WebAssembly decoding or validation.

A WebAssembly.Global object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. This allows dynamic linking of multiple modules.

A WebAssembly.Instance object is a stateful, executable instance of a WebAssembly.Module. Instance objects contain all the Exported WebAssembly functions that allow calling into WebAssembly code from JavaScript.

The WebAssembly.LinkError object indicates an error during module instantiation (besides traps from the start function).

The WebAssembly.Memory object is a resizable ArrayBuffer or SharedArrayBuffer that holds the raw bytes of memory accessed by a WebAssembly Instance.

A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser — this can be efficiently shared with Workers, and instantiated multiple times.

The WebAssembly.RuntimeError object is the error type that is thrown whenever WebAssembly specifies a trap.

The WebAssembly.Table() object is a JavaScript wrapper object — an array-like structure representing a WebAssembly Table, which stores function references. A table created by JavaScript or in WebAssembly code will be accessible and mutable from both JavaScript and WebAssembly.

The GlobalDescriptor describes the options you can pass to new WebAssembly.Global().

The MemoryDescriptor describes the options you can pass to new WebAssembly.Memory().

A ModuleExportDescriptor is the description of a declared export in a WebAssembly.Module.

A ModuleImportDescriptor is the description of a declared import in a WebAssembly.Module.

The TableDescriptor describes the options you can pass to new WebAssembly.Table().

The value returned from WebAssembly.instantiate.

The WebAssembly.compile() function compiles WebAssembly binary code into a WebAssembly.Module object. This function is useful if it is necessary to compile a module before it can be instantiated (otherwise, the WebAssembly.instantiate() function should be used).

The WebAssembly.compileStreaming() function compiles a WebAssembly.Module directly from a streamed underlying source. This function is useful if it is necessary to a compile a module before it can be instantiated (otherwise, the WebAssembly.instantiateStreaming() function should be used).

The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.

The WebAssembly.instantiateStreaming() function compiles and instantiates a WebAssembly module directly from a streamed underlying source. This is the most efficient, optimized way to load wasm code.

The WebAssembly.validate() function validates a given typed array of WebAssembly binary code, returning whether the bytes form a valid wasm module (true) or not (false).

WebGPU

Creates a presentable WebGPU surface from given window and display handles.

Uncategorized

The global namespace where Deno specific, non-standard APIs are located.