Skip to Content
Node.js 프로젝트
book

Node.js 프로젝트

by Jonathan Wexler
July 2025
Beginner to intermediate
372 pages
5h 25m
Korean
O'Reilly Media, Inc.
Content preview from Node.js 프로젝트

2장. 실제 적용

이 작품은 AI를 사용하여 번역되었습니다. 여러분의 피드백과 의견을 환영합니다: translation-feedback@oreilly.com

이 장에서는 을 다룹니다:

  • Node 앱 시작하기

  • 명령줄에서 사용자 입력 읽기

  • CSV에 데이터 쓰기

프로그래밍을 처음 접하는 사람이든 숙련된 엔지니어든 이 장은 Node를 시작하기 위해 열었을 것입니다. 많은 Node 프로젝트는 수천 줄의 코드로 구성되어 있지만, 가장 유용하고 실용적인 애플리케이션 중 일부는 단 몇 줄로 작성할 수 있습니다. 압도당하는 부분은 건너뛰고 실용적인 애플리케이션으로 넘어가 보겠습니다.

이 장에서는 Node가 즉시 사용할 수 있는 기능을 한눈에 살펴볼 수 있습니다. 누구나의 컴퓨터에서 실행할 수 있고 실제 사람들에게 시간과 비용을 절약할 수 있는 간단한 프로그램을 구축하는 방법을 배우게 됩니다. 이 장이 끝날 때쯤이면 컴퓨터에 Node를 잠그고 로드하여 거의 모든 것을 빌드할 수 있는 개발 환경을 갖추게 될 것입니다.

귀하의 프롬프트

한 여행사에서 롤로덱스 (실물 정보 카드)를 디지털 형식으로 변환해 달라는 의뢰가 들어왔습니다. 방금 새 컴퓨터를 몇 대 구입했고 데이터 가져오기를 시작하고 싶어합니다. 웹사이트나 모바일 애플리케이션과 같은 멋진 것은 필요 없고, 데이터의 표 형식 또는 쉼표로 구분된 값(CSV)을 만들기 위한 컴퓨터 프롬프트만 있으면 됩니다.

계획 세우기

다행히도 이제 막 Node 애플리케이션을 구축하기 시작했으므로 Node의 기본 라이브러리를 바로 사용할 수 있는 좋은 기회라고 생각합니다. 이 비즈니스에서는 .csv 파일에 기록할 수 있는 데이터만 수동으로 입력하려고 합니다. 따라서 프로젝트의 요구 사항을 다이어그램화하기 시작하면 그림 2-1과 같은 결과가 나타납니다. 이 다이어그램에는 다음 단계가 자세히 나와 있습니다:

  1. 물리적 정보 카드는 사용자가 수집합니다.

  2. 명령줄을 열고 node index 을 실행하여 애플리케이션을 시작합니다.

  3. 명령줄 프롬프트에 이름, 전화번호, 이메일 주소를 입력합니다.

  4. 각 항목이 입력되면 연락처 데이터가 애플리케이션을 통해 컴퓨터의 CSV 파일에 저장됩니다.

각 연락처의 카드에 이름, 전화번호, 이메일 주소가 기재되어 있습니다. 사용자가 각 연락처 카드에 대해 이 세 가지 데이터 값을 수동으로 입력할 수 있도록 간단한 Node 명령줄 애플리케이션을 구축하기로 결정합니다.

작업을 마치면 사용자는 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Node.js: Novice to Ninja

Node.js: Novice to Ninja

Craig Buckler
NGINX 쿡북(3판)

NGINX 쿡북(3판)

데릭 디용기
Docker: Up & Running, 제3판

Docker: Up & Running, 제3판

Sean P. Kane, Karl Matthias

Publisher Resources

ISBN: 9798341665675