V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Livid
V2EX  ›  Node.js

关于 Node.js 项目的代码组织方式,推荐一个值得学习的项目吧?

  •  
  •   Livid · 2013-09-04 08:44:35 +08:00 · 8338 次点击
    这是一个创建于 3879 天前的主题,其中的信息可能已经有所发展或是发生改变。
    17 条回复    1970-01-01 08:00:00 +08:00
    ijse
        1
    ijse  
       2013-09-04 09:00:38 +08:00   ❤️ 1
    最近也在想这个,grunt-init-node 可以生成一个基本的框架

    另外,有关网站的,在网上有找到这个: https://github.com/jifeng/node-app 有些可借鉴学习的。
    ywencn
        2
    ywencn  
       2013-09-04 09:13:17 +08:00
    我一直是按着rails的路子来的。。。
    Numbcoder
        3
    Numbcoder  
       2013-09-04 09:21:51 +08:00   ❤️ 4
    如果是 web 项目的话,可以参考这个 https://github.com/madhums/node-express-mongoose-demo
    其他的项目,参考 npm 包的格式,`npm init`
    zhttty
        4
    zhttty  
       2013-09-04 09:25:55 +08:00
    |--package.json
    |--app.js
    |--README.md
    |--config.js
    |--path
    |---bin
    |--*.sh
    |--*.bin
    |--*.js
    |--...
    |---lib
    |---view
    |---main
    |---css
    |---js
    |---doc
    |---man
    |---others
    |---licenses
    |---test
    |---demo
    |---debug
    zhttty
        5
    zhttty  
       2013-09-04 09:51:03 +08:00
    [email protected]:kellyschurz/nodejsTemplate.git

    4L竟然忽略了首空格...
    xinyu198736
        6
    xinyu198736  
       2013-09-04 12:33:17 +08:00
    推荐个自己的项目:https://github.com/xinyu198736/htmljs
    只看看代码就好了,没有配置文件,这个项目clone下来跑不起来。
    whuhacker
        7
    whuhacker  
       2013-09-04 13:38:07 +08:00
    spark
        8
    spark  
       2013-09-04 13:44:55 +08:00
    试试 Yeoman
    lidashuang
        9
    lidashuang  
       2013-09-04 13:59:09 +08:00
    summic
        10
    summic  
       2013-09-04 13:59:56 +08:00
    @whuhacker nodeclub 的 eventproxy 看得我蛋疼啊
    robertlyc
        11
    robertlyc  
       2013-09-04 14:02:51 +08:00
    一般按照rails的方式来
    sxd
        12
    sxd  
       2013-09-04 14:48:29 +08:00
    willerce
        13
    willerce  
       2013-09-04 20:57:04 +08:00
    如果是WEB项目,可以参考 http://sailsjs.org/ 这个框架。

    Sails.js make it easy to build custom, enterprise-grade Node.js apps. It is designed to mimic the MVC pattern of frameworks like Ruby on Rails,
    hfcorriez
        14
    hfcorriez  
       2013-09-04 21:49:02 +08:00
    推荐 mean.io和yeoman
    ijse
        15
    ijse  
       2013-09-05 09:38:27 +08:00
    @sxd 这个貌似好久没更新了,看到所用到的一些包版本都很低。。
    sxd
        16
    sxd  
       2013-09-05 14:24:06 +08:00
    @ijse 推荐是因为他是 jetbrain 的默认模板 应该有其优点才会被默认吧.
    agassi_yzh
        17
    agassi_yzh  
       2013-09-05 14:27:12 +08:00
    yeoman生成一个
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5266 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 78ms · UTC 07:50 · PVG 15:50 · LAX 00:50 · JFK 03:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.