How to organize large Node.js projects

后端 未结 6 925
春和景丽
春和景丽 2021-01-29 20:22

What are some good ways to organize large Node.js projects?

For example, an app making use of both express.js and socket.io? This would include both application logical

6条回答
  •  情歌与酒
    2021-01-29 20:47

    His Articles are no longer online, but Eric Satterwhite's node series recommended a structure as listed below.

    # Project 
    . 
    |-- packages/
    |   |-- project-core
    |   |   |-- lib/
    |   |   |-- commands/
    |   |   |-- startup/
    |   |   |-- conf/
    |   |   |-- test/
    |   |   |-- package.json
    |   |   |-- README.md
    |   |   |-- events.js
    |   |   |-- .npmignore
    |   |   `-- index.js
    |-- package.json
    `-- index.js
    

    With the packages/ folder turning into your source for modularity.

提交回复
热议问题