Page 124 - Nodejs 교과서 개정2판
P. 124

ࢲ٘۽ ౵ੌਸ ੍যࠇפ׮

          콘솔

           $	node	writeFile
           글이	입력됩니다.




         ౵ੌ੉ ੜ ٜ݅য઎Ҋ  Ӓ റ ౵ੌ ੍ӝب ࢿҕ೮णפ׮  ੉ઁ ੗߄झ௼݀౟۽ب ౵ੌ दझమী рױ൤ ੽Ӕೡ
         ࣻ ੓ѱ غ঻णפ׮  GT ݽٕ੄ ׮ܲ ݫࢲٜ٘ਸ ߓ਋ӝ ੹ী ݻ о૑ ѐ֛ਸ ޷ܻ ࢓ಝࠁѷणפ׮


          
          
               زӝ ݫࢲ٘৬ ࠺زӝ ݫࢲ٘

         setTimeout э਷ ఋ੉ݠ৬ process.nextTick ৻ীب  ֢٘ח ؀ࠗ࠙੄ ݫࢲ٘ܳ ࠺زӝ ߑधਵ۽ ୊ܻ೤פ׮

         ೞ૑݅ ݻݻ ݫࢲ٘ח زӝ ߑधਵ۽ب ࢎਊೡ ࣻ ੓णפ׮  ౠ൤ GT ݽٕ੉ Ӓ۞ೠ ݫࢲ٘ܳ ݆੉ о૑Ҋ ੓णפ
         ׮  যڃ ݫࢲ٘о زӝ ژח ࠺زӝ ߑधਵ۽ ز੘ೞח૑৬ ঱ઁ যڃ ݫࢲ٘ܳ ࢎਊ೧ঠ ೞח૑ܳ ঌইࠁѷण

         פ׮

         ౵ੌ ೞաܳ ৈ۞ ߣ ੍যࠁѷणפ׮

          readme2.txt

           저를	여러	번	읽어보세요.




          async.js
           const	fs	=	require('fs');


           console.log('시작');
           fs.readFile('./readme2.txt',	(err,	data)	=>	{
           		if	(err)	{
           				throw	err;
           		}
           		console.log('1번',	data.toString());
           });
           fs.readFile('./readme2.txt',	(err,	data)	=>	{
           		if	(err)	{
           				throw	err;
           		}
           		console.log('2번',	data.toString());
           });
           fs.readFile('./readme2.txt',	(err,	data)	=>	{
           		if	(err)	{
           				throw	err;
           		}
   119   120   121   122   123   124   125   126   127   128   129