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

ߊࢤೡ ࣻ ੓णפ׮

         ٮۄࢲ ઺ਃೠ ࠺޻ߣഐח ׮਺җ э੉ process.env੄ ࣘࢿਵ۽ ؀୓೤פ׮




           const	secretId	=	process.env.SECRET_ID;
           const	secretCode	=	process.env.SECRET_CODE;




         ੉ઁ process.envী ૒੽ SECRET_ID৬ SECRET_CODEܳ ֍ਵݶ ؾפ׮  ֍ח ߑߨ਷ ਍৔୓ઁ݃׮ ର੉о ੓ण

         פ׮  ೞ૑݅ ೠ ߣী ݽٚ ਍৔୓ઁী زੌೞѱ ֍ਸ ࣻ ੓ח ߑߨ੉ ੓णפ׮     ੺ীࢲ EPUFOWܳ ࢎਊೡ ٸ
         ߓ਒פ׮


          
                 QSPDFTT OFYU5JDL ௒ߔ

         ੉߮౟ ܖ೐о ׮ܲ ௒ߔ ೣٜࣻࠁ׮ nextTick੄ ௒ߔ ೣࣻܳ ਋ࢶਵ۽ ୊ܻೞب۾ ٟ݅פ׮

          nextTick.js

           setImmediate(()	=>	{
           		console.log('immediate');
           });
           process.nextTick(()	=>	{
           		console.log('nextTick');
           });
           setTimeout(()	=>	{
           		console.log('timeout');
           },	0);
           Promise.resolve().then(()	=>	console.log('promise'));




         process.nextTick਷ setImmediateա setTimeoutࠁ׮ ݢ੷ प೯ؾפ׮  ௏٘ ݔ ߃ী Promiseܳ ֍਷ Ѫ਷ re

         solveػ Promiseب nextTick୊ۢ ׮ܲ ௒ߔٜࠁ׮ ਋ࢶदغӝ ٸޙੑפ׮  Ӓېࢲ process.nextTickҗ Promi
         seܳ ݃੉௼۽కझ௼ NJDSPUBTL ۄҊ ٮ۽ ҳ࠙૑য ࠗܵפ׮


          콘솔
           $	node	nextTick
           nextTick
           promise
           timeout
           immediate
   91   92   93   94   95   96   97   98   99   100   101