We can easily scaffold node modules using the Yeoman Node.js generator; all projects include nodeunit unit tests. The generator is based on the grunt-init-node
module, authored by the magnificent GruntJS team.
To install the Node.js generator, execute the following command:
$ npm install -g generator-node
The preceding command will install the Node.js generator globally on the system. Now, the yo node
command can be invoked anywhere.
First create a new directory and make that the current working directory. To quickly scaffold a new Node.js module project, execute the following command:
$ yo node
The preceding command will prompt you with a series of questions about the plugin. After answering the questions, the scaffold process will take place.
The output from the preceding command should look similar to following screenshot:
You can answer the questions as if you are the plugin author. For demonstration...