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-core
DefaultStream
Globals
{"Generic Packages":{"@yarnpkg/core":"yarnpkg_core","@yarnpkg/fslib":"yarnpkg_fslib","@yarnpkg/json-proxy":"yarnpkg_json_proxy","@yarnpkg/libzip":"yarnpkg_libzip","@yarnpkg/parsers":"yarnpkg_parsers","@yarnpkg/pnp":"yarnpkg_pnp","@yarnpkg/pnpify":"yarnpkg_pnpify","@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-node-modules":"plugin_node_modules","@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 DefaultStream
Hierarchy
Transform
DefaultStream
Implements
ReadableStream
Writable
Constructors
constructor
Properties
active
ifEmpty
readable
readableHighWaterMark
readableLength
writable
writableHighWaterMark
writableLength
defaultMaxListeners
Methods
[Symbol.asyncIterator]
_destroy
_final
_flush
_read
_transform
_write
_writev
addListener
cork
destroy
emit
end
eventNames
getMaxListeners
isPaused
listenerCount
listeners
off
on
once
pause
pipe
prependListener
prependOnceListener
push
rawListeners
read
removeAllListeners
removeListener
resume
setDefaultEncoding
setEncoding
setMaxListeners
uncork
unpipe
unshift
wrap
write
listenerCount
Constructors
constructor
new
Default
Stream
(
ifEmpty
?:
Buffer
)
:
DefaultStream
Parameters
Default value
ifEmpty:
Buffer
= Buffer.alloc(0)
Returns
DefaultStream
Properties
active
active
:
boolean
= true
Private
if
Empty
if
Empty
:
Buffer
readable
readable
:
boolean
readable
High
Water
Mark
readable
High
Water
Mark
:
number
readable
Length
readable
Length
:
number
writable
writable
:
boolean
writable
High
Water
Mark
writable
High
Water
Mark
:
number
writable
Length
writable
Length
:
number
Static
default
Max
Listeners
default
Max
Listeners
:
number
Methods
[
Symbol.async
Iterator]
[
Symbol.async
Iterator]
(
)
:
AsyncIterableIterator
<
any
>
Returns
AsyncIterableIterator
<
any
>
_destroy
_destroy
(
error
:
Error
|
null
, callback
:
function
)
:
void
Parameters
error:
Error
|
null
callback:
function
(
error
:
Error
|
null
)
:
void
Parameters
error:
Error
|
null
Returns
void
Returns
void
_final
_final
(
callback
:
function
)
:
void
Parameters
callback:
function
(
error
?:
Error
|
null
)
:
void
Parameters
Optional
error:
Error
|
null
Returns
void
Returns
void
_flush
_flush
(
cb
:
any
)
:
void
Parameters
cb:
any
Returns
void
_read
_read
(
size
:
number
)
:
void
Parameters
size:
number
Returns
void
_transform
_transform
(
chunk
:
Buffer
, encoding
:
string
, cb
:
any
)
:
void
Parameters
chunk:
Buffer
encoding:
string
cb:
any
Returns
void
_write
_write
(
chunk
:
any
, encoding
:
string
, callback
:
function
)
:
void
Parameters
chunk:
any
encoding:
string
callback:
function
(
error
?:
Error
|
null
)
:
void
Parameters
Optional
error:
Error
|
null
Returns
void
Returns
void
Optional
_writev
_writev
(
chunks
:
Array
<
object
>
, callback
:
function
)
:
void
Parameters
chunks:
Array
<
object
>
callback:
function
(
error
?:
Error
|
null
)
:
void
Parameters
Optional
error:
Error
|
null
Returns
void
Returns
void
add
Listener
add
Listener
(
event
:
"close"
, listener
:
function
)
:
this
add
Listener
(
event
:
"data"
, listener
:
function
)
:
this
add
Listener
(
event
:
"end"
, listener
:
function
)
:
this
add
Listener
(
event
:
"readable"
, listener
:
function
)
:
this
add
Listener
(
event
:
"error"
, listener
:
function
)
:
this
add
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Event emitter The defined events on documents including:
close
data
end
readable
error
Parameters
event:
"close"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"data"
listener:
function
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
Returns
this
Parameters
event:
"end"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"readable"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"error"
listener:
function
(
err
:
Error
)
:
void
Parameters
err:
Error
Returns
void
Returns
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
cork
cork
(
)
:
void
Returns
void
destroy
destroy
(
error
?:
Error
)
:
void
Parameters
Optional
error:
Error
Returns
void
emit
emit
(
event
:
"close"
)
:
boolean
emit
(
event
:
"data"
, chunk
:
any
)
:
boolean
emit
(
event
:
"end"
)
:
boolean
emit
(
event
:
"readable"
)
:
boolean
emit
(
event
:
"error"
, err
:
Error
)
:
boolean
emit
(
event
:
string
|
symbol
,
...
args
:
any
[]
)
:
boolean
Parameters
event:
"close"
Returns
boolean
Parameters
event:
"data"
chunk:
any
Returns
boolean
Parameters
event:
"end"
Returns
boolean
Parameters
event:
"readable"
Returns
boolean
Parameters
event:
"error"
err:
Error
Returns
boolean
Parameters
event:
string
|
symbol
Rest
...
args:
any
[]
Returns
boolean
end
end
(
cb
?:
undefined
|
function
)
:
void
end
(
chunk
:
any
, cb
?:
undefined
|
function
)
:
void
end
(
chunk
:
any
, encoding
?:
undefined
|
string
, cb
?:
undefined
|
function
)
:
void
Parameters
Optional
cb:
undefined
|
function
Returns
void
Parameters
chunk:
any
Optional
cb:
undefined
|
function
Returns
void
Parameters
chunk:
any
Optional
encoding:
undefined
|
string
Optional
cb:
undefined
|
function
Returns
void
event
Names
event
Names
(
)
:
Array
<
string
|
symbol
>
Returns
Array
<
string
|
symbol
>
get
Max
Listeners
get
Max
Listeners
(
)
:
number
Returns
number
is
Paused
is
Paused
(
)
:
boolean
Returns
boolean
listener
Count
listener
Count
(
type
:
string
|
symbol
)
:
number
Parameters
type:
string
|
symbol
Returns
number
listeners
listeners
(
event
:
string
|
symbol
)
:
Function
[]
Parameters
event:
string
|
symbol
Returns
Function
[]
off
off
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
on
on
(
event
:
"close"
, listener
:
function
)
:
this
on
(
event
:
"data"
, listener
:
function
)
:
this
on
(
event
:
"end"
, listener
:
function
)
:
this
on
(
event
:
"readable"
, listener
:
function
)
:
this
on
(
event
:
"error"
, listener
:
function
)
:
this
on
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
"close"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"data"
listener:
function
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
Returns
this
Parameters
event:
"end"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"readable"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"error"
listener:
function
(
err
:
Error
)
:
void
Parameters
err:
Error
Returns
void
Returns
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
once
once
(
event
:
"close"
, listener
:
function
)
:
this
once
(
event
:
"data"
, listener
:
function
)
:
this
once
(
event
:
"end"
, listener
:
function
)
:
this
once
(
event
:
"readable"
, listener
:
function
)
:
this
once
(
event
:
"error"
, listener
:
function
)
:
this
once
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
"close"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"data"
listener:
function
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
Returns
this
Parameters
event:
"end"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"readable"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"error"
listener:
function
(
err
:
Error
)
:
void
Parameters
err:
Error
Returns
void
Returns
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
pause
pause
(
)
:
this
Returns
this
pipe
pipe<T>
(
destination
:
T
, options
?:
undefined
|
object
)
:
T
Type parameters
T
:
WritableStream
Parameters
destination:
T
Optional
options:
undefined
|
object
Returns
T
prepend
Listener
prepend
Listener
(
event
:
"close"
, listener
:
function
)
:
this
prepend
Listener
(
event
:
"data"
, listener
:
function
)
:
this
prepend
Listener
(
event
:
"end"
, listener
:
function
)
:
this
prepend
Listener
(
event
:
"readable"
, listener
:
function
)
:
this
prepend
Listener
(
event
:
"error"
, listener
:
function
)
:
this
prepend
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
"close"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"data"
listener:
function
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
Returns
this
Parameters
event:
"end"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"readable"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"error"
listener:
function
(
err
:
Error
)
:
void
Parameters
err:
Error
Returns
void
Returns
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
prepend
Once
Listener
prepend
Once
Listener
(
event
:
"close"
, listener
:
function
)
:
this
prepend
Once
Listener
(
event
:
"data"
, listener
:
function
)
:
this
prepend
Once
Listener
(
event
:
"end"
, listener
:
function
)
:
this
prepend
Once
Listener
(
event
:
"readable"
, listener
:
function
)
:
this
prepend
Once
Listener
(
event
:
"error"
, listener
:
function
)
:
this
prepend
Once
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
"close"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"data"
listener:
function
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
Returns
this
Parameters
event:
"end"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"readable"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"error"
listener:
function
(
err
:
Error
)
:
void
Parameters
err:
Error
Returns
void
Returns
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
push
push
(
chunk
:
any
, encoding
?:
undefined
|
string
)
:
boolean
Parameters
chunk:
any
Optional
encoding:
undefined
|
string
Returns
boolean
raw
Listeners
raw
Listeners
(
event
:
string
|
symbol
)
:
Function
[]
Parameters
event:
string
|
symbol
Returns
Function
[]
read
read
(
size
?:
undefined
|
number
)
:
any
Parameters
Optional
size:
undefined
|
number
Returns
any
remove
All
Listeners
remove
All
Listeners
(
event
?:
string
|
symbol
)
:
this
Parameters
Optional
event:
string
|
symbol
Returns
this
remove
Listener
remove
Listener
(
event
:
"close"
, listener
:
function
)
:
this
remove
Listener
(
event
:
"data"
, listener
:
function
)
:
this
remove
Listener
(
event
:
"end"
, listener
:
function
)
:
this
remove
Listener
(
event
:
"readable"
, listener
:
function
)
:
this
remove
Listener
(
event
:
"error"
, listener
:
function
)
:
this
remove
Listener
(
event
:
string
|
symbol
, listener
:
function
)
:
this
Parameters
event:
"close"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"data"
listener:
function
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
Returns
this
Parameters
event:
"end"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"readable"
listener:
function
(
)
:
void
Returns
void
Returns
this
Parameters
event:
"error"
listener:
function
(
err
:
Error
)
:
void
Parameters
err:
Error
Returns
void
Returns
this
Parameters
event:
string
|
symbol
listener:
function
(
...
args
:
any
[]
)
:
void
Parameters
Rest
...
args:
any
[]
Returns
void
Returns
this
resume
resume
(
)
:
this
Returns
this
set
Default
Encoding
set
Default
Encoding
(
encoding
:
string
)
:
this
Parameters
encoding:
string
Returns
this
set
Encoding
set
Encoding
(
encoding
:
string
)
:
this
Parameters
encoding:
string
Returns
this
set
Max
Listeners
set
Max
Listeners
(
n
:
number
)
:
this
Parameters
n:
number
Returns
this
uncork
uncork
(
)
:
void
Returns
void
unpipe
unpipe
(
destination
?:
NodeJS.WritableStream
)
:
this
Parameters
Optional
destination:
NodeJS.WritableStream
Returns
this
unshift
unshift
(
chunk
:
any
)
:
void
Parameters
chunk:
any
Returns
void
wrap
wrap
(
oldStream
:
ReadableStream
)
:
this
Parameters
oldStream:
ReadableStream
Returns
this
write
write
(
chunk
:
any
, cb
?:
undefined
|
function
)
:
boolean
write
(
chunk
:
any
, encoding
?:
undefined
|
string
, cb
?:
undefined
|
function
)
:
boolean
Parameters
chunk:
any
Optional
cb:
undefined
|
function
Returns
boolean
Parameters
chunk:
any
Optional
encoding:
undefined
|
string
Optional
cb:
undefined
|
function
Returns
boolean
Static
listener
Count
listener
Count
(
emitter
:
EventEmitter
, event
:
string
|
symbol
)
:
number
deprecated
since v4.0.0
Parameters
emitter:
EventEmitter
event:
string
|
symbol
Returns
number
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-
node-
modules
plugin-
npm
plugin-
npm-
cli
plugin-
pack
plugin-
patch
plugin-
pnp
plugin-
stage
plugin-
typescript
plugin-
version
plugin-
workspace-
tools
vscode-
zipfs
yarnpkg-
builder
yarnpkg-
cli
yarnpkg-
core
Default
Stream
constructor
active
if
Empty
readable
readable
High
Water
Mark
readable
Length
writable
writable
High
Water
Mark
writable
Length
default
Max
Listeners
[
Symbol.async
Iterator]
_destroy
_final
_flush
_read
_transform
_write
_writev
add
Listener
cork
destroy
emit
end
event
Names
get
Max
Listeners
is
Paused
listener
Count
listeners
off
on
once
pause
pipe
prepend
Listener
prepend
Once
Listener
push
raw
Listeners
read
remove
All
Listeners
remove
Listener
resume
set
Default
Encoding
set
Encoding
set
Max
Listeners
uncork
unpipe
unshift
wrap
write
listener
Count
yarnpkg-
doctor
yarnpkg-
fslib
yarnpkg-
json-
proxy
yarnpkg-
libui
yarnpkg-
libzip
yarnpkg-
parsers
yarnpkg-
pnp
yarnpkg-
pnpify
yarnpkg-
shell
Generated using
TypeDoc
Event emitter The defined events on documents including: