--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
> oh, wow. this is awesome.
>
> and not a callback in sight.
>
> see every one! streams kick ass!
Yeah... streams kick ass for streaming.
--
Jorge.
I'm probably going to integrate with this in my tar thingie.
On Fri, Oct 28, 2011 at 07:37, Pedro Teixeira <pedro.t...@gmail.com> wrote:
>> var request = require('filed');
>> var f = filed('/newfile')
>> f.write('test')
>> f.end()
Assuming that should be `var filed = require('filed')`?
>> fs.createReadStream(filed('/newfile'))
Am I reading this right? You're passing a filed response to
createReadStream? Some kind of toString magic, or should there be a
.pipe() in there somewhere, or flip the nesting?
>> http.createServer(function (req, resp) {
>> req.pipe(filed('/directory')).pipe(resp)
>>
>> })
>>
>> Just to round out the full feature set and make it full file server if you give filed an existing directory it will actually check for an index.html file in that directory and serve it if it exists.
The only thing missing is filed.createServer('/directory').listen(80)
> Yeah, this is super badass. Nicely done, Mikeal.
>
> I'm probably going to integrate with this in my tar thingie.
>
> On Fri, Oct 28, 2011 at 07:37, Pedro Teixeira <pedro.t...@gmail.com> wrote:
>>> var request = require('filed');
>>> var f = filed('/newfile')
>>> f.write('test')
>>> f.end()
>
> Assuming that should be `var filed = require('filed')`?
yeah, i got two pull requests for that doc bug 10 minutes after release :) fixed.
>
>>> fs.createReadStream(filed('/newfile'))
>
> Am I reading this right? You're passing a filed response to
> createReadStream? Some kind of toString magic, or should there be a
> .pipe() in there somewhere, or flip the nesting?
whoops, yeah, that should be .pipe(filed('/newfile'))
>
>>> http.createServer(function (req, resp) {
>>> req.pipe(filed('/directory')).pipe(resp)
>>>
>>> })
>>>
>>> Just to round out the full feature set and make it full file server if you give filed an existing directory it will actually check for an index.html file in that directory and serve it if it exists.
>
> The only thing missing is filed.createServer('/directory').listen(80)
i rarely, if ever, what to create a server that *only* serves static files. i could add this easily, and might, but the framework i've been building (which is also being used for this non-public project) has a really nice api for serving files for a route and uses filed under the hood. that will be released eventually as well.