Comments (5)
@erikras I think gulp uses object mode since each element in the stream is a vinyl object: https://github.com/wearefractal/vinyl
You'll have better luck posting to gulp issues forum.
from through2.
For streams of files, gulp uses objectMode. Are you referring to a particular gulp plugin that is not using objectMode? Or are you referring to a stream of the file contents? If it's a stream of the file contents, I think you're on your own...
from through2.
The problem is that exorcist is not an official gulp plugin, and apparently I don't understand node streams well enough to wrap it into a gulp plugin. Exorcist takes command line piped input. It sounds like I'd have to unwrap the vinyl object, pass it through exorcist, and then wrap it again. It seems like a common enough problem that I thought maybe someone had written one.
Thanks for your quick replies.
from through2.
Aha!!! I knew this was possible. vinyl-transform to the rescue!
from through2.
For posterity, this is how you wrap exorcist for gulp:
'use strict';
var gulp = require('gulp'),
browserify = require('gulp-browserify'),
transform = require('vinyl-transform'),
exorcist = require('exorcist'),
concat = require('gulp-concat');
gulp.task('browserify', function () {
gulp
.src('src/app.js')
.pipe(browserify({
debug: true
}))
.pipe(transform(function () {
return exorcist('dist/script.map');
}))
.pipe(concat('script.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('default', ['browserify']);
from through2.
Related Issues (20)
- [QUESTION] through.obj remove duplicate files using path HOT 3
- Security risk
- Object `Transform`s not working well with `stream.compose`
- Update readable-stream module as it's dependent module safe-buffer marked as EOL
- TypeError: Cannot read property 'ended' of undefined HOT 2
- please use a well known open source license HOT 3
- Async issue HOT 1
- package.json parse error
- Readme should describe the transformFunction's "encoding" argument.
- Why only get to the first 16 matched files HOT 3
- how do I test a gulp plugin used througn2 with async callback?
- additional collab?
- Es7 Cannot read property 'push' of undefined HOT 3
- multi column postgres Copy using through2 HOT 1
- Hard to understand the code HOT 2
- 'end' emitted after 'finish' HOT 6
- Create stream with independent objectModes for readableState and writeableState? HOT 2
- v2.0.4 breaking change for gulp packages when using Node 0.10 HOT 17
- BC of new version HOT 1
- `this.push` method call other object stream function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from through2.