Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve integration with streams #243

Closed
mrmlnc opened this issue Dec 1, 2019 · 1 comment
Closed

Improve integration with streams #243

mrmlnc opened this issue Dec 1, 2019 · 1 comment

Comments

@mrmlnc
Copy link
Owner

mrmlnc commented Dec 1, 2019

Source issues

Code

public read(task: Task): Readable {
const root = this._getRootDirectory(task);
const options = this._getReaderOptions(task);
const source = this.api(root, task, options);
const destination = new Readable({ objectMode: true, read: () => { /* noop */ } });
source
.once('error', (error: ErrnoException) => destination.emit('error', error))
.on('data', (entry: Entry) => destination.emit('data', options.transform(entry)))
.once('end', () => destination.emit('end'));
destination
.once('close', () => source.destroy());
return destination;
}

@mrmlnc
Copy link
Owner Author

mrmlnc commented Jul 24, 2023

The current state:

@mrmlnc mrmlnc closed this as completed Jul 24, 2023
@mrmlnc mrmlnc added this to the 4.0.0 milestone Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant