object promises
- Source
- promises.scala
- Alphabetic
- By Inheritance
- promises
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val ^: Any
- Annotations
- @JSImport("fs", "promises") @native()
- def access(path: PathLike, mode: Double): Promise[Unit]
- Annotations
- @inline()
- def access(path: PathLike): Promise[Unit]
Asynchronously tests a user's permissions for the file specified by path.
Asynchronously tests a user's permissions for the file specified by path.
- path
A path to a file or directory. If a URL is provided, it must use the
file:protocol. URL support is _experimental_.
- Annotations
- @inline()
- def appendFile(path: FileHandle, data: Uint8Array, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: FileHandle, data: Uint8Array, options: BaseEncodingOptionsmodeMoEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: FileHandle, data: Uint8Array): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: FileHandle, data: scala.Predef.String, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: FileHandle, data: scala.Predef.String, options: BaseEncodingOptionsmodeMoEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: FileHandle, data: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: PathLike, data: Uint8Array, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: PathLike, data: Uint8Array, options: BaseEncodingOptionsmodeMoEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: PathLike, data: Uint8Array): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: PathLike, data: scala.Predef.String, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: PathLike, data: scala.Predef.String, options: BaseEncodingOptionsmodeMoEncoding): Promise[Unit]
- Annotations
- @inline()
- def appendFile(path: PathLike, data: scala.Predef.String): Promise[Unit]
Asynchronously append data to a file, creating the file if it does not exist.
Asynchronously append data to a file, creating the file if it does not exist.
- data
The data to write. If something other than a
BufferorUint8Arrayis provided, the value is coerced to a string.
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def chmod(path: PathLike, mode: Mode): Promise[Unit]
Asynchronous chmod(2) - Change permissions of a file.
Asynchronous chmod(2) - Change permissions of a file.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- mode
A file mode. If a string is passed, it is parsed as an octal integer.
- Annotations
- @inline()
- def chown(path: PathLike, uid: Double, gid: Double): Promise[Unit]
Asynchronous chown(2) - Change ownership of a file.
Asynchronous chown(2) - Change ownership of a file.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def copyFile(src: PathLike, dest: PathLike, flags: Double): Promise[Unit]
- Annotations
- @inline()
- def copyFile(src: PathLike, dest: PathLike): Promise[Unit]
Asynchronously copies
srctodest.Asynchronously copies
srctodest. By default,destis overwritten if it already exists. Node.js makes no guarantees about the atomicity of the copy operation. If an error occurs after the destination file has been opened for writing, Node.js will attempt to remove the destination.- src
A path to the source file.
- dest
A path to the destination file.
- Annotations
- @inline()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fchmod(handle: FileHandle, mode: Mode): Promise[Unit]
Asynchronous fchmod(2) - Change permissions of a file.
Asynchronous fchmod(2) - Change permissions of a file.
- handle
A
FileHandle.- mode
A file mode. If a string is passed, it is parsed as an octal integer.
- Annotations
- @inline()
- def fchown(handle: FileHandle, uid: Double, gid: Double): Promise[Unit]
Asynchronous fchown(2) - Change ownership of a file.
Asynchronous fchown(2) - Change ownership of a file.
- handle
A
FileHandle.
- Annotations
- @inline()
- def fdatasync(handle: FileHandle): Promise[Unit]
Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
- handle
A
FileHandle.
- Annotations
- @inline()
- def fsync(handle: FileHandle): Promise[Unit]
Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
- handle
A
FileHandle.
- Annotations
- @inline()
- def ftruncate(handle: FileHandle, len: Double): Promise[Unit]
- Annotations
- @inline()
- def ftruncate(handle: FileHandle): Promise[Unit]
Asynchronous ftruncate(2) - Truncate a file to a specified length.
Asynchronous ftruncate(2) - Truncate a file to a specified length.
- handle
A
FileHandle.
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: Double, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: Double, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: Double, mtime: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: Date, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: Date, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: Date, mtime: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: scala.Predef.String, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: scala.Predef.String, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def futimes(handle: FileHandle, atime: scala.Predef.String, mtime: scala.Predef.String): Promise[Unit]
Asynchronously change file timestamps of the file referenced by the supplied
FileHandle.Asynchronously change file timestamps of the file referenced by the supplied
FileHandle.- handle
A
FileHandle.- atime
The last access time. If a string is provided, it will be coerced to number.
- mtime
The last modified time. If a string is provided, it will be coerced to number.
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lchmod(path: PathLike, mode: Mode): Promise[Unit]
Asynchronous lchmod(2) - Change permissions of a file.
Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- mode
A file mode. If a string is passed, it is parsed as an octal integer.
- Annotations
- @inline()
- def lchown(path: PathLike, uid: Double, gid: Double): Promise[Unit]
Asynchronous lchown(2) - Change ownership of a file.
Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def link(existingPath: PathLike, newPath: PathLike): Promise[Unit]
Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
- existingPath
A path to a file. If a URL is provided, it must use the
file:protocol.- newPath
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def lstat(path: PathLike, opts: StatOptions): Promise[|[Stats, BigIntStats]]
- Annotations
- @inline()
- def lstat(path: PathLike, opts: StatOptionsbiginttrue): Promise[BigIntStats]
- Annotations
- @inline()
- def lstat(path: PathLike, opts: StatOptionsbigintfalseund): Promise[Stats]
- Annotations
- @inline()
- def lstat(path: PathLike): Promise[Stats]
Asynchronous lstat(2) - Get file status.
Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: Double, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: Double, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: Double, mtime: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: Date, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: Date, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: Date, mtime: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: scala.Predef.String, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: scala.Predef.String, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def lutimes(path: PathLike, atime: scala.Predef.String, mtime: scala.Predef.String): Promise[Unit]
Changes the access and modification times of a file in the same way as
fsPromises.utimes(), with the difference that if the path refers to a symbolic link, then the link is not dereferenced: instead, the timestamps of the symbolic link itself are changed.Changes the access and modification times of a file in the same way as
fsPromises.utimes(), with the difference that if the path refers to a symbolic link, then the link is not dereferenced: instead, the timestamps of the symbolic link itself are changed.- path
A path to a file. If a URL is provided, it must use the
file:protocol.- atime
The last access time. If a string is provided, it will be coerced to number.
- mtime
The last modified time. If a string is provided, it will be coerced to number.
- Annotations
- @inline()
- def mkdir(path: PathLike, options: Mode): Promise[Unit]
- Annotations
- @inline()
- def mkdir(path: PathLike, options: MakeDirectoryOptions): Promise[UndefOr[scala.Predef.String]]
- Annotations
- @inline()
- def mkdir(path: PathLike, options: MakeDirectoryOptionsrecurMode): Promise[Unit]
- Annotations
- @inline()
- def mkdir(path: PathLike, options: MakeDirectoryOptionsrecur): Promise[UndefOr[scala.Predef.String]]
Asynchronous mkdir(2) - create a directory.
Asynchronous mkdir(2) - create a directory.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- options
Either the file mode, or an object optionally specifying the file mode and whether parent folders should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to
0o777.
- Annotations
- @inline()
- def mkdir(path: PathLike): Promise[Unit]
Asynchronous mkdir(2) - create a directory.
Asynchronous mkdir(2) - create a directory.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def mkdtemp(prefix: scala.Predef.String, options: BufferEncodingOption): Promise[Buffer]
Asynchronously creates a unique temporary directory.
Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required
prefixto create a unique temporary directory.- options
The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided,
'utf8'is used.
- Annotations
- @inline()
- def mkdtemp(prefix: scala.Predef.String, options: BaseEncodingOptions): Promise[scala.Predef.String]
- Annotations
- @inline()
- def mkdtemp(prefix: scala.Predef.String, options: BufferEncoding): Promise[scala.Predef.String]
- Annotations
- @inline()
- def mkdtemp(prefix: scala.Predef.String): Promise[scala.Predef.String]
Asynchronously creates a unique temporary directory.
Asynchronously creates a unique temporary directory. Generates six random characters to be appended behind a required
prefixto create a unique temporary directory.- Annotations
- @inline()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def open(path: PathLike, flags: Double, mode: Mode): Promise[FileHandle]
- Annotations
- @inline()
- def open(path: PathLike, flags: Double): Promise[FileHandle]
- Annotations
- @inline()
- def open(path: PathLike, flags: scala.Predef.String, mode: Mode): Promise[FileHandle]
- Annotations
- @inline()
- def open(path: PathLike, flags: scala.Predef.String): Promise[FileHandle]
Asynchronous open(2) - open and possibly create a file.
Asynchronous open(2) - open and possibly create a file.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def opendir(path: scala.Predef.String, options: OpenDirOptions): Promise[Dir]
- Annotations
- @inline()
- def opendir(path: scala.Predef.String): Promise[Dir]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Unit, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Null, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Double, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Unit, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Null, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Double, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Unit, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Null, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Double, position: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double): Promise[Buffer[TBuffer]]
- Annotations
- @inline()
- def read[TBuffer](handle: FileHandle, buffer: TBuffer): Promise[Buffer[TBuffer]]
Asynchronously reads data from the file referenced by the supplied
FileHandle.Asynchronously reads data from the file referenced by the supplied
FileHandle.- handle
A
FileHandle.- buffer
The buffer that the data will be written to.
- Annotations
- @inline()
- def readFile(path: FileHandle, options: BufferEncoding): Promise[scala.Predef.String]
- Annotations
- @inline()
- def readFile(path: FileHandle, options: encodingnullundefinedflag): Promise[Buffer]
- Annotations
- @inline()
- def readFile(path: FileHandle, options: encodingBufferEncodingfla): Promise[scala.Predef.String]
- Annotations
- @inline()
- def readFile(path: FileHandle, options: BaseEncodingOptionsAborta): Promise[|[scala.Predef.String, Buffer]]
- Annotations
- @inline()
- def readFile(path: FileHandle): Promise[Buffer]
- Annotations
- @inline()
- def readFile(path: PathLike, options: BufferEncoding): Promise[scala.Predef.String]
- Annotations
- @inline()
- def readFile(path: PathLike, options: encodingnullundefinedflag): Promise[Buffer]
- Annotations
- @inline()
- def readFile(path: PathLike, options: encodingBufferEncodingfla): Promise[scala.Predef.String]
Asynchronously reads the entire contents of a file.
Asynchronously reads the entire contents of a file.
- path
A path to a file. If a URL is provided, it must use the
file:protocol. If aFileHandleis provided, the underlying file will _not_ be closed automatically.- options
An object that may contain an optional flag. If a flag is not provided, it defaults to
'r'.
- Annotations
- @inline()
- def readFile(path: PathLike, options: BaseEncodingOptionsAborta): Promise[|[scala.Predef.String, Buffer]]
- Annotations
- @inline()
- def readFile(path: PathLike): Promise[Buffer]
Asynchronously reads the entire contents of a file.
Asynchronously reads the entire contents of a file.
- path
A path to a file. If a URL is provided, it must use the
file:protocol. If aFileHandleis provided, the underlying file will _not_ be closed automatically.
- Annotations
- @inline()
- def readdir(path: PathLike, options: BufferEncoding): Promise[Array[scala.Predef.String]]
- Annotations
- @inline()
- def readdir(path: PathLike, options: Encoding): Promise[Array[Buffer]]
Asynchronous readdir(3) - read a directory.
Asynchronous readdir(3) - read a directory.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- options
The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided,
'utf8'is used.
- Annotations
- @inline()
- def readdir(path: PathLike, options: BaseEncodingOptionswithFiEncoding): Promise[Array[Dirent]]
Asynchronous readdir(3) - read a directory.
Asynchronous readdir(3) - read a directory.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- options
If called with
withFileTypes: truethe result data will be an array of Dirent.
- Annotations
- @inline()
- def readdir(path: PathLike, options: BaseEncodingOptionswithFi): Promise[Array[scala.Predef.String]]
- Annotations
- @inline()
- def readdir(path: PathLike): Promise[Array[scala.Predef.String]]
Asynchronous readdir(3) - read a directory.
Asynchronous readdir(3) - read a directory.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def readdir_buffer(path: PathLike, options: buffer_): Promise[Array[Buffer]]
- Annotations
- @inline()
- def readlink(path: PathLike, options: scala.Predef.String): Promise[|[scala.Predef.String, Buffer]]
- Annotations
- @inline()
- def readlink(path: PathLike, options: BufferEncodingOption): Promise[Buffer]
Asynchronous readlink(2) - read value of a symbolic link.
Asynchronous readlink(2) - read value of a symbolic link.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- options
The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided,
'utf8'is used.
- Annotations
- @inline()
- def readlink(path: PathLike, options: BaseEncodingOptions): Promise[scala.Predef.String]
- Annotations
- @inline()
- def readlink(path: PathLike, options: BufferEncoding): Promise[scala.Predef.String]
- Annotations
- @inline()
- def readlink(path: PathLike): Promise[scala.Predef.String]
Asynchronous readlink(2) - read value of a symbolic link.
Asynchronous readlink(2) - read value of a symbolic link.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def realpath(path: PathLike, options: BufferEncodingOption): Promise[Buffer]
Asynchronous realpath(3) - return the canonicalized absolute pathname.
Asynchronous realpath(3) - return the canonicalized absolute pathname.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- options
The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided,
'utf8'is used.
- Annotations
- @inline()
- def realpath(path: PathLike, options: BaseEncodingOptions): Promise[scala.Predef.String]
- Annotations
- @inline()
- def realpath(path: PathLike, options: BufferEncoding): Promise[scala.Predef.String]
- Annotations
- @inline()
- def realpath(path: PathLike): Promise[scala.Predef.String]
Asynchronous realpath(3) - return the canonicalized absolute pathname.
Asynchronous realpath(3) - return the canonicalized absolute pathname.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def rename(oldPath: PathLike, newPath: PathLike): Promise[Unit]
Asynchronous rename(2) - Change the name or location of a file or directory.
Asynchronous rename(2) - Change the name or location of a file or directory.
- oldPath
A path to a file. If a URL is provided, it must use the
file:protocol. URL support is _experimental_.- newPath
A path to a file. If a URL is provided, it must use the
file:protocol. URL support is _experimental_.
- Annotations
- @inline()
- def rm(path: PathLike, options: RmOptions): Promise[Unit]
- Annotations
- @inline()
- def rm(path: PathLike): Promise[Unit]
Asynchronously removes files and directories (modeled on the standard POSIX
rmutility).Asynchronously removes files and directories (modeled on the standard POSIX
rmutility).- Annotations
- @inline()
- def rmdir(path: PathLike, options: RmDirOptions): Promise[Unit]
- Annotations
- @inline()
- def rmdir(path: PathLike): Promise[Unit]
Asynchronous rmdir(2) - delete a directory.
Asynchronous rmdir(2) - delete a directory.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def stat(path: PathLike, opts: StatOptions): Promise[|[Stats, BigIntStats]]
- Annotations
- @inline()
- def stat(path: PathLike, opts: StatOptionsbiginttrue): Promise[BigIntStats]
- Annotations
- @inline()
- def stat(path: PathLike, opts: StatOptionsbigintfalseund): Promise[Stats]
- Annotations
- @inline()
- def stat(path: PathLike): Promise[Stats]
Asynchronous stat(2) - Get file status.
Asynchronous stat(2) - Get file status.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def symlink(target: PathLike, path: PathLike, type: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def symlink(target: PathLike, path: PathLike): Promise[Unit]
Asynchronous symlink(2) - Create a new symbolic link to an existing file.
Asynchronous symlink(2) - Create a new symbolic link to an existing file.
- target
A path to an existing file. If a URL is provided, it must use the
file:protocol.- path
A path to the new symlink. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): java.lang.String
- Definition Classes
- AnyRef → Any
- def truncate(path: PathLike, len: Double): Promise[Unit]
- Annotations
- @inline()
- def truncate(path: PathLike): Promise[Unit]
Asynchronous truncate(2) - Truncate a file to a specified length.
Asynchronous truncate(2) - Truncate a file to a specified length.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def unlink(path: PathLike): Promise[Unit]
Asynchronous unlink(2) - delete a name and possibly the file it refers to.
Asynchronous unlink(2) - delete a name and possibly the file it refers to.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def utimes(path: PathLike, atime: Double, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: Double, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: Double, mtime: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: Date, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: Date, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: Date, mtime: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: scala.Predef.String, mtime: Double): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: scala.Predef.String, mtime: Date): Promise[Unit]
- Annotations
- @inline()
- def utimes(path: PathLike, atime: scala.Predef.String, mtime: scala.Predef.String): Promise[Unit]
Asynchronously change file timestamps of the file referenced by the supplied path.
Asynchronously change file timestamps of the file referenced by the supplied path.
- path
A path to a file. If a URL is provided, it must use the
file:protocol.- atime
The last access time. If a string is provided, it will be coerced to number.
- mtime
The last modified time. If a string is provided, it will be coerced to number.
- Annotations
- @inline()
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def watch(filename: PathLike, options: scala.Predef.String): AsyncIterable[|[Buffer, scala.Predef.String]]
- Annotations
- @inline()
- def watch(filename: PathLike, options: WatchOptions): AsyncIterable[scala.Predef.String]
Watch for changes on
filename, wherefilenameis either a file or a directory, returning anFSWatcher.Watch for changes on
filename, wherefilenameis either a file or a directory, returning anFSWatcher.- filename
A path to a file or directory. If a URL is provided, it must use the
file:protocol.- options
Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. If
encodingis not supplied, the default of'utf8'is used. Ifpersistentis not supplied, the default oftrueis used. Ifrecursiveis not supplied, the default offalseis used.
- Annotations
- @inline()
- def watch(filename: PathLike, options: BufferEncoding): AsyncIterable[scala.Predef.String]
- Annotations
- @inline()
- def watch(filename: PathLike, options: WatchOptionsencodingbuffe): AsyncIterable[Buffer]
Watch for changes on
filename, wherefilenameis either a file or a directory, returning anFSWatcher.Watch for changes on
filename, wherefilenameis either a file or a directory, returning anFSWatcher.- filename
A path to a file or directory. If a URL is provided, it must use the
file:protocol.- options
Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. If
encodingis not supplied, the default of'utf8'is used. Ifpersistentis not supplied, the default oftrueis used. Ifrecursiveis not supplied, the default offalseis used.
- Annotations
- @inline()
- def watch(filename: PathLike): AsyncIterable[scala.Predef.String]
Watch for changes on
filename, wherefilenameis either a file or a directory, returning anFSWatcher.Watch for changes on
filename, wherefilenameis either a file or a directory, returning anFSWatcher.- filename
A path to a file or directory. If a URL is provided, it must use the
file:protocol.
- Annotations
- @inline()
- def watch_buffer(filename: PathLike, options: buffer_): AsyncIterable[Buffer]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Unit, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Null, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Double, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Unit, length: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Unit, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Null, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Double, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Null, length: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Unit, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Null, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Double, position: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double, length: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer, offset: Double): Promise[BytesWritten[TBuffer]]
- Annotations
- @inline()
- def write[TBuffer](handle: FileHandle, buffer: TBuffer): Promise[BytesWritten[TBuffer]]
Asynchronously writes
bufferto the file referenced by the suppliedFileHandle.Asynchronously writes
bufferto the file referenced by the suppliedFileHandle. It is unsafe to callfsPromises.write()multiple times on the same file without waiting for thePromiseto be resolved (or rejected). For this scenario,fs.createWriteStreamis strongly recommended.- handle
A
FileHandle.- buffer
The buffer that the data will be written to.
- Annotations
- @inline()
- def write(handle: FileHandle, string: scala.Predef.String, position: Unit, encoding: BufferEncoding): Promise[BufferBytesWritten]
- Annotations
- @inline()
- def write(handle: FileHandle, string: scala.Predef.String, position: Null, encoding: BufferEncoding): Promise[BufferBytesWritten]
- Annotations
- @inline()
- def write(handle: FileHandle, string: scala.Predef.String, position: Double, encoding: BufferEncoding): Promise[BufferBytesWritten]
- Annotations
- @inline()
- def write(handle: FileHandle, string: scala.Predef.String, position: Double): Promise[BufferBytesWritten]
- Annotations
- @inline()
- def write(handle: FileHandle, string: scala.Predef.String): Promise[BufferBytesWritten]
Asynchronously writes
stringto the file referenced by the suppliedFileHandle.Asynchronously writes
stringto the file referenced by the suppliedFileHandle. It is unsafe to callfsPromises.write()multiple times on the same file without waiting for thePromiseto be resolved (or rejected). For this scenario,fs.createWriteStreamis strongly recommended.- handle
A
FileHandle.- string
A string to write.
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: Iterable[|[scala.Predef.String, ArrayBufferView]], options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: Iterable[|[scala.Predef.String, ArrayBufferView]], options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: Iterable[|[ArrayBufferView, scala.Predef.String]]): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: scala.Predef.String, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: scala.Predef.String, options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: scala.Predef.String): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: AsyncIterable[|[scala.Predef.String, ArrayBufferView]], options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: AsyncIterable[|[scala.Predef.String, ArrayBufferView]], options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: AsyncIterable[|[ArrayBufferView, scala.Predef.String]]): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: streamMod.Stream, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: streamMod.Stream, options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: streamMod.Stream): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: ArrayBufferView, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: ArrayBufferView, options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: FileHandle, data: ArrayBufferView): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: Iterable[|[scala.Predef.String, ArrayBufferView]], options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: Iterable[|[scala.Predef.String, ArrayBufferView]], options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: Iterable[|[ArrayBufferView, scala.Predef.String]]): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: scala.Predef.String, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: scala.Predef.String, options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: scala.Predef.String): Promise[Unit]
Asynchronously writes data to a file, replacing the file if it already exists.
Asynchronously writes data to a file, replacing the file if it already exists. It is unsafe to call
fsPromises.writeFile()multiple times on the same file without waiting for thePromiseto be resolved (or rejected).- path
A path to a file. If a URL is provided, it must use the
file:protocol. URL support is _experimental_. If aFileHandleis provided, the underlying file will _not_ be closed automatically.- data
The data to write. If something other than a
BufferorUint8Arrayis provided, the value is coerced to a string.
- Annotations
- @inline()
- def writeFile(path: PathLike, data: AsyncIterable[|[scala.Predef.String, ArrayBufferView]], options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: AsyncIterable[|[scala.Predef.String, ArrayBufferView]], options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: AsyncIterable[|[ArrayBufferView, scala.Predef.String]]): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: streamMod.Stream, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: streamMod.Stream, options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: streamMod.Stream): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: ArrayBufferView, options: BufferEncoding): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: ArrayBufferView, options: BaseEncodingOptionsmodeMo): Promise[Unit]
- Annotations
- @inline()
- def writeFile(path: PathLike, data: ArrayBufferView): Promise[Unit]
- Annotations
- @inline()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated