-
-
Notifications
You must be signed in to change notification settings - Fork 11
V2: utils: skip()
Eugene Lazutkin edited this page Aug 3, 2022
·
1 revision
(Since 2.2.0)
skip()
skips a given number of items from a stream. It is returned by require('stream-chain/utils/skip')
and it is based on Transform.
It takes options
and returns a Transform stream.
options
can be one of these:
- an object detailed in the Node's documentation.
-
readableObjectMode
andwritableObjectMode
are always set to `true. - The following custom options are recognized:
-
(optional)
n
is a non-negative integer indicating how many items to skip. Default:0
.
-
(optional)
-
- Otherwise it is assumed to be a non-negative integer, same as
n
described above.
A constructor of the underlying stream class produced by skip()
. Useful to inspect objects with instanceof
.
An alias to skip
. Useful with metaprogramming.
const {chain} = require('stream-chain');
const skip = require('stream-chain/utils/skip');
// skip 10 items
const pipeline = chain([
skip(10)
// ... the rest of the pipeline
]);