Search
Preparing search index...
The search index is not available
Yarn API
Home
Configuration
Features
CLI
Advanced
GitHub
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
yarnpkg-fslib
FileHandle
Globals
{"Generic Packages":{"@yarnpkg/core":"yarnpkg_core","@yarnpkg/fslib":"yarnpkg_fslib","@yarnpkg/libzip":"yarnpkg_libzip","@yarnpkg/nm":"yarnpkg_nm","@yarnpkg/parsers":"yarnpkg_parsers","@yarnpkg/pnp":"yarnpkg_pnp","@yarnpkg/pnpify":"yarnpkg_pnpify","@yarnpkg/sdks":"yarnpkg_sdks","@yarnpkg/shell":"yarnpkg_shell"},"Yarn Packages":{"@yarnpkg/builder":"yarnpkg_builder","@yarnpkg/cli":"yarnpkg_cli"},"Default Plugins":{"@yarnpkg/plugin-compat":"plugin_compat","@yarnpkg/plugin-dlx":"plugin_dlx","@yarnpkg/plugin-essentials":"plugin_essentials","@yarnpkg/plugin-file":"plugin_file","@yarnpkg/plugin-git":"plugin_git","@yarnpkg/plugin-github":"plugin_github","@yarnpkg/plugin-http":"plugin_http","@yarnpkg/plugin-init":"plugin_init","@yarnpkg/plugin-link":"plugin_link","@yarnpkg/plugin-nm":"plugin_nm","@yarnpkg/plugin-npm":"plugin_npm","@yarnpkg/plugin-npm-cli":"plugin_npm_cli","@yarnpkg/plugin-pack":"plugin_pack","@yarnpkg/plugin-patch":"plugin_patch","@yarnpkg/plugin-pnp":"plugin_pnp"},"Contrib Plugins":{"@yarnpkg/plugin-constraints":"plugin_constraints","@yarnpkg/plugin-exec":"plugin_exec","@yarnpkg/plugin-interactive-tools":"plugin_interactive_tools","@yarnpkg/plugin-stage":"plugin_stage","@yarnpkg/plugin-typescript":"plugin_typescript","@yarnpkg/plugin-version":"plugin_version","@yarnpkg/plugin-workspace-tools":"plugin_workspace_tools"}}
Class FileHandle<P>
Type parameters
P
:
Path
Hierarchy
FileHandle
Constructors
constructor
Properties
[kBaseFs]
[kClosePromise]
[kCloseReject]
[kCloseResolve]
[kFd]
[kRefs]
Accessors
fd
Methods
[kRef]
[kUnref]
appendFile
chmod
chown
close
createReadStream
createWriteStream
datasync
read
readFile
readLines
readv
stat
sync
truncate
utimes
write
writeFile
writev
Constructors
constructor
new
File
Handle
(
fd
:
number
, baseFs
:
FakeFS
<
P
>
)
:
FileHandle
Parameters
fd:
number
baseFs:
FakeFS
<
P
>
Returns
FileHandle
Properties
[k
Base
Fs]
[k
Base
Fs]
:
FakeFS
<
P
>
[k
Close
Promise]
[k
Close
Promise]
:
Promise
<
void
>
|
undefined
= undefined
[k
Close
Reject]
[k
Close
Reject]
:
function
|
undefined
= undefined
[k
Close
Resolve]
[k
Close
Resolve]
:
function
|
undefined
= undefined
[k
Fd]
[k
Fd]
:
number
[k
Refs]
[k
Refs]
:
number
= 1
Accessors
fd
get
fd
(
)
:
number
Returns
number
Methods
[k
Ref]
[k
Ref]
(
caller
:
Function
)
:
void
Parameters
caller:
Function
Returns
void
[k
Unref]
[k
Unref]
(
)
:
void
Returns
void
append
File
append
File
(
data
:
string
|
Uint8Array
, options
?:
ObjectEncodingOptions
&
FlagAndOpenMode
|
BufferEncoding
|
null
)
:
Promise
<
void
>
Parameters
data:
string
|
Uint8Array
Optional
options:
ObjectEncodingOptions
&
FlagAndOpenMode
|
BufferEncoding
|
null
Returns
Promise
<
void
>
chmod
chmod
(
mode
:
number
)
:
Promise
<
void
>
Parameters
mode:
number
Returns
Promise
<
void
>
chown
chown
(
uid
:
number
, gid
:
number
)
:
Promise
<
void
>
Parameters
uid:
number
gid:
number
Returns
Promise
<
void
>
close
close
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
create
Read
Stream
create
Read
Stream
(
options
?:
CreateReadStreamOptions
)
:
ReadStream
Parameters
Optional
options:
CreateReadStreamOptions
Returns
ReadStream
create
Write
Stream
create
Write
Stream
(
options
?:
CreateWriteStreamOptions
)
:
WriteStream
Parameters
Optional
options:
CreateWriteStreamOptions
Returns
WriteStream
datasync
datasync
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
read
read
(
options
?:
FileReadOptions
<
Buffer
>
)
:
Promise
<
FileReadResult
<
Buffer
>
>
read
(
buffer
:
Buffer
, offset
?:
number
|
null
, length
?:
number
|
null
, position
?:
number
|
null
)
:
Promise
<
FileReadResult
<
Buffer
>
>
Parameters
Optional
options:
FileReadOptions
<
Buffer
>
Returns
Promise
<
FileReadResult
<
Buffer
>
>
Parameters
buffer:
Buffer
Optional
offset:
number
|
null
Optional
length:
number
|
null
Optional
position:
number
|
null
Returns
Promise
<
FileReadResult
<
Buffer
>
>
read
File
read
File
(
options
?:
object
|
null
)
:
Promise
<
Buffer
>
read
File
(
options
:
object
|
BufferEncoding
)
:
Promise
<
string
>
Parameters
Optional
options:
object
|
null
Returns
Promise
<
Buffer
>
Parameters
options:
object
|
BufferEncoding
Returns
Promise
<
string
>
read
Lines
read
Lines
(
options
?:
CreateReadStreamOptions
)
:
Interface
Parameters
Optional
options:
CreateReadStreamOptions
Returns
Interface
readv
readv
(
buffers
:
ReadonlyArray
<
NodeJS.ArrayBufferView
>
, position
?:
undefined
|
number
)
:
Promise
<
ReadVResult
>
Parameters
buffers:
ReadonlyArray
<
NodeJS.ArrayBufferView
>
Optional
position:
undefined
|
number
Returns
Promise
<
ReadVResult
>
stat
stat
(
opts
?:
StatOptions
&
object
)
:
Promise
<
Stats
>
stat
(
opts
:
StatOptions
&
object
)
:
Promise
<
BigIntStats
>
Parameters
Optional
opts:
StatOptions
&
object
Returns
Promise
<
Stats
>
Parameters
opts:
StatOptions
&
object
Returns
Promise
<
BigIntStats
>
sync
sync
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
truncate
truncate
(
len
?:
undefined
|
number
)
:
Promise
<
void
>
Parameters
Optional
len:
undefined
|
number
Returns
Promise
<
void
>
utimes
utimes
(
atime
:
string
|
number
|
Date
, mtime
:
string
|
number
|
Date
)
:
Promise
<
void
>
Parameters
atime:
string
|
number
|
Date
mtime:
string
|
number
|
Date
Returns
Promise
<
void
>
write
write
(
...
args
:
WriteArgsString
)
:
Promise
<
object
>
write<TBuffer>
(
...
args
:
WriteArgsBuffer
<
TBuffer
>
)
:
Promise
<
object
>
Parameters
Rest
...
args:
WriteArgsString
Returns
Promise
<
object
>
Type parameters
TBuffer
:
Uint8Array
Parameters
Rest
...
args:
WriteArgsBuffer
<
TBuffer
>
Returns
Promise
<
object
>
write
File
write
File
(
data
:
string
|
Uint8Array
, options
?:
ObjectEncodingOptions
&
FlagAndOpenMode
&
Abortable
|
BufferEncoding
|
null
)
:
Promise
<
void
>
Parameters
data:
string
|
Uint8Array
Optional
options:
ObjectEncodingOptions
&
FlagAndOpenMode
&
Abortable
|
BufferEncoding
|
null
Returns
Promise
<
void
>
writev
writev
(
buffers
:
Array
<
NodeJS.ArrayBufferView
>
, position
?:
undefined
|
number
)
:
Promise
<
WriteVResult
>
Parameters
buffers:
Array
<
NodeJS.ArrayBufferView
>
Optional
position:
undefined
|
number
Returns
Promise
<
WriteVResult
>
yarnpkg-
fslib
File
Handle
constructor
[k
Base
Fs]
[k
Close
Promise]
[k
Close
Reject]
[k
Close
Resolve]
[k
Fd]
[k
Refs]
fd
[k
Ref]
[k
Unref]
append
File
chmod
chown
close
create
Read
Stream
create
Write
Stream
datasync
read
read
File
read
Lines
readv
stat
sync
truncate
utimes
write
write
File
writev
Generated using
TypeDoc