소소한 이야기

소소한 이야기

  • 분류 전체보기 (82)
    • 개발 (3)
      • PHP (11)
      • GO (2)
      • Python (4)
      • Node (6)
      • jQuery (4)
      • Vue (2)
      • CSS (1)
      • iOS (11)
      • Android (14)
      • React Native (2)
      • Flutter (2)
      • R (2)
      • AWS (12)
      • Server (1)
      • Terraform (0)
      • Git (1)
    • 개발 - NoCode (3)
  • 홈
  • 태그
  • 방명록
RSS 피드
로그인
로그아웃 글쓰기 관리

소소한 이야기

컨텐츠 검색

태그

어플 Android Studio amazon bedrock mustadd 서비스 airtable 게임스샷 nestjs 안드로이드 기록 swift 머스태드 맛집 php Android wkwebview IOS laravel 게임 어비스리움

최근글

댓글

공지사항

아카이브

fileReadSync(1)

  • NestJS, 파일 읽기

    Node에서 파일 읽기는 fs를 사용합니다. https://nodejs.org/api/fs.html File system | Node.js v16.4.0 Documentation nodejs.org 보통은 readFile을 이용해서 읽고 처리를 (저 같은 경우는) 많이 하지만, readFile 이후에 해당 파일을 사용하기 쉽지 않습니다. 왜냐하면 비동기로 읽기 때문입니다. (Asynchronously reads the entire contents of a file.) fs.readFile('src/quiz/quiz.txt', 'utf8', function (err, data) { if (err) throw err; console.log(data); }); 동기로 처리하기 위해서는 readFileSync를..

    2021.06.24
이전
1
다음
티스토리
© 2018 TISTORY. All rights reserved.

티스토리툴바