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