Skip to content

Latest commit

 

History

History
108 lines (93 loc) · 3.55 KB

File metadata and controls

108 lines (93 loc) · 3.55 KB

n4gwiki Developer Style Guide

Coding Convention

  • Felix's Node.js Style을 따릅니다.

  • 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자로 제한합니다.

Achitechture

  • Foundation
  • Modeling
    • TBD

Documentation & Comments

Test

Development Environment

  • 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
      

Loggin Level

winstone 기준

 silly: 0,
 verbose: 1,
 info: 2,
 warn: 3,
 debug: 4,
 error: 5