-
Felix's Node.js Style을 따릅니다.
- http://nodeguide.atelier.weaveus.com/style.html
- 단, 클로저 중첩Nested하기는 우선 예외로 하고 작성자가 가독성을 고려해 편한데로 작성
-
callback 함수의 첫 번째 argument는 err
-
callback을 arguement로 넘여야 한다면, 맨 마지막에 표시
listen.on('event', function(err, data, callback)){ ... -
private method는 "_"로 시작
var _go = function(){...} -
CoffeeScript의 경우 아래 Style을 따릅니다.
-
js file로 클래스를 구분
예) GitFS Class는 => project_home/lib/gitfs.js -
커밋 로그는 아래의 Style을 따릅니다.
- 첫줄은 50자 정도의 요약
- 부연설명이 더 필요한 경우,
- 한 줄을 띄고
- 그 다음에 본문이 옵니다.
- 한 줄의 너비는 72자로 제한합니다.
- Foundation
- Language: Javascript with underscore.js
- Platform: node.js
- Web Framework: express, (한글)
- Template Engine: jade
- UI toolkit: Bootstrap
- Logging: winston
- 커스텀 로거를 만들어야 하나?
- 로깅은 어디에 남기나? 파일?
- 예외에 대한 로깅은 따로?
- Callback Indentation처리: step
- 추가 고려 대상
- Step 대체: Async.js
- Transcompile language for javascript: CoffeeScript
- CSS Language: less
- MVVM Framework: ember.js
- Modeling
- TBD
- Api Doc Generation: JSDOC
- Comments Sample: https://github.com/visionmedia/mocha/blob/master/lib/mocha.js
- 기타 가이드 문서는 Markdown Plain Text로 작성이 기본
- 추후 n4wiki에서 기능 지원시 Markdown Extra 사용 (http://michelf.com/projects/php-markdown/extra/)
- Write and Run
- write: ./test 디렉터리에 작성
- run: mocha -u tdd -R spec
- BASE: Mocha
- Utils
- CI Server
- Travis CI (if we can use...)
- Sameple Project: http://travis-ci.org/doortts/node-test-samples
- Travis CI (if we can use...)
- Test Server
- TBD
- Editor: Sublime Text2(추천), vim, etc.. :)
- Debugging: Google Chrome + node-inspector
- Source Code Encoding Type: UTF8
- Folder 구성
-
express에서 생성한 폴더 기본
-
추가 폴더 (n4wiki가 project_home일 때)
n4wiki ./doc ./lib <- 직접 작성한 라이브러리 ./lib_ext <- 직접 가져온 외부 모듈 ./node_module ./test
-
winstone 기준
silly: 0,
verbose: 1,
info: 2,
warn: 3,
debug: 4,
error: 5