[node.js] 글목록 출력하기
👌 글목록 출력하기
파일의 디렉토리를 읽어와 글목록을 출력하는 방법을 알아본다
✔ 글 목록을 읽어오는 방법
fs.readdir()
을 사용하면 파일의 목록을 읽어올 수 있다
fs.readdir('./data', function(error, filelist){
let list = '';
let i = 0;
while(i < filelist.length){
list = list + `...${filelist[i]}...`;
i = i + 1;
}
let template = `...${list}...`;
})
👍 참고 사이트
Author And Source
이 문제에 관하여([node.js] 글목록 출력하기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@woohyun_park/node.js-글목록-출력하기저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)