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

Solution for Writing Transforms using concat-stream? #15

Open
byudaniel opened this issue Feb 4, 2015 · 0 comments
Open

Solution for Writing Transforms using concat-stream? #15

byudaniel opened this issue Feb 4, 2015 · 0 comments

Comments

@byudaniel
Copy link

I'm having trouble understanding how I could use concat-stream to get the solution to the "Writing Transforms" problem. Any ideas?

var through = require('through2');
var concat = require('concat-stream');
var sprintf = require('sprintf');

module.exports = function(file) {
    if (!/\.txt$/.test(file)) {
        return through();
    }

    var stream = through();

    stream.pipe(concat(function(text) {
        // How can I pipe result to stream?
    }));

    return stream;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant