$ModuleDeno$Typings extension

on

Properties

args List<String>
Returns the script arguments to the program.
no setter
bench → ({void Function(BenchDefinition b) $1, void Function(FutureOr<void> fn(BenchContext)) $2, void Function(String name, FutureOr<void> fn(BenchContext)) $3, void Function(dynamic options, FutureOr<void> fn(BenchContext)) $4, void Function(dynamic options, FutureOr<void> fn(BenchContext)) $5, void Function(String name, dynamic options, FutureOr<void> fn(BenchContext)) $6})
Overload accessor: $1, $2, $3, $4, $5, $6
no setter
build → dynamic
Information related to the build of the current Deno runtime.
no setter
customInspect Symbol
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.
no setter
env Env
An interface containing methods to interact with the process environment variables.
no setter
errors $ModuleErrors
no setter
file → dynamic
The Deno abstraction for reading and writing files.
no setter
mainModule String
The URL of the entrypoint module entered from the command-line. It requires read permission to the CWD.
no setter
noColor bool
Reflects the NO_COLOR environment variable at program start.
no setter
permissions Permissions
Deno's permission management API.
no setter
pid num
The current process ID of this instance of the Deno CLI.
no setter
ppid num
The process ID of parent process of this instance of the Deno CLI.
no setter
resolveDns → ({Future<List<String>> Function(String query, ResolveDns recordType, [ResolveDnsOptions? options]) $1, Future<List<CAARecord>> Function(String query, String recordType, [ResolveDnsOptions? options]) $2, Future<List<MXRecord>> Function(String query, String recordType, [ResolveDnsOptions? options]) $3, Future<List<NAPTRRecord>> Function(String query, String recordType, [ResolveDnsOptions? options]) $4, Future<List<SOARecord>> Function(String query, String recordType, [ResolveDnsOptions? options]) $5, Future<List<SRVRecord>> Function(String query, String recordType, [ResolveDnsOptions? options]) $6, Future<List<List<String>>> Function(String query, String recordType, [ResolveDnsOptions? options]) $7, Future<Object> Function(String query, RecordType recordType, [ResolveDnsOptions? options]) $8})
Overload accessor: $1, $2, $3, $4, $5, $6, $7, $8
no setter
serve → ({Server Function(ServeHandler handler) $1, Server Function(Object options) $2, Server Function(Object options, ServeHandler handler) $3})
Overload accessor: $1, $2, $3
no setter
stderr → _Intersection51
A reference to stderr which can be used to write directly to stderr. It implements the Deno specific {@linkcode Writer}, {@linkcode WriterSync}, and {@linkcode Closer} interfaces as well as provides a {@linkcode WritableStream} interface.
no setter
stdin → _Intersection49
A reference to stdin which can be used to read directly from stdin. It implements the Deno specific {@linkcode Reader}, {@linkcode ReaderSync}, and {@linkcode Closer} interfaces as well as provides a {@linkcode ReadableStream} interface.
no setter
stdout → _Intersection50
A reference to stdout which can be used to write directly to stdout. It implements the Deno specific {@linkcode Writer}, {@linkcode WriterSync}, and {@linkcode Closer} interfaces as well as provides a {@linkcode WritableStream} interface.
no setter
test DenoTest
no setter
version → dynamic
Version information related to the current Deno CLI runtime environment.
no setter

Methods

