Resizing console affects fs.readFile output

时间:2018-06-20 05:04:20

标签: javascript node.js console

I am trying to read a file using node.js fs.readFile() method. I notice the output get affecting if i resize the console, i need an explanation of what is happening.

code

let fs = require( 'fs' )

let data = fs.readFile( 'test.txt', 'utf8', ( err, data) => console.log( data ) );

test.txt

1.  what is your name (a) samuel (b) douye (c) ben (d) tari
2.  what is my name (a) samuel (b) douye (c) ben (d) tari

output with console window(80 × 24)

2.      what is my name (a) samuel (b) douye (c) ben (d) tariri

output with console window(63 × 24)

1.      what is your name (a) samuel (b) douye (c) ben (d) tari
2.      what is my name (a) samuel (b) douye (c) ben (d) tari

Am using

mintty 2.0.3(×86_64-pc-msys)

node v9.5.0

0 个答案:

没有答案