웹 개발은 Front-end 와 Back-end로 나뉜다. 간단히 말하면 프론트앤드는 웹페이지 쪽의 사용자가 볼 수 있는 부분이고, 백앤드는 서버쪽을 차지하고 있다. 원래 JavaScript는 프론트앤드에서 사용이 주로 됐지만, 2009년 Node.js라는 framework의 등장으로 자바스크립트로 서버단 기술까지 제어할 수 있게 되었다.
Node.js(노드js) 는 JavaScript 엔진 V8 위에서 동작하는 이벤트 처리 I/O framework이다. 서버 환경을 포함한 프론트앤드 백앤드 모두를 JavaScript라는 같은 언어로 관리할 수 있게 되었다. 기존의 Front-end 개발자들도 다른 언어를 배울 필요 없이 쉽게 서버단 처리를 할 수 있게 만들어줬다.
1. 다운로드 사이트 방문
2. 최신 버전(node-v6.4.0-x64.msi) 다운받아서 실행
Node Package Modules의 약자다. 즉, Node.js에서 사용가능한 모듈들을 패키지화시켜 모아놓은 것이다.
예를 들어서 Grunt 라는 툴을 설치하기 위해서는 npm을 통해서 설치하고 관리 할 수 있다.
이 경우 위에 언급한 것처럼 Node.js 를 설치후 Command 창에 npm을 입력해보면 npm 명령어의 문법을 알려준다.
아래와 같이 보여지면 사용 가능한 것으로 보면 된다.
C:\Users\Jason>npm
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
help, help-search, i, init, install, install-test, it, link,
list, ln, logout, ls, outdated, owner, pack, ping, prefix,
prune, publish, rb, rebuild, repo, restart, root, run,
run-script, s, se, search, set, shrinkwrap, star, stars,
start, stop, t, tag, team, test, tst, un, uninstall,
unpublish, unstar, up, update, v, version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\Jason\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@3.10.3 C:\Program Files\nodejs\node_modules\npm
C:\Users\Jason>