파일 읽을 때: readFile
파일 저장: writeFile
const fs = require('fs'); // 파일 시스템 모듈을 불러옵니다
const dns = require('dns'); // DNS 모듈을 불러옵니다
// 이제 fs.readFile 메서드 등을 사용할 수 있습니다!
해당 프로그래밍 언어에서 공식적으로 제공하는 빌트인 모듈이 아닌 모든 외부모듈을 일컬음
ex) underscore
설치 후 사용 방법
npm install underscore
const _ = require('underscore');
로컬에 존재하는 파일을 읽어옴
비동기적으로 파일 전체 내용을 읽으며 이 메서드를 실행할 시 전달인자 3개를 받음
fs.readFile(path[,options],callback)
// fs.readFile('/etc/passwd', 'utf8', (error,data)) => {
// if(err) return callback(err, null);
// else return callback(null,err);
// })
//};