fs
@listenai/lisa_core / Exports / fs
Namespace: fs
#
Table of contents#
Namespaces#
Classes#
Interfaces- BaseEncodingOptions
- BigIntOptions
- CopyOptions
- CopyOptionsSync
- EnsureOptions
- FSWatcher
- MakeDirectoryOptions
- MoveOptions
- OpenDirOptions
- PathEntry
- PathEntryStream
- ReadOptions
- ReadSyncOptions
- ReadVResult
- RmDirOptions
- RmOptions
- StatOptions
- StatsBase
- WriteFileOptions
- WriteOptions
- WriteVResult
- WritevResult
#
Type aliases- ArrayBufferView
- BufferEncodingOption
- CopyFilterAsync
- CopyFilterSync
- Mode
- NoParamCallback
- OpenMode
- PathLike
- SymlinkType
#
Variables#
Functions- access
- accessSync
- appendFile
- appendFileSync
- chmod
- chmodSync
- chown
- chownSync
- close
- closeSync
- copy
- copyFile
- copyFileSync
- copySync
- createFile
- createFileSync
- createLink
- createLinkSync
- createReadStream
- createSymlink
- createSymlinkSync
- createWriteStream
- emptyDir
- emptyDirSync
- emptydir
- emptydirSync
- ensureDir
- ensureDirSync
- ensureFile
- ensureFileSync
- ensureLink
- ensureLinkSync
- ensureSymlink
- ensureSymlinkSync
- exists
- existsSync
- fchmod
- fchmodSync
- fchown
- fchownSync
- fdatasync
- fdatasyncSync
- fstat
- fstatSync
- fsync
- fsyncSync
- ftruncate
- ftruncateSync
- futimes
- futimesSync
- lchmod
- lchmodSync
- lchown
- lchownSync
- link
- linkSync
- lstat
- lstatSync
- lutimes
- lutimesSync
- mkdir
- mkdirSync
- mkdirp
- mkdirpSync
- mkdirs
- mkdirsSync
- mkdtemp
- mkdtempSync
- move
- moveSync
- open
- openSync
- opendir
- opendirSync
- outputFile
- outputFileSync
- outputJSON
- outputJSONSync
- outputJson
- outputJsonSync
- pathExists
- pathExistsSync
- read
- readFile
- readFileSync
- readJSON
- readJSONSync
- readJson
- readJsonSync
- readSync
- readdir
- readdirSync
- readlink
- readlinkSync
- readv
- readvSync
- realpath
- realpathSync
- reloadProject
- remove
- removeSync
- rename
- renameSync
- rm
- rmSync
- rmdir
- rmdirSync
- stat
- statSync
- symlink
- symlinkSync
- truncate
- truncateSync
- unlink
- unlinkSync
- unwatchFile
- utimes
- utimesSync
- watch
- watchFile
- write
- writeFile
- writeFileSync
- writeJSON
- writeJSONSync
- writeJson
- writeJsonSync
- writeSync
- writev
- writevSync
#
Type aliases#
ArrayBufferViewƬ ArrayBufferView: NodeJS.TypedArray
| DataView
#
Defined innode_modules/@types/fs-extra/index.d.ts:310
#
BufferEncodingOptionƬ BufferEncodingOption: "buffer"
| { encoding
: "buffer"
}
#
Defined innode_modules/@types/node/fs.d.ts:19
#
CopyFilterAsyncƬ CopyFilterAsync: (src
: string
, dest
: string
) => Promise
<boolean
>
#
Type declaration▸ (src
, dest
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
#
ReturnsPromise
<boolean
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:304
#
CopyFilterSyncƬ CopyFilterSync: (src
: string
, dest
: string
) => boolean
#
Type declaration▸ (src
, dest
): boolean
#
ParametersName | Type |
---|---|
src | string |
dest | string |
#
Returnsboolean
#
Defined innode_modules/@types/fs-extra/index.d.ts:303
#
ModeƬ Mode: string
| number
#
Defined innode_modules/@types/fs-extra/index.d.ts:308
#
NoParamCallbackƬ NoParamCallback: (err
: NodeJS.ErrnoException
| null
) => void
#
Type declaration▸ (err
): void
#
ParametersName | Type |
---|---|
err | NodeJS.ErrnoException | null |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:17
#
OpenModeƬ OpenMode: number
| string
#
Defined innode_modules/@types/node/fs.d.ts:25
#
PathLikeƬ PathLike: string
| Buffer
| URL
Valid types for path values in "fs".
#
Defined innode_modules/@types/node/fs.d.ts:15
#
SymlinkTypeƬ SymlinkType: "dir"
| "file"
| "junction"
#
Defined innode_modules/@types/fs-extra/index.d.ts:306
#
Variables#
project• project: Project
项目主路径,默认为命令行运行的当前的目录
#
Defined in#
Functions#
access▸ access(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:126
▸ access(path
, mode
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
mode | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:127
▸ access(path
, mode?
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
mode? | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:128
#
accessSync▸ accessSync(path
, mode?
): void
Synchronously tests a user's permissions for the file specified by path.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
mode? | number | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:2056
#
appendFile▸ appendFile(file
, data
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
data | any |
options | Object |
options.encoding? | string |
options.flag? | string |
options.mode? | number | string |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:130
▸ appendFile(file
, data
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
data | any |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:132
▸ appendFile(file
, data
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | PathLike | number |
data | any |
options? | Object |
options.encoding? | string |
options.flag? | string |
options.mode? | number | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:133
#
appendFileSync▸ appendFileSync(file
, data
, options?
): void
Synchronously append data to a file, creating the file if it does not exist.
#
ParametersName | Type | Description |
---|---|---|
file | PathLike | number | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically. |
data | string | Uint8Array | The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. |
options? | WriteFileOptions | Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. If encoding is not supplied, the default of 'utf8' is used. If mode is not supplied, the default of 0o666 is used. If mode is a string, it is parsed as an octal integer. If flag is not supplied, the default of 'a' is used. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1767
#
chmod▸ chmod(path
, mode
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
mode | Mode |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:135
▸ chmod(path
, mode
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
mode | Mode |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:136
#
chmodSync▸ chmodSync(path
, mode
): void
Synchronous chmod(2) - Change permissions of a file.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
mode | Mode | A file mode. If a string is passed, it is parsed as an octal integer. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:489
#
chown▸ chown(path
, uid
, gid
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
uid | number |
gid | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:138
▸ chown(path
, uid
, gid
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
uid | number |
gid | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:139
#
chownSync▸ chownSync(path
, uid
, gid
): void
Synchronous chown(2) - Change ownership of a file.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
uid | number | - |
gid | number | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:390
#
close▸ close(fd
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:141
▸ close(fd
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:142
#
closeSync▸ closeSync(fd
): void
Synchronous close(2) - close a file descriptor.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1262
#
copy▸ copy(src
, dest
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
options? | CopyOptions |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:23
▸ copy(src
, dest
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:24
▸ copy(src
, dest
, options
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
options | CopyOptions |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:25
#
copyFile▸ copyFile(src
, dest
, flags?
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
flags? | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:28
▸ copyFile(src
, dest
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:29
▸ copyFile(src
, dest
, flags
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
flags | number |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:30
#
copyFileSync▸ copyFileSync(src
, dest
, flags?
): void
Synchronously copies src to dest. By default, dest is 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.
#
ParametersName | Type | Description |
---|---|---|
src | PathLike | A path to the source file. |
dest | PathLike | A path to the destination file. |
flags? | number | An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:2164
#
copySync▸ copySync(src
, dest
, options?
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
options? | CopyOptionsSync |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:26
#
createFile▸ createFile(file
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:37
▸ createFile(file
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:38
#
createFileSync▸ createFileSync(file
): void
#
ParametersName | Type |
---|---|
file | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:39
#
createLink▸ Const
createLink(src
, dest
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:102
▸ Const
createLink(src
, dest
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:102
#
createLinkSync▸ Const
createLinkSync(src
, dest
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:105
#
createReadStream▸ createReadStream(path
, options?
): ReadStream
Returns a new ReadStream
object.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. |
options? | string | { autoClose? : boolean ; emitClose? : boolean ; encoding? : BufferEncoding ; end? : number ; fd? : number ; flags? : string ; highWaterMark? : number ; mode? : number ; start? : number } | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:2063
#
createSymlink▸ createSymlink(src
, dest
, type
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
type | SymlinkType |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:41
▸ createSymlink(src
, dest
, type
, callback?
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
type | SymlinkType |
callback? | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:42
#
createSymlinkSync▸ createSymlinkSync(src
, dest
, type
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
type | SymlinkType |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:43
#
createWriteStream▸ createWriteStream(path
, options?
): WriteStream
Returns a new WriteStream
object.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. |
options? | string | { autoClose? : boolean ; emitClose? : boolean ; encoding? : BufferEncoding ; fd? : number ; flags? : string ; highWaterMark? : number ; mode? : number ; start? : number } | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:2083
#
emptyDir▸ emptyDir(path
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:112
▸ emptyDir(path
, callback
): void
#
ParametersName | Type |
---|---|
path | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:113
#
emptyDirSync▸ emptyDirSync(path
): void
#
ParametersName | Type |
---|---|
path | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:116
#
emptydir▸ Const
emptydir(path
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:114
▸ Const
emptydir(path
, callback
): void
#
ParametersName | Type |
---|---|
path | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:114
#
emptydirSync▸ Const
emptydirSync(path
): void
#
ParametersName | Type |
---|---|
path | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:117
#
ensureDir▸ ensureDir(path
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | string |
options? | EnsureOptions | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:45
▸ ensureDir(path
, callback?
): void
#
ParametersName | Type |
---|---|
path | string |
callback? | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:46
▸ ensureDir(path
, options?
, callback?
): void
#
ParametersName | Type |
---|---|
path | string |
options? | EnsureOptions | number |
callback? | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:47
#
ensureDirSync▸ ensureDirSync(path
, options?
): void
#
ParametersName | Type |
---|---|
path | string |
options? | EnsureOptions | number |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:48
#
ensureFile▸ ensureFile(path
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:95
▸ ensureFile(path
, callback
): void
#
ParametersName | Type |
---|---|
path | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:96
#
ensureFileSync▸ ensureFileSync(path
): void
#
ParametersName | Type |
---|---|
path | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:97
#
ensureLink▸ ensureLink(src
, dest
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:99
▸ ensureLink(src
, dest
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:100
#
ensureLinkSync▸ ensureLinkSync(src
, dest
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:103
#
ensureSymlink▸ ensureSymlink(src
, dest
, type?
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
type? | SymlinkType |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:107
▸ ensureSymlink(src
, dest
, type
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
type | SymlinkType |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:108
▸ ensureSymlink(src
, dest
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:109
#
ensureSymlinkSync▸ ensureSymlinkSync(src
, dest
, type?
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
type? | SymlinkType |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:110
#
exists▸ exists(path
, callback
): void
Asynchronously tests whether or not the given path exists by checking with the file system.
deprecated
since v1.0.0 Use fs.stat()
or fs.access()
instead
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
callback | (exists : boolean ) => void | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1846
#
existsSync▸ existsSync(path
): boolean
Synchronously tests whether or not the given path exists by checking with the file system.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
#
Returnsboolean
#
Defined innode_modules/@types/node/fs.d.ts:1862
#
fchmod▸ fchmod(fd
, mode
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
mode | Mode |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:144
▸ fchmod(fd
, mode
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
mode | Mode |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:145
#
fchmodSync▸ fchmodSync(fd
, mode
): void
Synchronous fchmod(2) - Change permissions of a file.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
mode | Mode | A file mode. If a string is passed, it is parsed as an octal integer. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:513
#
fchown▸ fchown(fd
, uid
, gid
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
uid | number |
gid | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:147
▸ fchown(fd
, uid
, gid
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
uid | number |
gid | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:148
#
fchownSync▸ fchownSync(fd
, uid
, gid
): void
Synchronous fchown(2) - Change ownership of a file.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
uid | number | - |
gid | number | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:411
#
fdatasync▸ fdatasync(fd
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
callback | () => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:150
▸ fdatasync(fd
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:151
#
fdatasyncSync▸ fdatasyncSync(fd
): void
Synchronous fdatasync(2) - synchronize a file's in-core state with storage device.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:2113
#
fstat▸ fstat(fd
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
callback | (err : NodeJS.ErrnoException , stats : Stats ) => any |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:153
▸ fstat(fd
): Promise
<Stats
>
#
ParametersName | Type |
---|---|
fd | number |
#
ReturnsPromise
<Stats
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:154
#
fstatSync▸ fstatSync(fd
, options?
): Stats
Synchronous fstat(2) - Get file status.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
options? | StatOptions & { bigint? : false } | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:591
▸ fstatSync(fd
, options
): BigIntStats
#
ParametersName | Type |
---|---|
fd | number |
options | StatOptions & { bigint : true } |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:592
▸ fstatSync(fd
, options?
): Stats
| BigIntStats
#
ParametersName | Type |
---|---|
fd | number |
options? | StatOptions |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:593
#
fsync▸ fsync(fd
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:156
▸ fsync(fd
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:157
#
fsyncSync▸ fsyncSync(fd
): void
Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1367
#
ftruncate▸ ftruncate(fd
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:159
▸ ftruncate(fd
, len
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
len | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:160
▸ ftruncate(fd
, len?
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
len? | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:161
#
ftruncateSync▸ ftruncateSync(fd
, len?
): void
Synchronous ftruncate(2) - Truncate a file to a specified length.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
len? | number | null | If not specified, defaults to 0 . |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:369
#
futimes▸ futimes(fd
, atime
, mtime
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
atime | number |
mtime | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:163
▸ futimes(fd
, atime
, mtime
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
atime | Date |
mtime | Date |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:164
▸ futimes(fd
, atime
, mtime
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
atime | number |
mtime | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:165
▸ futimes(fd
, atime
, mtime
): Promise
<void
>
#
ParametersName | Type |
---|---|
fd | number |
atime | Date |
mtime | Date |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:166
#
futimesSync▸ futimesSync(fd
, atime
, mtime
): void
Synchronously change file timestamps of the file referenced by the supplied file descriptor.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
atime | string | number | Date | The last access time. If a string is provided, it will be coerced to number. |
mtime | string | number | Date | The last modified time. If a string is provided, it will be coerced to number. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1346
#
lchmod▸ lchmod(path
, mode
, callback
): void
Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
mode | Mode | A file mode. If a string is passed, it is parsed as an octal integer. |
callback | NoParamCallback | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:520
#
lchmodSync▸ lchmodSync(path
, mode
): void
Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
mode | Mode | A file mode. If a string is passed, it is parsed as an octal integer. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:537
#
lchown▸ lchown(path
, uid
, gid
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
uid | number |
gid | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:168
▸ lchown(path
, uid
, gid
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
uid | number |
gid | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:169
#
lchownSync▸ lchownSync(path
, uid
, gid
): void
Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
uid | number | - |
gid | number | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:432
#
link▸ link(existingPath
, newPath
, callback
): void
#
ParametersName | Type |
---|---|
existingPath | PathLike |
newPath | PathLike |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:171
▸ link(existingPath
, newPath
): Promise
<void
>
#
ParametersName | Type |
---|---|
existingPath | PathLike |
newPath | PathLike |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:172
#
linkSync▸ linkSync(existingPath
, newPath
): void
Synchronous link(2) - Create a new link (also known as a hard link) to an existing file.
#
ParametersName | Type | Description |
---|---|---|
existingPath | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
newPath | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:645
#
lstat▸ lstat(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException , stats : Stats ) => any |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:174
▸ lstat(path
): Promise
<Stats
>
#
ParametersName | Type |
---|---|
path | PathLike |
#
ReturnsPromise
<Stats
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:175
#
lstatSync▸ lstatSync(path
, options?
): Stats
Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | StatOptions & { bigint? : false } | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:619
▸ lstatSync(path
, options
): BigIntStats
#
ParametersName | Type |
---|---|
path | PathLike |
options | StatOptions & { bigint : true } |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:620
▸ lstatSync(path
, options?
): Stats
| BigIntStats
#
ParametersName | Type |
---|---|
path | PathLike |
options? | StatOptions |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:621
#
lutimes▸ lutimes(path
, atime
, mtime
, callback
): void
Changes the access and modification times of a file in the same way as fs.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.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
atime | string | number | Date | The last access time. If a string is provided, it will be coerced to number. |
mtime | string | number | Date | The last modified time. If a string is provided, it will be coerced to number. |
callback | NoParamCallback | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:442
#
lutimesSync▸ lutimesSync(path
, atime
, mtime
): void
Change the file system timestamps of the symbolic link referenced by path
. Returns undefined
,
or throws an exception when parameters are incorrect or the operation fails.
This is the synchronous version of fs.lutimes()
.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
atime | string | number | Date | The last access time. If a string is provided, it will be coerced to number. |
mtime | string | number | Date | The last modified time. If a string is provided, it will be coerced to number. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:465
#
mkdir▸ mkdir(path
, callback
): void
Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | - |
callback | (err : NodeJS.ErrnoException ) => void | No arguments other than a possible exception are given to the completion callback. |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:182
▸ mkdir(path
, options
, callback
): void
Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | - |
options | Mode | MakeDirectoryOptions | null | - |
callback | (err : NodeJS.ErrnoException ) => void | No arguments other than a possible exception are given to the completion callback. |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:188
▸ mkdir(path
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
options? | Mode | MakeDirectoryOptions | null |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:189
#
mkdirSync▸ mkdirSync(path
, options?
): void
#
ParametersName | Type |
---|---|
path | PathLike |
options? | Mode | MakeDirectoryOptions | null |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:190
#
mkdirp▸ mkdirp(dir
): Promise
<void
>
#
ParametersName | Type |
---|---|
dir | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:52
▸ mkdirp(dir
, callback
): void
#
ParametersName | Type |
---|---|
dir | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:53
#
mkdirpSync▸ mkdirpSync(dir
): void
#
ParametersName | Type |
---|---|
dir | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:55
#
mkdirs▸ mkdirs(dir
): Promise
<void
>
#
ParametersName | Type |
---|---|
dir | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:50
▸ mkdirs(dir
, callback
): void
#
ParametersName | Type |
---|---|
dir | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:51
#
mkdirsSync▸ mkdirsSync(dir
): void
#
ParametersName | Type |
---|---|
dir | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:54
#
mkdtemp▸ mkdtemp(prefix
): Promise
<string
>
Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
#
ParametersName | Type |
---|---|
prefix | string |
#
ReturnsPromise
<string
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:291
▸ mkdtemp(prefix
, callback
): void
#
ParametersName | Type |
---|---|
prefix | string |
callback | (err : NodeJS.ErrnoException , folder : string ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:292
#
mkdtempSync▸ mkdtempSync(prefix
, options?
): string
Synchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
#
ParametersName | Type | Description |
---|---|---|
prefix | string | - |
options? | BaseEncodingOptions | BufferEncoding | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
#
Defined innode_modules/@types/node/fs.d.ts:1126
▸ mkdtempSync(prefix
, options
): Buffer
Synchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
#
ParametersName | Type | Description |
---|---|---|
prefix | string | - |
options | BufferEncodingOption | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
ReturnsBuffer
#
Defined innode_modules/@types/node/fs.d.ts:1133
▸ mkdtempSync(prefix
, options?
): string
| Buffer
Synchronously creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
#
ParametersName | Type | Description |
---|---|---|
prefix | string | - |
options? | BaseEncodingOptions | string | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
| Buffer
#
Defined innode_modules/@types/node/fs.d.ts:1140
#
move▸ move(src
, dest
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
src | string |
dest | string |
options? | MoveOptions |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:32
▸ move(src
, dest
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:33
▸ move(src
, dest
, options
, callback
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
options | MoveOptions |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:34
#
moveSync▸ moveSync(src
, dest
, options?
): void
#
ParametersName | Type |
---|---|
src | string |
dest | string |
options? | MoveOptions |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:35
#
open▸ open(path
, flags
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
flags | string | number |
callback | (err : NodeJS.ErrnoException , fd : number ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:192
▸ open(path
, flags
, mode
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
flags | string | number |
mode | Mode |
callback | (err : NodeJS.ErrnoException , fd : number ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:193
▸ open(path
, flags
, mode?
): Promise
<number
>
#
ParametersName | Type |
---|---|
path | PathLike |
flags | string | number |
mode? | Mode | null |
#
ReturnsPromise
<number
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:194
#
openSync▸ openSync(path
, flags
, mode?
): number
Synchronous open(2) - open and possibly create a file, returning a file descriptor..
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
flags | OpenMode | - |
mode? | Mode | null | A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to 0o666 . |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:1292
#
opendir▸ opendir(path
, cb
): void
#
ParametersName | Type |
---|---|
path | string |
cb | (err : NodeJS.ErrnoException | null , dir : Dir ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:196
▸ opendir(path
, options
, cb
): void
#
ParametersName | Type |
---|---|
path | string |
options | OpenDirOptions |
cb | (err : NodeJS.ErrnoException | null , dir : Dir ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:197
▸ opendir(path
, options?
): Promise
<Dir
>
#
ParametersName | Type |
---|---|
path | string |
options? | OpenDirOptions |
#
ReturnsPromise
<Dir
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:202
#
opendirSync▸ opendirSync(path
, options?
): Dir
#
ParametersName | Type |
---|---|
path | string |
options? | OpenDirOptions |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:2236
#
outputFile▸ outputFile(file
, data
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | string |
data | any |
options? | WriteFileOptions | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:57
▸ outputFile(file
, data
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:58
▸ outputFile(file
, data
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
options | WriteFileOptions | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:59
#
outputFileSync▸ outputFileSync(file
, data
, options?
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
options? | WriteFileOptions | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:60
#
outputJSON▸ outputJSON(file
, data
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | string |
data | any |
options? | WriteOptions |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:76
▸ outputJSON(file
, data
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
options | WriteOptions |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:77
▸ outputJSON(file
, data
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:78
#
outputJSONSync▸ outputJSONSync(file
, data
, options?
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
options? | WriteOptions |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:83
#
outputJson▸ outputJson(file
, data
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | string |
data | any |
options? | WriteOptions |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:79
▸ outputJson(file
, data
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
options | WriteOptions |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:80
▸ outputJson(file
, data
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:81
#
outputJsonSync▸ outputJsonSync(file
, data
, options?
): void
#
ParametersName | Type |
---|---|
file | string |
data | any |
options? | WriteOptions |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:82
#
pathExists▸ pathExists(path
): Promise
<boolean
>
#
ParametersName | Type |
---|---|
path | string |
#
ReturnsPromise
<boolean
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:119
▸ pathExists(path
, callback
): void
#
ParametersName | Type |
---|---|
path | string |
callback | (err : Error , exists : boolean ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:120
#
pathExistsSync▸ pathExistsSync(path
): boolean
#
ParametersName | Type |
---|---|
path | string |
#
Returnsboolean
#
Defined innode_modules/@types/fs-extra/index.d.ts:121
#
read▸ read<TBuffer
>(fd
, buffer
, offset
, length
, position
, callback
): void
#
Type parametersName | Type |
---|---|
TBuffer | extends ArrayBufferView |
#
ParametersName | Type |
---|---|
fd | number |
buffer | TBuffer |
offset | number |
length | number |
position | number | null |
callback | (err : NodeJS.ErrnoException , bytesRead : number , buffer : TBuffer ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:204
▸ read<TBuffer
>(fd
, buffer
, offset
, length
, position
): Promise
<Object
>
#
Type parametersName | Type |
---|---|
TBuffer | extends ArrayBufferView |
#
ParametersName | Type |
---|---|
fd | number |
buffer | TBuffer |
offset | number |
length | number |
position | number | null |
#
ReturnsPromise
<Object
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:206
#
readFile▸ readFile(file
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
callback | (err : NodeJS.ErrnoException , data : Buffer ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:208
▸ readFile(file
, encoding
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
encoding | string |
callback | (err : NodeJS.ErrnoException , data : string ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:209
▸ readFile(file
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
options | { flag? : string } | { encoding : string ; flag? : string } |
callback | (err : NodeJS.ErrnoException , data : Buffer ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:210
▸ readFile(file
, options
): Promise
<string
>
#
ParametersName | Type |
---|---|
file | PathLike | number |
options | { flag? : string } | { encoding : string ; flag? : string } |
#
ReturnsPromise
<string
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:211
▸ readFile(file
, encoding
): Promise
<string
>
#
ParametersName | Type |
---|---|
file | PathLike | number |
encoding | string |
#
ReturnsPromise
<string
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:213
▸ readFile(file
): Promise
<Buffer
>
#
ParametersName | Type |
---|---|
file | PathLike | number |
#
ReturnsPromise
<Buffer
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:214
#
readFileSync▸ readFileSync(path
, options?
): Buffer
Synchronously reads the entire contents of a file.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | number | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically. |
options? | { encoding? : null ; flag? : string } | null | An object that may contain an optional flag. If a flag is not provided, it defaults to 'r' . |
#
ReturnsBuffer
#
Defined innode_modules/@types/node/fs.d.ts:1637
▸ readFileSync(path
, options
): string
Synchronously reads the entire contents of a file.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | number | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically. |
options | { encoding : BufferEncoding ; flag? : string } | BufferEncoding | Either the encoding for the result, or an object that contains the encoding and an optional flag. If a flag is not provided, it defaults to 'r' . |
#
Returnsstring
#
Defined innode_modules/@types/node/fs.d.ts:1647
▸ readFileSync(path
, options?
): string
| Buffer
Synchronously reads the entire contents of a file.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | number | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically. |
options? | BaseEncodingOptions & { flag? : string } | BufferEncoding | null | Either the encoding for the result, or an object that contains the encoding and an optional flag. If a flag is not provided, it defaults to 'r' . |
#
Returnsstring
| Buffer
#
Defined innode_modules/@types/node/fs.d.ts:1657
#
readJSON▸ readJSON(file
, options?
): Promise
<any
>
#
ParametersName | Type |
---|---|
file | string |
options? | ReadOptions |
#
ReturnsPromise
<any
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:65
▸ readJSON(file
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
callback | (err : Error , jsonObject : any ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:66
▸ readJSON(file
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
options | ReadOptions |
callback | (err : Error , jsonObject : any ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:67
#
readJSONSync▸ readJSONSync(file
, options?
): any
#
ParametersName | Type |
---|---|
file | string |
options? | ReadOptions |
#
Returnsany
#
Defined innode_modules/@types/fs-extra/index.d.ts:70
#
readJson▸ readJson(file
, options?
): Promise
<any
>
#
ParametersName | Type |
---|---|
file | string |
options? | ReadOptions |
#
ReturnsPromise
<any
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:62
▸ readJson(file
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
callback | (err : Error , jsonObject : any ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:63
▸ readJson(file
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
options | ReadOptions |
callback | (err : Error , jsonObject : any ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:64
#
readJsonSync▸ readJsonSync(file
, options?
): any
#
ParametersName | Type |
---|---|
file | string |
options? | ReadOptions |
#
Returnsany
#
Defined innode_modules/@types/fs-extra/index.d.ts:69
#
readSync▸ readSync(fd
, buffer
, offset
, length
, position
): number
Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
buffer | NodeJS.ArrayBufferView | The buffer that the data will be written to. |
offset | number | The offset in the buffer at which to start writing. |
length | number | The number of bytes to read. |
position | number | null | The offset from the beginning of the file from which data should be read. If null , data will be read from the current position. |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:1550
▸ readSync(fd
, buffer
, opts?
): number
Similar to the above fs.readSync
function, this version takes an optional options
object.
If no options
object is specified, it will default with the above values.
#
ParametersName | Type |
---|---|
fd | number |
buffer | NodeJS.ArrayBufferView |
opts? | ReadSyncOptions |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:1556
#
readdir▸ readdir(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException , files : string []) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:216
▸ readdir(path
, options?
): Promise
<string
[]>
#
ParametersName | Type |
---|---|
path | PathLike |
options? | { encoding : BufferEncoding | null ; withFileTypes? : false } | BufferEncoding | null |
#
ReturnsPromise
<string
[]>
#
Defined innode_modules/@types/fs-extra/index.d.ts:217
▸ readdir(path
, options
): Promise
<Buffer
[]>
#
ParametersName | Type |
---|---|
path | PathLike |
options | "buffer" | { encoding : "buffer" ; withFileTypes? : false } |
#
ReturnsPromise
<Buffer
[]>
#
Defined innode_modules/@types/fs-extra/index.d.ts:218
▸ readdir(path
, options?
): Promise
<string
[] | Buffer
[]>
#
ParametersName | Type |
---|---|
path | PathLike |
options? | Object |
options.encoding? | string | null |
options.withFileTypes? | false |
#
ReturnsPromise
<string
[] | Buffer
[]>
#
Defined innode_modules/@types/fs-extra/index.d.ts:219
▸ readdir(path
, options
): Promise
<Dirent
[]>
#
ParametersName | Type |
---|---|
path | PathLike |
options | Object |
options.encoding? | string | null |
options.withFileTypes | true |
#
ReturnsPromise
<Dirent
[]>
#
Defined innode_modules/@types/fs-extra/index.d.ts:220
#
readdirSync▸ readdirSync(path
, options?
): string
[]
Synchronous readdir(3) - read a directory.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | { encoding : BufferEncoding | null ; withFileTypes? : false } | BufferEncoding | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
[]
#
Defined innode_modules/@types/node/fs.d.ts:1220
▸ readdirSync(path
, options
): Buffer
[]
Synchronous readdir(3) - read a directory.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options | { encoding : "buffer" ; withFileTypes? : false } | "buffer" | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
ReturnsBuffer
[]
#
Defined innode_modules/@types/node/fs.d.ts:1227
▸ readdirSync(path
, options?
): string
[] | Buffer
[]
Synchronous readdir(3) - read a directory.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | BaseEncodingOptions & { withFileTypes? : false } | BufferEncoding | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
[] | Buffer
[]
#
Defined innode_modules/@types/node/fs.d.ts:1234
▸ readdirSync(path
, options
): Dirent
[]
Synchronous readdir(3) - read a directory.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options | BaseEncodingOptions & { withFileTypes : true } | If called with withFileTypes: true the result data will be an array of Dirent. |
#
ReturnsDirent
[]
#
Defined innode_modules/@types/node/fs.d.ts:1241
#
readlink▸ readlink(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException , linkString : string ) => any |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:222
▸ readlink(path
): Promise
<string
>
#
ParametersName | Type |
---|---|
path | PathLike |
#
ReturnsPromise
<string
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:223
#
readlinkSync▸ readlinkSync(path
, options?
): string
Synchronous readlink(2) - read value of a symbolic link.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | BaseEncodingOptions | BufferEncoding | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
#
Defined innode_modules/@types/node/fs.d.ts:746
▸ readlinkSync(path
, options
): Buffer
Synchronous readlink(2) - read value of a symbolic link.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options | BufferEncodingOption | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
ReturnsBuffer
#
Defined innode_modules/@types/node/fs.d.ts:753
▸ readlinkSync(path
, options?
): string
| Buffer
Synchronous readlink(2) - read value of a symbolic link.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | BaseEncodingOptions | string | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
| Buffer
#
Defined innode_modules/@types/node/fs.d.ts:760
#
readv▸ readv(fd
, buffers
, cb
): void
#
ParametersName | Type |
---|---|
fd | number |
buffers | ReadonlyArray <NodeJS.ArrayBufferView > |
cb | (err : NodeJS.ErrnoException | null , bytesRead : number , buffers : NodeJS.ArrayBufferView []) => void |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:2199
▸ readv(fd
, buffers
, position
, cb
): void
#
ParametersName | Type |
---|---|
fd | number |
buffers | ReadonlyArray <NodeJS.ArrayBufferView > |
position | number |
cb | (err : NodeJS.ErrnoException | null , bytesRead : number , buffers : NodeJS.ArrayBufferView []) => void |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:2204
#
readvSync▸ readvSync(fd
, buffers
, position?
): number
See readv
.
#
ParametersName | Type |
---|---|
fd | number |
buffers | ReadonlyArray <NodeJS.ArrayBufferView > |
position? | number |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:2223
#
realpath▸ realpath(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException , resolvedPath : string ) => any |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:225
▸ realpath(path
, cache
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
cache | Object |
callback | (err : NodeJS.ErrnoException , resolvedPath : string ) => any |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:226
▸ realpath(path
, cache?
): Promise
<string
>
#
ParametersName | Type |
---|---|
path | PathLike |
cache? | Object |
#
ReturnsPromise
<string
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:227
#
realpathSync▸ realpathSync(path
, options?
): string
Synchronous realpath(3) - return the canonicalized absolute pathname.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | BaseEncodingOptions | BufferEncoding | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
#
Defined innode_modules/@types/node/fs.d.ts:831
▸ realpathSync(path
, options
): Buffer
Synchronous realpath(3) - return the canonicalized absolute pathname.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options | BufferEncodingOption | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
ReturnsBuffer
#
Defined innode_modules/@types/node/fs.d.ts:838
▸ realpathSync(path
, options?
): string
| Buffer
Synchronous realpath(3) - return the canonicalized absolute pathname.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | BaseEncodingOptions | string | null | The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, 'utf8' is used. |
#
Returnsstring
| Buffer
#
Defined innode_modules/@types/node/fs.d.ts:845
#
reloadProject▸ reloadProject(): void
危险,本方法仅允许测试代码中使用
#
Returnsvoid
#
Defined in#
remove▸ remove(dir
, callback
): void
#
ParametersName | Type |
---|---|
dir | string |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:72
▸ remove(dir
, callback?
): Promise
<void
>
#
ParametersName | Type |
---|---|
dir | string |
callback? | (err : Error ) => void |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:73
#
removeSync▸ removeSync(dir
): void
#
ParametersName | Type |
---|---|
dir | string |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:74
#
rename▸ rename(oldPath
, newPath
, callback
): void
#
ParametersName | Type |
---|---|
oldPath | PathLike |
newPath | PathLike |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:229
▸ rename(oldPath
, newPath
): Promise
<void
>
#
ParametersName | Type |
---|---|
oldPath | PathLike |
newPath | PathLike |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:230
#
renameSync▸ renameSync(oldPath
, newPath
): void
Synchronous rename(2) - Change the name or location of a file or directory.
#
ParametersName | Type | Description |
---|---|---|
oldPath | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. |
newPath | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:308
#
rm▸ rm(path
, callback
): void
Asynchronously removes files and directories (modeled on the standard POSIX rm
utility).
#
ParametersName | Type |
---|---|
path | PathLike |
callback | NoParamCallback |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:959
▸ rm(path
, options
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
options | RmOptions |
callback | NoParamCallback |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:960
#
rmSync▸ rmSync(path
, options?
): void
Synchronously removes files and directories (modeled on the standard POSIX rm
utility).
#
ParametersName | Type |
---|---|
path | PathLike |
options? | RmOptions |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:973
#
rmdir▸ rmdir(path
, callback
): void
Asynchronous rmdir - removes the directory specified in {path}
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | - |
callback | (err : NodeJS.ErrnoException ) => void | No arguments other than a possible exception are given to the completion callback. |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:237
▸ rmdir(path
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:238
#
rmdirSync▸ rmdirSync(path
, options?
): void
Synchronous rmdir(2) - delete a directory.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | RmDirOptions | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:924
#
stat▸ stat(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException , stats : Stats ) => any |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:240
▸ stat(path
): Promise
<Stats
>
#
ParametersName | Type |
---|---|
path | PathLike |
#
ReturnsPromise
<Stats
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:241
#
statSync▸ statSync(path
, options?
): Stats
Synchronous stat(2) - Get file status.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
options? | StatOptions & { bigint? : false } | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:563
▸ statSync(path
, options
): BigIntStats
#
ParametersName | Type |
---|---|
path | PathLike |
options | StatOptions & { bigint : true } |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:564
▸ statSync(path
, options?
): Stats
| BigIntStats
#
ParametersName | Type |
---|---|
path | PathLike |
options? | StatOptions |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:565
#
symlink▸ symlink(target
, path
, type
, callback
): void
#
ParametersName | Type |
---|---|
target | PathLike |
path | PathLike |
type | SymlinkType | undefined |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:243
▸ symlink(target
, path
, callback
): void
#
ParametersName | Type |
---|---|
target | PathLike |
path | PathLike |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:244
▸ symlink(target
, path
, type?
): Promise
<void
>
#
ParametersName | Type |
---|---|
target | PathLike |
path | PathLike |
type? | SymlinkType |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:245
#
symlinkSync▸ symlinkSync(target
, path
, type?
): void
Synchronous symlink(2) - Create a new symbolic link to an existing file.
#
ParametersName | Type | Description |
---|---|---|
target | PathLike | A path to an existing file. If a URL is provided, it must use the file: protocol. |
path | PathLike | A path to the new symlink. If a URL is provided, it must use the file: protocol. |
type? | symlink.Type | null | May be set to 'dir' , 'file' , or 'junction' (default is 'file' ) and is only available on Windows (ignored on other platforms). When using 'junction' , the target argument will automatically be normalized to an absolute path. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:684
#
truncate▸ truncate(path
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:247
▸ truncate(path
, len
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
len | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:248
▸ truncate(path
, len?
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
len? | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:249
#
truncateSync▸ truncateSync(path
, len?
): void
Synchronous truncate(2) - Truncate a file to a specified length.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
len? | number | null | If not specified, defaults to 0 . |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:339
#
unlink▸ unlink(path
, callback
): void
Asynchronous unlink - deletes the file specified in {path}
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | - |
callback | (err : NodeJS.ErrnoException ) => void | No arguments other than a possible exception are given to the completion callback. |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:256
▸ unlink(path
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:257
#
unlinkSync▸ unlinkSync(path
): void
Synchronous unlink(2) - delete a name and possibly the file it refers to.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:872
#
unwatchFile▸ unwatchFile(filename
, listener?
): void
Stop watching for changes on filename
.
#
ParametersName | Type | Description |
---|---|---|
filename | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
listener? | (curr : Stats , prev : Stats ) => void | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1786
#
utimes▸ utimes(path
, atime
, mtime
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
atime | number |
mtime | number |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:259
▸ utimes(path
, atime
, mtime
, callback
): void
#
ParametersName | Type |
---|---|
path | PathLike |
atime | Date |
mtime | Date |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:260
▸ utimes(path
, atime
, mtime
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
atime | number |
mtime | number |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:261
▸ utimes(path
, atime
, mtime
): Promise
<void
>
#
ParametersName | Type |
---|---|
path | PathLike |
atime | Date |
mtime | Date |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:262
#
utimesSync▸ utimesSync(path
, atime
, mtime
): void
Synchronously change file timestamps of the file referenced by the supplied path.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | A path to a file. If a URL is provided, it must use the file: protocol. |
atime | string | number | Date | The last access time. If a string is provided, it will be coerced to number. |
mtime | string | number | Date | The last modified time. If a string is provided, it will be coerced to number. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1319
#
watch▸ watch(filename
, options
, listener?
): FSWatcher
Watch for changes on filename
, where filename
is either a file or a directory, returning an FSWatcher
.
#
ParametersName | Type | Description |
---|---|---|
filename | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
options | { encoding? : BufferEncoding | null ; persistent? : boolean ; recursive? : boolean } | BufferEncoding | undefined | null | Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. If encoding is not supplied, the default of 'utf8' is used. If persistent is not supplied, the default of true is used. If recursive is not supplied, the default of false is used. |
listener? | (event : "rename" | "change" , filename : string ) => void | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:1797
▸ watch(filename
, options
, listener?
): FSWatcher
Watch for changes on filename
, where filename
is either a file or a directory, returning an FSWatcher
.
#
ParametersName | Type | Description |
---|---|---|
filename | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
options | { encoding : "buffer" ; persistent? : boolean ; recursive? : boolean } | "buffer" | Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. If encoding is not supplied, the default of 'utf8' is used. If persistent is not supplied, the default of true is used. If recursive is not supplied, the default of false is used. |
listener? | (event : "rename" | "change" , filename : Buffer ) => void | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:1812
▸ watch(filename
, options
, listener?
): FSWatcher
Watch for changes on filename
, where filename
is either a file or a directory, returning an FSWatcher
.
#
ParametersName | Type | Description |
---|---|---|
filename | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
options | { encoding? : BufferEncoding | null ; persistent? : boolean ; recursive? : boolean } | string | null | Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. If encoding is not supplied, the default of 'utf8' is used. If persistent is not supplied, the default of true is used. If recursive is not supplied, the default of false is used. |
listener? | (event : "rename" | "change" , filename : string | Buffer ) => void | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:1827
▸ watch(filename
, listener?
): FSWatcher
Watch for changes on filename
, where filename
is either a file or a directory, returning an FSWatcher
.
#
ParametersName | Type | Description |
---|---|---|
filename | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
listener? | (event : "rename" | "change" , filename : string ) => any | - |
#
Returns#
Defined innode_modules/@types/node/fs.d.ts:1838
#
watchFile▸ watchFile(filename
, options
, listener
): void
Watch for changes on filename
. The callback listener
will be called each time the file is accessed.
#
ParametersName | Type |
---|---|
filename | PathLike |
options | { interval? : number ; persistent? : boolean } | undefined |
listener | (curr : Stats , prev : Stats ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1772
▸ watchFile(filename
, listener
): void
Watch for changes on filename
. The callback listener
will be called each time the file is accessed.
#
ParametersName | Type | Description |
---|---|---|
filename | PathLike | A path to a file or directory. If a URL is provided, it must use the file: protocol. URL support is experimental. |
listener | (curr : Stats , prev : Stats ) => void | - |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1779
#
write▸ write<TBuffer
>(fd
, buffer
, offset
, length
, position
, callback
): void
#
Type parametersName | Type |
---|---|
TBuffer | extends ArrayBufferView |
#
ParametersName | Type |
---|---|
fd | number |
buffer | TBuffer |
offset | number |
length | number |
position | number | null |
callback | (err : NodeJS.ErrnoException , written : number , buffer : TBuffer ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:264
▸ write<TBuffer
>(fd
, buffer
, offset
, length
, callback
): void
#
Type parametersName | Type |
---|---|
TBuffer | extends ArrayBufferView |
#
ParametersName | Type |
---|---|
fd | number |
buffer | TBuffer |
offset | number |
length | number |
callback | (err : NodeJS.ErrnoException , written : number , buffer : TBuffer ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:268
▸ write(fd
, data
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
data | any |
callback | (err : NodeJS.ErrnoException , written : number , str : string ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:272
▸ write(fd
, data
, offset
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
data | any |
offset | number |
callback | (err : NodeJS.ErrnoException , written : number , str : string ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:273
▸ write(fd
, data
, offset
, encoding
, callback
): void
#
ParametersName | Type |
---|---|
fd | number |
data | any |
offset | number |
encoding | string |
callback | (err : NodeJS.ErrnoException , written : number , str : string ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:274
▸ write<TBuffer
>(fd
, buffer
, offset?
, length?
, position?
): Promise
<Object
>
#
Type parametersName | Type |
---|---|
TBuffer | extends ArrayBufferView |
#
ParametersName | Type |
---|---|
fd | number |
buffer | TBuffer |
offset? | number |
length? | number |
position? | number | null |
#
ReturnsPromise
<Object
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:275
▸ write(fd
, data
, offset?
, encoding?
): Promise
<Object
>
#
ParametersName | Type |
---|---|
fd | number |
data | any |
offset? | number |
encoding? | string |
#
ReturnsPromise
<Object
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:276
#
writeFile▸ writeFile(file
, data
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
data | any |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:278
▸ writeFile(file
, data
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | PathLike | number |
data | any |
options? | WriteFileOptions | string |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:279
▸ writeFile(file
, data
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | PathLike | number |
data | any |
options | WriteFileOptions | string |
callback | (err : NodeJS.ErrnoException ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:280
#
writeFileSync▸ writeFileSync(path
, data
, options?
): void
Synchronously writes data to a file, replacing the file if it already exists.
#
ParametersName | Type | Description |
---|---|---|
path | PathLike | number | A path to a file. If a URL is provided, it must use the file: protocol. URL support is experimental. If a file descriptor is provided, the underlying file will not be closed automatically. |
data | string | NodeJS.ArrayBufferView | The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. |
options? | WriteFileOptions | Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. If encoding is not supplied, the default of 'utf8' is used. If mode is not supplied, the default of 0o666 is used. If mode is a string, it is parsed as an octal integer. If flag is not supplied, the default of 'w' is used. |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:1713
#
writeJSON▸ writeJSON(file
, object
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | string |
object | any |
options? | WriteOptions |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:85
▸ writeJSON(file
, object
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
object | any |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:86
▸ writeJSON(file
, object
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
object | any |
options | WriteOptions |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:87
#
writeJSONSync▸ writeJSONSync(file
, object
, options?
): void
#
ParametersName | Type |
---|---|
file | string |
object | any |
options? | WriteOptions |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:93
#
writeJson▸ writeJson(file
, object
, options?
): Promise
<void
>
#
ParametersName | Type |
---|---|
file | string |
object | any |
options? | WriteOptions |
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:88
▸ writeJson(file
, object
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
object | any |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:89
▸ writeJson(file
, object
, options
, callback
): void
#
ParametersName | Type |
---|---|
file | string |
object | any |
options | WriteOptions |
callback | (err : Error ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:90
#
writeJsonSync▸ writeJsonSync(file
, object
, options?
): void
#
ParametersName | Type |
---|---|
file | string |
object | any |
options? | WriteOptions |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:92
#
writeSync▸ writeSync(fd
, buffer
, offset?
, length?
, position?
): number
Synchronously writes buffer
to the file referenced by the supplied file descriptor, returning the number of bytes written.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
buffer | NodeJS.ArrayBufferView | - |
offset? | number | null | The part of the buffer to be written. If not supplied, defaults to 0 . |
length? | number | null | The number of bytes to write. If not supplied, defaults to buffer.length - offset . |
position? | number | null | The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:1481
▸ writeSync(fd
, string
, position?
, encoding?
): number
Synchronously writes string
to the file referenced by the supplied file descriptor, returning the number of bytes written.
#
ParametersName | Type | Description |
---|---|---|
fd | number | A file descriptor. |
string | string | A string to write. |
position? | number | null | The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. |
encoding? | BufferEncoding | null | The expected string encoding. |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:1490
#
writev▸ writev(fd
, buffers
, position
, cb
): void
#
ParametersName | Type |
---|---|
fd | number |
buffers | NodeJS.ArrayBufferView [] |
position | number |
cb | (err : NodeJS.ErrnoException | null , bytesWritten : number , buffers : NodeJS.ArrayBufferView []) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:282
▸ writev(fd
, buffers
, cb
): void
#
ParametersName | Type |
---|---|
fd | number |
buffers | NodeJS.ArrayBufferView [] |
cb | (err : NodeJS.ErrnoException | null , bytesWritten : number , buffers : NodeJS.ArrayBufferView []) => void |
#
Returnsvoid
#
Defined innode_modules/@types/fs-extra/index.d.ts:283
▸ writev(fd
, buffers
, position?
): Promise
<WritevResult
>
#
ParametersName | Type |
---|---|
fd | number |
buffers | NodeJS.ArrayBufferView [] |
position? | number |
#
ReturnsPromise
<WritevResult
>
#
Defined innode_modules/@types/fs-extra/index.d.ts:284
#
writevSync▸ writevSync(fd
, buffers
, position?
): number
See writev
.
#
ParametersName | Type |
---|---|
fd | number |
buffers | ReadonlyArray <NodeJS.ArrayBufferView > |
position? | number |
#
Returnsnumber
#
Defined innode_modules/@types/node/fs.d.ts:2197