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

2013-09-04 08:44:35 +08:00
 Livid
8351 次点击
所在节点    Node.js
17 条回复
ijse
2013-09-04 09:00:38 +08:00
最近也在想这个,grunt-init-node 可以生成一个基本的框架

另外,有关网站的,在网上有找到这个: https://github.com/jifeng/node-app 有些可借鉴学习的。
ywencn
2013-09-04 09:13:17 +08:00
我一直是按着rails的路子来的。。。
Numbcoder
2013-09-04 09:21:51 +08:00
如果是 web 项目的话,可以参考这个 https://github.com/madhums/node-express-mongoose-demo
其他的项目,参考 npm 包的格式,`npm init`
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
2013-09-04 09:51:03 +08:00
git@github.com:kellyschurz/nodejsTemplate.git

4L竟然忽略了首空格...
xinyu198736
2013-09-04 12:33:17 +08:00
推荐个自己的项目:https://github.com/xinyu198736/htmljs
只看看代码就好了,没有配置文件,这个项目clone下来跑不起来。
whuhacker
2013-09-04 13:38:07 +08:00
spark
2013-09-04 13:44:55 +08:00
试试 Yeoman
lidashuang
2013-09-04 13:59:09 +08:00
summic
2013-09-04 13:59:56 +08:00
@whuhacker nodeclub 的 eventproxy 看得我蛋疼啊
robertlyc
2013-09-04 14:02:51 +08:00
一般按照rails的方式来
sxd
2013-09-04 14:48:29 +08:00
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
2013-09-04 21:49:02 +08:00
推荐 mean.io和yeoman
ijse
2013-09-05 09:38:27 +08:00
@sxd 这个貌似好久没更新了,看到所用到的一些包版本都很低。。
sxd
2013-09-05 14:24:06 +08:00
@ijse 推荐是因为他是 jetbrain 的默认模板 应该有其优点才会被默认吧.
agassi_yzh
2013-09-05 14:27:12 +08:00
yeoman生成一个

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/81231

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX