Is there a way to automatically build the package.json file for Node.js projects

后端 未结 10 921
梦毁少年i
梦毁少年i 2020-11-29 14:30

Is package.json supposed to be manually edited? Couldn\'t a program like npm just look through the files, see the \"require\" statements, and then use that to put the necess

10条回答
  •  情话喂你
    2020-11-29 15:01

    You can now use Yeoman - Modern Web App Scaffolding Tool on node terminal using 3 easy steps.

    First, you'll need to install yo and other required tools:

    $ npm install -g yo bower grunt-cli gulp
    

    To scaffold a web application, install the generator-webapp generator:

    $ npm install -g generator-webapp  // create scaffolding 
    

    Run yo and... you are all done:

    $ yo webapp  // create scaffolding 
    

    Yeoman can write boilerplate code for your entire web application or Controllers and Models. It can fire up a live-preview web server for edits and compile; not just that you can also run your unit tests, minimize and concatenate your code, optimize images, and more...

    Yeoman (yo) - scaffolding tool that offers an ecosystem of framework-specific scaffolds, called generators, that can be used to perform some of the tedious tasks mentioned earlier.

    Grunt / gulp - used to build, preview, and test your project.

    Bower - is used for dependency management, so that you no longer have to manually download your front-end libraries.

提交回复
热议问题