Book Image

Learning Yeoman

By : Jonathan Spratley
Book Image

Learning Yeoman

By: Jonathan Spratley

Overview of this book

Table of Contents (17 chapters)
Learning Yeoman
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Modern Workflows for Modern Webapps
Index

The new Node.js module project


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.

Installing the generator-node

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.

Scaffolding a Node.js module project

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...