Node.js란
Node.js는 오픈 소스 서버 환경입니다.
Node.js를 사용하면 서버에서 JavaScript를 실행할 수 있습니다.
예제를 통한 학습
우리의 "Show Node.js"도구를 사용하면 Node.js를 쉽게 익힐 수 있으며 코드와 결과가 모두 표시됩니다.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World!');
}).listen(8080);
위 예제를 실행하면 화면에 Hello World!라는 글자가 출력되게 됩니다.
명령 줄 인터페이스에서 실행되는 예제
이 자습서에서는 명령 줄 인터페이스에 결과를 표시하여 더 잘 설명 할 수있는 몇 가지 예제가 있습니다.
이 경우 "Show Node.js"도구는 결과를 오른쪽에 검은 색 화면으로 표시합니다.
console.log('This example is different!');
console.log('The result is displayed in the Command Line Interface');
Node.js에는 추가 설치없이 사용할 수있는 내장 모듈 세트가 있습니다.
다음은 Node.js 버전 6.10.3의 내장 모듈 목록입니다.
| Module | Description |
|---|---|
| assert | Provides a set of assertion tests |
| buffer | To handle binary data |
| child_process | To run a child process |
| cluster | To split a single Node process into multiple processes |
| crypto | To handle OpenSSL cryptographic functions |
| dgram | Provides implementation of UDP datagram sockets |
| dns | To do DNS lookups and name resolution functions |
| domain | Deprecated. To handle unhandled errors |
| events | To handle events |
| fs | To handle the file system |
| http | To make Node.js act as an HTTP server |
| https | To make Node.js act as an HTTPS server. |
| net | To create servers and clients |
| os | Provides information about the operation system |
| path | To handle file paths |
| punycode | Deprecated. A character encoding scheme |
| querystring | To handle URL query strings |
| readline | To handle readable streams one line at the time |
| stream | To handle streaming data |
| string_decoder | To decode buffer objects into strings |
| timers | To execute a function after a given number of milliseconds |
| tls | To implement TLS and SSL protocols |
| tty | Provides classes used by a text terminal |
| url | To parse URL strings |
| util | To access utility functions |
| v8 | To access information about V8 (the JavaScript engine) |
| vm | To compile JavaScript code in a virtual machine |
| zlib | To compress or decompress files |
댓글 1개
terrorboy
6년 전
node node node ㅎㅎㅎㅎ!
감사합니다
감사합니다
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5396 | 기타 |
슈퍼스타맨
|
3개월 전 | 334 | |
| 5395 | PHP |
untitled
|
5개월 전 | 807 | |
| 5394 | MySQL |
선택과집중
|
5개월 전 | 581 | |
| 5393 | 웹서버 |
techstar
|
7개월 전 | 848 | |
| 5392 |
|
1년 전 | 1205 | ||
| 5391 | 9개월 전 | 1108 | |||
| 5390 | 9개월 전 | 893 | |||
| 5389 | 8개월 전 | 863 | |||
| 5388 | 8개월 전 | 964 | |||
| 5387 | 7개월 전 | 795 | |||
| 5386 | JavaScript |
nekoieye
|
7개월 전 | 958 | |
| 5385 | 웹서버 | 7개월 전 | 978 | ||
| 5384 | JavaScript |
|
8개월 전 | 800 | |
| 5383 | 기타 | 9개월 전 | 1115 | ||
| 5382 | 기타 |
|
9개월 전 | 566 | |
| 5381 | JavaScript | 9개월 전 | 895 | ||
| 5380 | 기타 |
|
9개월 전 | 676 | |
| 5379 | JavaScript | 10개월 전 | 678 | ||
| 5378 | 10개월 전 | 1188 | |||
| 5377 | 기타 |
|
10개월 전 | 751 | |
| 5376 | jQuery |
|
10개월 전 | 560 | |
| 5375 | jQuery |
techstar
|
10개월 전 | 717 | |
| 5374 | 기타 |
|
10개월 전 | 765 | |
| 5373 | MySQL |
|
11개월 전 | 799 | |
| 5372 | 기타 |
|
11개월 전 | 1000 | |
| 5371 | JavaScript |
|
11개월 전 | 712 | |
| 5370 | JavaScript |
|
11개월 전 | 717 | |
| 5369 | PHP |
|
11개월 전 | 1228 | |
| 5368 | PHP | 11개월 전 | 1396 | ||
| 5367 | 기타 |
nekoieye
|
1년 전 | 1270 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기