Ende namespace

The Ende global holds the APIs that aren’t web standards: files, networking, subprocesses, permissions, testing and more. Deno is an alias of Ende.

Cloud

Desktop

Errors

  • Ende.errors — A set of error constructors that are raised by Ende APIs.

Fetch

  • Ende.BasicAuth — Basic authentication credentials to be used with a Ende.Proxy server when specifying Ende.CreateHttpClientOptions.
  • Ende.createHttpClient — Create a custom HttpClient to use with fetch. This is an extension of the web platform Fetch API which allows Ende to use custom TLS CA certificates and connect via a proxy while using `fetch()`.
  • Ende.CreateHttpClientOptions — The options used when creating a Ende.HttpClient.
  • Ende.HttpClient — A custom `HttpClient` for use with fetch function. This is designed to allow custom certificates or proxies to be used with `fetch()`.
  • Ende.Proxy — The definition for alternative transports (or proxies) in Ende.CreateHttpClientOptions.

FFI

File System

  • Ende.chmod — Changes the permission of a specific file/directory of specified path. Ignores the process's umask.
  • Ende.chmodSync — Synchronously changes the permission of a specific file/directory of specified path. Ignores the process's umask.
  • Ende.chown — Change owner of a regular file or directory.
  • Ende.chownSync — Synchronously change owner of a regular file or directory.
  • Ende.copyFile — 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.
  • Ende.copyFileSync — 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.
  • Ende.create — Creates a file if none exists or truncates an existing file and resolves to an instance of Ende.FsFile.
  • Ende.createSync — Creates a file if none exists or truncates an existing file and returns an instance of Ende.FsFile.
  • Ende.DirEntry — Information about a directory entry returned from Ende.readDir and Ende.readDirSync.
  • Ende.FileInfo — Provides information about a file and is returned by Ende.stat, Ende.lstat, Ende.statSync, and Ende.lstatSync or from calling `stat()` and `statSync()` on an Ende.FsFile instance.
  • Ende.FsEvent — Represents a unique file system event yielded by a Ende.FsWatcher.
  • Ende.FsEventFlag — Additional information for FsEvent objects with the "other" kind.
  • Ende.FsFile — The Ende abstraction for reading and writing files.
  • Ende.FsWatcher — Returned by Ende.watchFs. It is an async iterator yielding up system events. To stop watching the file system by calling `.close()` method.
  • Ende.link — Creates `newpath` as a hard link to `oldpath`.
  • Ende.linkSync — Synchronously creates `newpath` as a hard link to `oldpath`.
  • Ende.lstat — Resolves to a Ende.FileInfo for the specified `path`. If `path` is a symlink, information for the symlink will be returned instead of what it points to.
  • Ende.lstatSync — Synchronously returns a Ende.FileInfo for the specified `path`. If `path` is a symlink, information for the symlink will be returned instead of what it points to.
  • Ende.makeTempDir — 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.
  • Ende.makeTempDirSync — 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.
  • Ende.makeTempFile — Creates a new temporary file in the default directory for temporary files, unless `dir` is specified.
  • Ende.makeTempFileSync — Synchronously creates a new temporary file in the default directory for temporary files, unless `dir` is specified.
  • Ende.MakeTempOptions — Options which can be set when using Ende.makeTempDir, Ende.makeTempDirSync, Ende.makeTempFile, and Ende.makeTempFileSync.
  • Ende.mkdir — Creates a new directory with the specified path.
  • Ende.MkdirOptions — Options which can be set when using Ende.mkdir and Ende.mkdirSync.
  • Ende.mkdirSync — Synchronously creates a new directory with the specified path.
  • Ende.open — Open a file and resolve to an instance of Ende.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.
  • Ende.OpenOptions — Options which can be set when doing Ende.open and Ende.openSync.
  • Ende.openSync — Synchronously open a file and return an instance of Ende.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.
  • Ende.readDir — Reads the directory given by `path` and returns an async iterable of Ende.DirEntry. The order of entries is not guaranteed.
  • Ende.readDirSync — Synchronously reads the directory given by `path` and returns an iterable of Ende.DirEntry. The order of entries is not guaranteed.
  • Ende.readFile — 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. Rejects with an error when reading a directory.
  • Ende.ReadFileOptions — Options which can be set when using Ende.readFile or Ende.readFileSync.
  • Ende.readFileSync — 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. Throws an error when reading a directory.
  • Ende.readLink — Resolves to the full path destination of the named symbolic link.
  • Ende.readLinkSync — Synchronously returns the full path destination of the named symbolic link.
  • Ende.readTextFile — Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string.
  • Ende.readTextFileSync — Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string.
  • Ende.realPath — Resolves to the absolute normalized path, with symbolic links resolved.
  • Ende.realPathSync — Synchronously returns absolute normalized path, with symbolic links resolved.
  • Ende.remove — Removes the named file or directory.
  • Ende.RemoveOptions — Options which can be set when using Ende.remove and Ende.removeSync.
  • Ende.removeSync — Synchronously removes the named file or directory.
  • Ende.rename — 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.
  • Ende.renameSync — 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.
  • Ende.stat — Resolves to a Ende.FileInfo for the specified `path`. Will always follow symlinks.
  • Ende.statSync — Synchronously returns a Ende.FileInfo for the specified `path`. Will always follow symlinks.
  • Ende.symlink — Creates `newpath` as a symbolic link to `oldpath`.
  • Ende.SymlinkOptions — Options that can be used with symlink and symlinkSync.
  • Ende.symlinkSync — Creates `newpath` as a symbolic link to `oldpath`.
  • Ende.truncate — Truncates (or extends) the specified file, to reach the specified `len`. If `len` is not specified then the entire file contents are truncated.
  • Ende.truncateSync — Synchronously truncates (or extends) the specified file, to reach the specified `len`. If `len` is not specified then the entire file contents are truncated.
  • Ende.umask — Retrieve the process umask. If `mask` is provided, sets the process umask. This call always returns what the umask was before the call.
  • Ende.utime — 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.
  • Ende.utimeSync — 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.
  • Ende.watchFs — 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`).
  • Ende.writeFile — Write `data` to the given `path`, by default creating a new file if needed, else overwriting.
  • Ende.WriteFileOptions — Options for writing to a file.
  • Ende.writeFileSync — Synchronously write `data` to the given `path`, by default creating a new file if needed, else overwriting.
  • Ende.writeTextFile — Write string `data` to the given `path`, by default creating a new file if needed, else overwriting.
  • Ende.writeTextFileSync — Synchronously write string `data` to the given `path`, by default creating a new file if needed, else overwriting.

GPU

  • Ende.UnsafeWindowSurface — **UNSTABLE**: New API, yet to be vetted.
  • Ende.webgpu — The webgpu namespace provides additional APIs that the WebGPU specification does not specify.

HTTP Server

I/O

  • Ende.consoleSize — Gets the size of the console as columns/rows.
  • Ende.inspect — Converts the input into a string that has the same format as printed by `console.log()`.
  • Ende.InspectOptions — Option which can be specified when performing Ende.inspect.
  • Ende.SeekMode — A enum which defines the seek mode for IO related APIs that support seeking.
  • Ende.SetRawOptions
  • Ende.stderr — A reference to `stderr` which can be used to write directly to `stderr`. It implements the Ende specific Writer, WriterSync, and Closer interfaces as well as provides a WritableStream interface.
  • Ende.stdin — A reference to `stdin` which can be used to read directly from `stdin`.
  • Ende.stdout — A reference to `stdout` which can be used to write directly to `stdout`. It implements the Ende specific Writer, WriterSync, and Closer interfaces as well as provides a WritableStream interface.

Linter

Network

  • Ende.Addr — The address of a network connection or listener, regardless of transport.
  • Ende.CaaRecord — If Ende.resolveDns is called with `"CAA"` record type specified, it will resolve with an array of objects with this interface.
  • Ende.Conn — A generic stream-oriented network connection that can be read from and written to.
  • Ende.connect — 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`).
  • Ende.ConnectOptions — Options which can be set when connecting via Ende.connect.
  • Ende.connectQuic — **UNSTABLE**: New API, yet to be vetted. Establishes a secure connection over QUIC using a hostname 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.
  • Ende.ConnectQuicOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.connectTls — Establishes a secure connection over TLS (transport layer security) using an optional list of CA certs, hostname (default is "127.0.0.1") and port.
  • Ende.ConnectTlsOptions — Options which can be set when establishing a TLS connection via Ende.connectTls.
  • Ende.DatagramConn — **UNSTABLE**: New API, yet to be vetted.
  • Ende.listen — Listen announces on the local transport address.
  • Ende.listenDatagram — **UNSTABLE**: New API, yet to be vetted.
  • Ende.Listener — A generic network listener for stream-oriented protocols.
  • Ende.ListenOptions — Options which can be set when opening a listener via Ende.listen.
  • Ende.listenTls — Listen announces on the local transport address over TLS (transport layer security).
  • Ende.ListenTlsOptions — Options which can be set when opening a TLS listener via Ende.listenTls.
  • Ende.MulticastV4Membership — **UNSTABLE**: New API, yet to be vetted.
  • Ende.MulticastV6Membership — **UNSTABLE**: New API, yet to be vetted.
  • Ende.MxRecord — If Ende.resolveDns is called with `"MX"` record type specified, it will return an array of objects with this interface.
  • Ende.NaptrRecord — If Ende.resolveDns is called with `"NAPTR"` record type specified, it will return an array of objects with this interface.
  • Ende.NetAddr — The address of a network connection or listener using an IP-based transport.
  • Ende.NetworkInterfaceInfo — The information for a network interface returned from a call to Ende.networkInterfaces.
  • Ende.networkInterfaces — Returns an array of the network interface information.
  • Ende.QuicAcceptOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicBidirectionalStream — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicCloseInfo — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicConn — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicEndpoint — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicEndpointOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicIncoming — **UNSTABLE**: New API, yet to be vetted. An incoming connection for which the server has not yet begun its part of the handshake.
  • Ende.QuicListener — **UNSTABLE**: New API, yet to be vetted. Specialized listener that accepts QUIC connections.
  • Ende.QuicListenOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicReceiveStream — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicSendStream — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicSendStreamOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicServerTransportOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.QuicTransportOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.RecordType — The type of the resource record to resolve via DNS using Ende.resolveDns.
  • Ende.resolveDns — Performs DNS resolution against the given query, returning resolved records.
  • Ende.ResolveDnsOptions — Options which can be set when using Ende.resolveDns.
  • Ende.SoaRecord — If Ende.resolveDns is called with `"SOA"` record type specified, it will return an array of objects with this interface.
  • Ende.SrvRecord — If Ende.resolveDns is called with `"SRV"` record type specified, it will return an array of objects with this interface.
  • Ende.startTls — 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.
  • Ende.StartTlsOptions — Options which can be set when upgrading an existing connection to TLS via Ende.startTls.
  • Ende.TcpConn — A TCP stream connection.
  • Ende.TcpListener — Specialized listener that accepts TCP connections.
  • Ende.TcpListenOptions
  • Ende.TlsCertifiedKeyPem — Provides certified key material from strings. The key material is provided in `PEM`-format (Privacy Enhanced Mail, https://www.rfc-editor.org/rfc/rfc1422) which can be identified by having `-----BEGIN-----` and `-----END-----` markers at the beginning and end of the strings. This type of key is not compatible with `DER`-format keys which are binary.
  • Ende.TlsConn — A TLS-encrypted stream connection over an IP-based transport.
  • Ende.TlsHandshakeInfo — Information about a completed TLS handshake.
  • Ende.TlsListener — Specialized listener that accepts TLS connections.
  • Ende.UdpListenOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.UnixAddr — The address of a network connection or listener using a Unix domain socket.
  • Ende.UnixConn — A Unix domain socket stream connection.
  • Ende.UnixConnectOptions — Options which can be set when connecting to a Unix domain socket via Ende.connect.
  • Ende.UnixListenDatagramOptions — **UNSTABLE**: New API, yet to be vetted.
  • Ende.UnixListener — Specialized listener that accepts Unix connections.
  • Ende.UnixListenOptions — Options which can be set when opening a Unix listener via Ende.listen or Ende.listenDatagram.
  • Ende.upgradeWebTransport — **UNSTABLE**: New API, yet to be vetted.
  • Ende.VsockAddr — The address of a network connection or listener using the VSOCK transport for communication between a virtual machine and its host.
  • Ende.VsockConn — A VSOCK stream connection.
  • Ende.VsockConnectOptions — Options which can be set when connecting over VSOCK via Ende.connect.
  • Ende.VsockListener — Specialized listener that accepts VSOCK connections.
  • Ende.VsockListenOptions — Options which can be set when opening a VSOCK listener via Ende.listen.

Permissions

  • Ende.EnvPermissionDescriptor — 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.
  • Ende.FfiPermissionDescriptor — 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 Ende. The option `path` allows scoping the permission to a specific path on the host.
  • Ende.ImportPermissionDescriptor — The permission descriptor for the `allow-import` and `deny-import` permissions, which controls access to importing from remote hosts via the network. The option `host` allows scoping the permission for outbound connection to a specific host and port.
  • Ende.NetPermissionDescriptor — 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.
  • Ende.PermissionDescriptor — Permission descriptors which define a permission and can be queried, requested, or revoked.
  • Ende.PermissionName — The name of a privileged feature which needs permission.
  • Ende.PermissionOptions — Options which define the permissions within a test or worker context.
  • Ende.PermissionOptionsObject — A set of options which can define the permissions within a test or worker context at a highly specific level.
  • Ende.permissions — Ende's permission management API.
  • Ende.Permissions — Ende's permission management API.
  • Ende.PermissionState — The current status of the permission:
  • Ende.PermissionStatus — An EventTarget returned from the Ende.permissions API which can provide updates to any state changes of the permission.
  • Ende.PermissionStatusEventMap — The interface which defines what event types are supported by PermissionStatus instances.
  • Ende.ReadPermissionDescriptor — 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).
  • Ende.RunPermissionDescriptor — The permission descriptor for the `allow-run` and `deny-run` permissions, which controls access to what sub-processes can be executed by Ende. The option `command` allows scoping the permission to a specific executable.
  • Ende.SysPermissionDescriptor — 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.
  • Ende.WritePermissionDescriptor — 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).

