🏫 Framework/🧩 Node.js Node.js에서 파일에 데이터를 입력하는 방법 (How to append to a file in Node) 728x90 안녕하세요. 이사작전.com의 개발자 말랑고양입니다. 오늘은 Node.js에서 파일에 데이터를 입력하는 방법을 공유하려합니다. 혹시 파일에 파일을 붙이고 싶은 경우, Ejs 템플릿을 사용하면 됩니다. 순수 Node.js에서는 딱히 적절한 함수가 없네요.Asynchronously12345const fs = require('fs');fs.appendFile('test.txt', 'data to append', function (err) { if (err) throw err; console.log('Saved!');});Colored by Color ScriptercsSynchronously12const fs = require('fs');fs.appendFileSync('test.txt', 'data to append');cs추가로 궁금한 점이나 질문사항이 있다면 댓글에 남겨주세요.확인 후 답변드리겠습니다. 감사합니다.reference : https://stackoverflow.com/questions/3459476/how-to-append-to-a-file-in-node 반응형 공유하기 게시글 관리 팀드모네 IT Blog 저작자표시 비영리 동일조건 '🏫 Framework > 🧩 Node.js' 카테고리의 다른 글 [Solved] Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI (0) 2020.12.29 Contents 당신이 좋아할만한 콘텐츠 [Solved] Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI 2020.12.29 댓글 0 + 이전 댓글 더보기