addSignalListener(Signal signal, void handler()) → void
Registers the given function as a listener of the given signal event.
chdir(Object directory) → void
Change the current working directory to the specified path.
chmod(Object path, num mode) Future<void>
Changes the permission of a specific file/directory of specified path. Ignores the process's umask.
chmodSync(Object path, num mode) → void
Synchronously changes the permission of a specific file/directory of specified path. Ignores the process's umask.
chown(Object path, [num? uid, num? gid]) Future<void>
Change owner of a regular file or directory.
chownSync(Object path, [num? uid, num? gid]) → void
Synchronously change owner of a regular file or directory.
close(num rid) → void
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.
connect(ConnectOptions options) Future<TcpConn>
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).
connectTls(ConnectTlsOptions options) Future<TlsConn>
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)
consoleSize() IInline4
Gets the size of the console as columns/rows.
copy(Reader src, Writer dst, [IInline1? options]) Future<num>
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.
copyFile(Object fromPath, Object toPath) Future<void>
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.
copyFileSync(Object fromPath, Object toPath) → void
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.
create(Object path) Future<FsFile>
Creates a file if none exists or truncates an existing file and resolves to an instance of {@linkcode Deno.FsFile}.
createSync(Object path) FsFile
Creates a file if none exists or truncates an existing file and returns an instance of {@linkcode Deno.FsFile}.
cwd() String
Return a string representing the current working directory.
execPath() String
Returns the path to the current deno executable.
exit([num? code]) → Never
Exit the Deno process with optional exit code.
fdatasync(num rid) Future<void>
Flushes any pending data operations of the given file stream to disk.
fdatasyncSync(num rid) → void
Synchronously flushes any pending data operations of the given file stream to disk.
fstat(num rid) Future<FileInfo>
Returns a Deno.FileInfo for the given file stream.
fstatSync(num rid) FileInfo
Synchronously returns a {@linkcode Deno.FileInfo} for the given file stream.
fsync(num rid) Future<void>
Flushes any pending data and metadata operations of the given file stream to disk.
fsyncSync(num rid) → void
Synchronously flushes any pending data and metadata operations of the given file stream to disk.
ftruncate(num rid, [num? len]) Future<void>
Truncates or extends the specified file stream, to reach the specified len.
ftruncateSync(num rid, [num? len]) → void
Synchronously truncates or extends the specified file stream, to reach the specified len.
futime(num rid, Object atime, Object mtime) Future<void>
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.
futimeSync(num rid, Object atime, Object mtime) → void
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.
gid() num?
Returns the group id of the process on POSIX platforms. Returns null on windows.
hostname() String
Get the hostname of the machine the Deno process is running on.
inspect([Object? value, InspectOptions? options]) String
Converts the input into a string that has the same format as printed by console.log().
isatty(num rid) bool
Check if a given resource id (rid) is a TTY (a terminal).
iter(Reader r, [IInline2? options]) AsyncIterableIterator<Uint8List>
Turns a Reader, r, into an async iterator.
iterSync(ReaderSync r, [IInline3? options]) IterableIterator<Uint8List>
Turns a ReaderSync, r, into an iterator.
kill(num pid, [Signal? signo]) → void
Send a signal to process under given pid. The value and meaning of the signal to the process is operating system and process dependant. {@linkcode Signal} provides the most common signals. Default signal is "SIGTERM".
Creates newpath as a hard link to oldpath.
linkSync(String oldpath, String newpath) → void
Synchronously creates newpath as a hard link to oldpath.
listen(Object options) Listener<Conn>
Listen announces on the local transport address.
listenTls(ListenTlsOptions options) TlsListener
Listen announces on the local transport address over TLS (transport layer security).
loadavg() List<num>
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.
lstat(Object path) Future<FileInfo>
Resolves to a {@linkcode Deno.FileInfo} for the specified path. If path is a symlink, information for the symlink will be returned instead of what it points to.
lstatSync(Object path) FileInfo
Synchronously returns a {@linkcode Deno.FileInfo} for the specified path. If path is a symlink, information for the symlink will be returned instead of what it points to.
makeTempDir([MakeTempOptions? options]) Future<String>
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.
makeTempDirSync([MakeTempOptions? options]) String
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.
makeTempFile([MakeTempOptions? options]) Future<String>
Creates a new temporary file in the default directory for temporary files, unless dir is specified.
makeTempFileSync([MakeTempOptions? options]) String
Synchronously creates a new temporary file in the default directory for temporary files, unless dir is specified.
memoryUsage() MemoryUsage
Returns an object describing the memory usage of the Deno process and the V8 subsystem measured in bytes.
metrics() Metrics
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.
mkdir(Object path, [MkdirOptions? options]) Future<void>
Creates a new directory with the specified path.
mkdirSync(Object path, [MkdirOptions? options]) → void
Synchronously creates a new directory with the specified path.
networkInterfaces() List<NetworkInterfaceInfo>
Returns an array of the network interface information.
open(Object path, [OpenOptions? options]) Future<FsFile>
Open a file and resolve to an instance of {@linkcode Deno.FsFile}. The file does not need to previously exist if using the create or createNew open options. It is the caller's responsibility to close the file when finished with it.
openSync(Object path, [OpenOptions? options]) FsFile
Synchronously open a file and return an instance of {@linkcode Deno.FsFile}. The file does not need to previously exist if using the create or createNew open options. It is the caller's responsibility to close the file when finished with it.
osRelease() String
Returns the release version of the Operating System.
osUptime() num
Returns the Operating System uptime in number of seconds.
read(num rid, Uint8List buffer) Future<num?>
Read from a resource ID (rid) into an array buffer (buffer).
readAll(Reader r) Future<Uint8List>
Read Reader r until EOF (null) and resolve to the content as Uint8Array`.
readAllSync(ReaderSync r) Uint8List
Synchronously reads Reader r until EOF (null) and returns the content as Uint8Array.
readDir(Object path) AsyncIterable<DirEntry>
Reads the directory given by path and returns an async iterable of {@linkcode Deno.DirEntry}.
readDirSync(Object path) Iterable<DirEntry>
Synchronously reads the directory given by path and returns an iterable of Deno.DirEntry.
readFile(Object path, [ReadFileOptions? options]) Future<Uint8List>
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.
readFileSync(Object path) Uint8List
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.
readLinkSync(Object path) String
Synchronously returns the full path destination of the named symbolic link.
readSync(num rid, Uint8List buffer) num?
Synchronously read from a resource ID (rid) into an array buffer (buffer).
readTextFile(Object path, [ReadFileOptions? options]) Future<String>
Asynchronously reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.
readTextFileSync(Object path) String
Synchronously reads and returns the entire contents of a file as an UTF-8 decoded string. Reading a directory throws an error.
realPath(Object path) Future<String>
Resolves to the absolute normalized path, with symbolic links resolved.
realPathSync(Object path) String
Synchronously returns absolute normalized path, with symbolic links resolved.
refTimer(num id) → void
Make the timer of the given id block the event loop from finishing.
remove(Object path, [RemoveOptions? options]) Future<void>
Removes the named file or directory.
removeSignalListener(Signal signal, void handler()) → void
Removes the given signal listener that has been registered with {@linkcode Deno.addSignalListener}.
removeSync(Object path, [RemoveOptions? options]) → void
Synchronously removes the named file or directory.
rename(Object oldpath, Object newpath) Future<void>
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.
renameSync(Object oldpath, Object newpath) → void
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.
resources() Object
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.
run<T extends RunOptions>(T opt) Process<T>
seek(num rid, Object offset, SeekMode whence) Future<num>
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).
seekSync(num rid, Object offset, SeekMode whence) num
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.
serveHttp(Conn conn) HttpConn
Provides an interface to handle HTTP request and responses over TCP or TLS connections. The method returns an {@linkcode HttpConn} which yields up {@linkcode RequestEvent} events, which utilize the web platform standard {@linkcode Request} and {@linkcode Response} objects to handle the request.
shutdown(num rid) Future<void>
Shutdown socket send operations.
startTls(Conn conn, [StartTlsOptions? options]) Future<TlsConn>
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.
stat(Object path) Future<FileInfo>
Resolves to a {@linkcode Deno.FileInfo} for the specified path. Will always follow symlinks.
statSync(Object path) FileInfo
Synchronously returns a {@linkcode Deno.FileInfo} for the specified path. Will always follow symlinks.
Creates newpath as a symbolic link to oldpath.
symlinkSync(Object oldpath, Object newpath, [SymlinkOptions? options]) → void
Creates newpath as a symbolic link to oldpath.
systemMemoryInfo() 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.
truncate(String name, [num? len]) Future<void>
Truncates (or extends) the specified file, to reach the specified len. If len is not specified then the entire file contents are truncated.
truncateSync(String name, [num? len]) → void
Synchronously truncates (or extends) the specified file, to reach the specified len. If len is not specified then the entire file contents are truncated.
uid() num?
Returns the user id of the process on POSIX platforms. Returns null on Windows.
unrefTimer(num id) → void
Make the timer of the given id not block the event loop from finishing.
upgradeWebSocket(Request request, [UpgradeWebSocketOptions? options]) WebSocketUpgrade
Upgrade an incoming HTTP request to a WebSocket.
utime(Object path, Object atime, Object mtime) Future<void>
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.
utimeSync(Object path, Object atime, Object mtime) → void
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.
watchFs(Object paths, [IInline9? options]) FsWatcher
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(num rid, Uint8List data) Future<num>
Write to the resource ID (rid) the contents of the array buffer (data).
writeAll(Writer w, Uint8List arr) Future<void>
Write all the content of the array buffer (arr) to the writer (w).
writeAllSync(WriterSync w, Uint8List arr) → void
Synchronously write all the content of the array buffer (arr) to the writer (w).
writeFile(Object path, Object data, [WriteFileOptions? options]) Future<void>
Write data to the given path, by default creating a new file if needed, else overwriting.
writeFileSync(Object path, Uint8List data, [WriteFileOptions? options]) → void
Synchronously write data to the given path, by default creating a new file if needed, else overwriting.
writeSync(num rid, Uint8List data) num
Synchronously write to the resource ID (rid) the contents of the array buffer (data).
writeTextFile(Object path, Object data, [WriteFileOptions? options]) Future<void>
Write string data to the given path, by default creating a new file if needed, else overwriting.
writeTextFileSync(Object path, String data, [WriteFileOptions? options]) → void
Synchronously write string data to the given path, by default creating a new file if needed, else overwriting.