Permalink
Browse files

keep streams in compatibility mode

New streams kind of broke your module :/

By the time the fs callback comes in, stdin is already in compatibility mode.
By attaching a noop handler on the data event from stdin, it's kept in old mode.

Maybe not ideal, but it works.
  • Loading branch information...
clux authored and substack committed Mar 13, 2013
1 parent b8ad1bd commit 988f3a8770bde587ab14e498fbd568d63a84b4b9
Showing with 1 addition and 0 deletions.
  1. +1 −0 index.js
View
@@ -48,6 +48,7 @@ PkgInit.prototype.build = function (name, cb) {
var stdout = opts.stdout || process.stdout;
var stdin = opts.stdin || process.stdin;
var file = self.filename(name);
+ stdin.on('data', function () {});
fs.readFile(file, function (err, src) {
if (err) return cb(err);

0 comments on commit 988f3a8

Please sign in to comment.