Skip to content

Instantly share code, notes, and snippets.

@jasonrhodes
Created March 9, 2014 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonrhodes/9452851 to your computer and use it in GitHub Desktop.
Save jasonrhodes/9452851 to your computer and use it in GitHub Desktop.
Trying to figure out how to interact with files in a gulp glob.
var through = require("through");
var fs = require("fs");
function write(file) {
console.log(file);
console.log(file.toString());
}
gulp.task("move", function () {
return gulp.src("./**")
.pipe(through(write));
});
@jasonrhodes
Copy link
Author

$ gulp move outputs something like this on the cli:

<File "some/path">
[object Object]
<File "some/path/file.js" <Buffer 2f 2a 0a 0a 4f 72 67 69 6e 61 6c 20 53 74 79 6c 65 20 66 72 6f 6d 20 65 74 68 61 6e 73 63 68 6f 6f 6e 6f 76 65 72 2e 63 6f 6d 2f 73 6f 6c 61 72 69 7a 65 ...>>
[object Object]

and so on for all the files contained in the glob. Not sure how to interact with this File object??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment