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/fslib
@yarnpkg/libzip
@yarnpkg/nm
@yarnpkg/parsers
@yarnpkg/pnp
@yarnpkg/pnpify
@yarnpkg/sdks
@yarnpkg/shell
Yarn Packages
@yarnpkg/builder
@yarnpkg/cli
Default Plugins
@yarnpkg/plugin-compat
@yarnpkg/plugin-dlx
@yarnpkg/plugin-essentials
@yarnpkg/plugin-file
@yarnpkg/plugin-git
@yarnpkg/plugin-github
@yarnpkg/plugin-http
@yarnpkg/plugin-init
@yarnpkg/plugin-link
@yarnpkg/plugin-nm
@yarnpkg/plugin-npm
@yarnpkg/plugin-npm-cli
@yarnpkg/plugin-pack
@yarnpkg/plugin-patch
@yarnpkg/plugin-pnp
Contrib Plugins
@yarnpkg/plugin-constraints
@yarnpkg/plugin-exec
@yarnpkg/plugin-interactive-tools
@yarnpkg/plugin-stage
@yarnpkg/plugin-typescript
@yarnpkg/plugin-version
@yarnpkg/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
>
"scripts/extract-
hooks"
acceptance-
tests
plugin-
compat
plugin-
constraints
plugin-
dlx
plugin-
essentials
plugin-
exec
plugin-
file
plugin-
git
plugin-
github
plugin-
http
plugin-
init
plugin-
interactive-
tools
plugin-
link
plugin-
nm
plugin-
npm
plugin-
npm-
cli
plugin-
pack
plugin-
patch
plugin-
pnp
plugin-
pnpm
plugin-
stage
plugin-
typescript
plugin-
version
plugin-
workspace-
tools
vscode-
zipfs
yarnpkg-
builder
yarnpkg-
cli
yarnpkg-
core
yarnpkg-
doctor
yarnpkg-
extensions
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
yarnpkg-
libui
yarnpkg-
libzip
yarnpkg-
nm
yarnpkg-
parsers
yarnpkg-
pnp
yarnpkg-
pnpify
yarnpkg-
sdks
yarnpkg-
shell
Generated using
TypeDoc