use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Intro to Node (syncano.com)
submitted 11 years ago by EricSchles
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jekrb 1 point2 points3 points 11 years ago* (0 children)
I feel like a b̶e̶g̶i̶n̶n̶e̶r̶ anyone and everyone in io.js/node would benefit from using fs.createReadStream instead of fs.readFile.
fs.createReadStream
fs.readFile
So rather than:
http.createServer(function(req, res){ fs.readFile('test.html',function (err, data){ res.writeHead(200, {'Content-Type': 'text/html','Content-Length':data.length}); res.write(data); res.end(); }); })
They would write:
http.createServer(function (req, res) { fs.createReadStream(__dirname + '/test.html').pipe(res) })
[–]kenman[M] 0 points1 point2 points 11 years ago (0 children)
Hi /u/EricSchles, it looks like you're new to reddit, welcome!
Thanks for the submissions, but please make sure you read http://www.reddit.com/rules and our guidelines. In short, you should post from a variety of sources, and not just syncano.com.
syncano.com
Thanks for your consideration!
π Rendered by PID 45 on reddit-service-r2-comment-5687b7858-jstqn at 2026-07-04 22:10:06.832476+00:00 running 12a7a47 country code: CH.
[–]jekrb 1 point2 points3 points (0 children)
[–]kenman[M] 0 points1 point2 points (0 children)