node동기3

Home   »   node동기3

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;

            }

            console.log('3번', data.toString());

            console.log('끝');

        })

        

    })

})

​

​

Leave a Reply

Your email address will not be published. Required fields are marked *