Book Image

Learning Node.js for .NET Developers

Book Image

Learning Node.js for .NET Developers

Overview of this book

Node.js is an open source, cross-platform runtime environment that allows you to use JavaScript to develop server-side web applications. This short guide will help you develop applications using JavaScript and Node.js, leverage your existing programming skills from .NET or Java, and make the most of these other platforms through understanding the Node.js programming model. You will learn how to build web applications and APIs in Node, discover packages in the Node.js ecosystem, test and deploy your Node.js code, and more. Finally, you will discover how to integrate Node.js and .NET code.
Table of Contents (21 chapters)
Learning Node.js for .NET Developers
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Automating the build process with Gulp


It's great that TravisCI runs our tests automatically. But that's not the only task we want to automate. Of course, as JavaScript is an interpreted language, we don't have a compile step in our build process. There are other tasks we want to carry out though, for example, checking our code style, running integration tests, and gathering code coverage. We can make use of a build tool to automate these tasks and allow us to run them in a consistent manner. You may have used MSBuild for this in .NET before or Java tools such as Maven or Gradle.

There are several different build tools available for Node.js. The two most popular by far are Grunt and Gulp. Both have large communities and an extensive range of plugins for performing different operations. Grunt's model has each operation reading in files and writing back to the filesystem. Gulp uses Node.js streams to pipe processing from one operation to the next.

Grunt's model is slightly simpler and may be...