Runtime

  • Ende.addSignalListener — Registers the given function as a listener of the given signal event.
  • Ende.args — Returns the script arguments to the program.
  • Ende.build — Information related to the build of the current Ende runtime.
  • Ende.chdir — Change the current working directory to the specified path.
  • Ende.cwd — Return a string representing the current working directory.
  • Ende.env — An interface containing methods to interact with the process environment variables.
  • Ende.Env — An interface containing methods to interact with the process environment variables.
  • Ende.execPath — Returns the path to the current ende executable.
  • Ende.exit — Exit the Ende process with optional exit code.
  • Ende.exitCode — The exit code for the Ende process.
  • Ende.gid — Returns the group id of the process on POSIX platforms. Returns null on windows.
  • Ende.hostname — Get the `hostname` of the machine the Ende process is running on.
  • Ende.loadavg — 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.
  • Ende.mainModule — The URL of the entrypoint module entered from the command-line. It requires read permission to the CWD.
  • Ende.memoryUsage — Returns an object describing the memory usage of the Ende process and the V8 subsystem measured in bytes.
  • Ende.MemoryUsage
  • Ende.noColor — Reflects the `NO_COLOR` environment variable at program start.
  • Ende.osRelease — Returns the release version of the Operating System.
  • Ende.osUptime — Returns the Operating System uptime in number of seconds.
  • Ende.pid — The current process ID of this instance of the Ende CLI.
  • Ende.ppid — The process ID of parent process of this instance of the Ende CLI.
  • Ende.refTimer — Make the timer of the given `id` block the event loop from finishing.
  • Ende.removeSignalListener — Removes the given signal listener that has been registered with Ende.addSignalListener.
  • Ende.Signal — Operating signals which can be listened for or sent to sub-processes. What signals and what their standard behaviors are OS dependent.
  • Ende.systemMemoryInfo — 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.
  • Ende.SystemMemoryInfo — Information returned from a call to Ende.systemMemoryInfo.
  • Ende.uid — Returns the user id of the process on POSIX platforms. Returns null on Windows.
  • Ende.unrefTimer — Make the timer of the given `id` not block the event loop from finishing.
  • Ende.version — Version information related to the current Ende CLI runtime environment.

