Node js : read two files , compare parts of files and output a sorted file
<p>I just started node.js and tried to solve the below problem.
I used  fs.readfile and async module. but it is not working properly.
Anyone could show me a sample code?
Thank you in advance</p>

<p>Ex) Read two big files at same time and sort them together by time.
 Should come up with an output file like below</p>

<pre><code>file A :

&lt;time=100&gt; james
&lt;time=210&gt; jordan
&lt;time=300&gt; cam
&lt;time=500&gt; joly
&lt;time=700&gt; car
..... 
 //this is a big file,  we need to handle a buffer properly

file B :

&lt;time=90&gt; sam
&lt;time=210&gt; foo
&lt;time=350&gt; call
&lt;time=600&gt; seattle
&lt;time=660&gt; usa
..... 
 //this is a big file, we  need to handle a buffer properly

output file :

&lt;time=90&gt; sam
&lt;time=100&gt; james
&lt;time=210&gt; jordan
&lt;time=210&gt; foo
&lt;time=300&gt; cam
&lt;time=350&gt; call
&lt;time=500&gt; joly
&lt;time=600&gt; seattle
&lt;time=660&gt; usa
&lt;time=700&gt; car
...
</code></pre>