node-task / spec

A specification for javascript tasks.
MIT License
153 stars 2 forks source link

reader form #10

Closed tkellen closed 11 years ago

tkellen commented 11 years ago

I've just published a rough cut of the reader specification for node-task. Please ignore the mess that is logging for now. I'd love some feedback.

It's probably premature to get into this, but I just want to say that the writer version of the spec will basically dictate that the run method should resolve it's promise with a "bufferized" input object (see the reader spec for what that means). Task runners can then pipe those through other tasks until they are eventually finalized.

/cc @cowboy, @sindresorhus, @paulmillr, @millermedeiros, @marcooliveira, @satazor

paulmillr commented 11 years ago

what is buffer exactly? can it be like anything?

tkellen commented 11 years ago

http://nodejs.org/api/buffer.html

tkellen commented 11 years ago

@cowboy pointed out that it might be useful to make tasks only aware of buffers, and to perform reading/writing operations separately. I'm not sure what that looks like yet, but I can see the utility in like, piggybacking off the copy task to write to S3 or something.

tkellen commented 11 years ago

Actually, nevermind. Grunt's file-expansion utilities cover that need. Yeah, I'm not clear what the utility is in having tasks that need other tasks to complete their read/write operations.

paulmillr commented 11 years ago

I don’t like “filterRead” name. How about “map”? It’s consistent with array method that does transformation from input to output.

[file1, file2, file3].map(function(file) {
  file.data = coffeescript.compile(file.data);
  return file;
});
tkellen commented 11 years ago

Thanks for the feedback Paul, that makes complete sense. I think perhaps this discussion should be tabled for now, though (in light of issue #12)