Subprocess

  • Ende.ChildProcess — The interface for handling a child process returned from Ende.Command.spawn.
  • Ende.Command — Create a child process.
  • Ende.CommandOptions — Options which can be set when calling Ende.Command.
  • Ende.CommandOutput — The interface returned from calling Ende.Command.output or Ende.Command.outputSync which represents the result of spawning the child process.
  • Ende.CommandStatus
  • Ende.kill — 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"`.
  • Ende.spawn — Spawns a new subprocess, returning a Ende.ChildProcess handle.
  • Ende.spawnAndWait — Spawns a subprocess, waits for it to finish, and returns the output.
  • Ende.spawnAndWaitSync — Synchronously spawns a subprocess, waits for it to finish, and returns the output.
  • Ende.SubprocessReadableStream — The interface for stdout and stderr streams for child process returned from Ende.Command.spawn.

Telemetry

  • Ende.telemetry — APIs for working with the OpenTelemetry observability framework. Ende can export traces, metrics, and logs to OpenTelemetry compatible backends via the OTLP protocol.

Testing

  • Ende.bench — Register a benchmark test which will be run when `ende bench` is used on the command line and the containing module looks like a bench module.
  • Ende.BenchContext — 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.
  • Ende.BenchDefinition — The interface for defining a benchmark test using Ende.bench.
  • Ende.DenoTest
  • Ende.EndeTest
  • Ende.test — Register a test which will be run when `ende test` is used on the command line and the containing module looks like a test module.
  • Ende.TestContext — 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.
  • Ende.TestDefinition
  • Ende.TestEach — Register a parameterized group of tests. See EndeTest.each.
  • Ende.TestIgnore — Shorthand property for ignoring a particular test case. See EndeTest.ignore.
  • Ende.TestOnly — Shorthand property for focusing a particular test case. See EndeTest.only.
  • Ende.TestSnapshotOptions — Options which can be set when calling Ende.TestContext.assertSnapshot.
  • Ende.TestStepDefinition

WebSockets