How to write a file in nodejs

  node.js, question
fs.createReadStream(body).pipe(fs.createWriteStream('./public/image/doodle.png'));
I found the path to the string when writing body like this. here body is a picture file. how should I write it?

Is that so

var http=require('http');
 var fs=require('fs');
 http.get('http://img30.360buyimg.com/shaidan/s128x96_jfs/t2326/17/1687232625/19293/4d621a93/56715d76N5eaaa8f1.jpg',function(response){
 response.pipe(fs.createWriteStream('../../targetFiles/doodle.jpg'));
 });