Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Question about multiple 'end' callbacks fired when piping multiple files #19

Open
@fostahgix

Description

@fostahgix

Hello, I am trying to figure out a way to only fire one 'end' event when piping multiple files to fstream.Reader. Is there a better way to handle this?

  var r = fstream.Reader({

    path: source,

    type: 'File'

  }).pipe(zlib.createGunzip()).pipe(tar.Extract({

    strip: strip,

    path: destination

  }));

  r.on('end', function() {
     // this is firing everytime a file is extracted. Ideally, I would only fire one 'end' event.
    if (typeof callback === 'function') {

      return callback(null);

    }

  });

Result when extracting two files = two 'end' callbacks. Any advice is appreciated. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions