Skip to content

[Replacement]: through2-map #746

Description

@gameroman

Package to replace

through2-map

Suggested replacement(s)

https://nodejs.org/api/stream.html#readablemapfn-options

import map from 'through2-map' // [!code --]

sourceStream.pipe(map.obj((chunk) => chunk.value)) // [!code --]
sourceStream.map((chunk) => chunk.value) // [!code ++]

or

import { pipeline } from 'node:stream/promises' // [!code ++]
import map from 'through2-map' // [!code --]

await pipeline(
  sourceStream, // [!code --]
  map.obj((chunk) => chunk.value), // [!code --]
  sourceStream.map((chunk) => chunk.value), // [!code ++]
  destinationStream
)

Manifest type

native (replaceable by a built-in platform feature)

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedUsed to signal if a suggested replacement has been accepted.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions