Homepage - Node Tuts - Node.js Free screencast tutorials. OKJSP: node.js 지원하는 VJET 플러그인. Installing Node.js and NPM on Ubuntu 11.04. In my last article I installed Node on Ubuntu 10.10. Nothing really has changed for Ubuntu 11.04 but I want to have a separate article since a lot of people hit my installing Node articles. Also, keep in mind you can customize your Node installation using these gists – just make sure to read all the comments on the bottom of that page for any changes as I know at least one path was wrong in one of the examples. Assuming a clean install of Ubuntu 11.04 with all the current updates, here are the commands you need to install the latest version of Node on Ubuntu 11.04: Something to keep in mind if you want to run a specific version of Node you can use Nave. The code above right now installed Node v0.5.0-pre and NPM v1.0.10 and it is not meant for a production release.
Express - API 가이드 문서. Express Node.js의 고성능, 고품격 웹 애플리케이션 개발 설치 $ npm install express 또는 전역 옵션을 사용하여 express(1)를 설치합니다: $ npm install -g express 역자주 - npm(node package manager)은 Node.JS에서 사용할 모듈을 설치하는 쉘 명령어입니다. 빠른 시작 Express를 시작하는 가장 쉬운 방법은 실행 가능한 express(1) 을 이용하여 애플리케이션 생성하는 것입니다: 애플리케이션 만들기: $ npm install -g express $ express /tmp/foo && cd /tmp/foo 종속성 모듈 설치: $ npm install -d 서버 시작: $ node app.js 역자주 - npm에 -g 옵션을 사용하여 전역에서 사용될 모듈로 설치하고 express 쉘 명령을 이용하는 것을 권장합니다. 서버 만들기 express.HTTPServer의 인스턴스를 생성하려면 createServer() 메서드를 호출합니다. Var app = require('express').createServer(); app.get('/', function(req, res){ res.send('hello world'); }); app.listen(3000); HTTPS 서버 만들기 express.HTTPSServer의 초기화는 위의 일반적인 서버의 초기화와 거의 비슷하지만, 허용할 key와 cert 같은 옵션을 포함하는 개체를 전달하는 것이 다릅니다. 환경 설정 Express는 production과 development 모드를 지원합니다. 다음 예제에서는 development 모드에서만 오류 발생시의 스택을 추적하기 위한 설정으로 dumpExceptions옵션을 활성화하고 두 모드의 일반적인 설정으로 methodOverride와 bodyParser를 이용하고 있습니다.
유사한 방법으로 사용자가 임의로 설정한 문자열을 사용하여 여러가지 환경을 만들수 있습니다: $ NODE_ENV=production node app.js 세팅.
Node v0.2.6 한글 번역. v0.2.6 한글 번역 Synopsis 예제 : "Hello World"를 응답하는 Node 웹서버 이 서버를 구동하기 위해서 위 코드를 example.js에 쓰고 node 프로그램을 통해 실행시켜보자. > node example.js Server running at 이 문서에 있는 모든 예제들은 이와 유사하게 실행될 것이다. Standard Modules Node와 함께 컴파일되는 수많은 모듈들의 대부분이 아래 문서화 되어 있다. 예제: var sys = require('sys'); Node는 다른 모듈들과의 확장도 가능하다.
Buffers 순수 자바스크립트는 유니코드와 비슷하지만, 이진데이타에는 좋지 않다. Raw data는 Buffer 클래스의 인스턴스에 저장이 된다. Buffer 객체는 전역이다. Buffer 에서 자바스크립트의 String 객체로 변환할 때는 explicit 인코딩 메소드가 필요하다. Ascii - 7 bit 아스키 데이타에서만 사용된다. New Buffer(size) - size 옥텟만큼의 새로운 Buffer를 할당한다. new Buffer(array) - 옥텟들로 이루어진 하나의 배열만큼 새로운 buffer를 할당한다. new Buffer(str, encoding='utf8') - 주어진 str을 가지는 새로운 buffer를 할당한다. buffer.write(string, offset=0, encoding='utf8') - "string"을 주어진 encdoing을 사용하여 buffer에 쓴다. 예제 : utf8 스트링을 Buffer에 쓰고 프린트하기 buf = new Buffer(256); len = buf.write('\u00bd + \u00bc = \u00be', 0); console.log(len + " bytes: " + buf.toString('utf8', 0, len)); // 12 bytes: ½ + ¼ = ¾ 위의 buffer.write()를 보자.
예제 EventEmitter Streams Global Objects. Octoberskyjs/home.