Building a Better Web
June 19–20, 2017: Training
June 20–22, 2017: Tutorials & Conference
San Jose, CA

Using npm scripts as your build tool

Elijah Manor (LeanKit)
3:35pm–4:15pm Wednesday, June 21, 2017
Frontend Tools
Location: 210 CG
Secondary topics:  Automation, Build and automation, Tools
Average rating: ****.
(4.44, 9 ratings)

Who is this presentation for?

  • JavaScript developers

Prerequisite knowledge

  • A basic understanding of npm

What you'll learn

  • Understand how to use npm script as your build tool


If you’re building a JavaScript application, chances are you’re already using npm to install your dependencies. Using an example project, Elijah Manor walks you through leveraging npm scripts to handle all of your various build needs.

Elijah begins by exploring existing npm scripts, creating custom scripts, having scripts run in series and in parallel, using various npm script lifecycle hooks, passing arguments from one script to another, piping data from one process to another, and using environment or config variables within our scripts.

Elijah then looks at several node packages that enable you to use shorthand and wildcard syntax, run scripts when either the file system changes or certain Git hooks are triggered, and provide ways to easily find and execute the scripts we want.

Elijah ends by examining several techniques to split out npm scripts to external files once they get large or complicated and addressing considerations when trying to run npm scripts across different environments (i.e., Mac, Linux, and Windows).

Photo of Elijah Manor

Elijah Manor


Elijah Manor is a senior software engineer at LeanKit, as well as a Microsoft ASP.NET MVP, ASPInsider, IE userAgent, and Pluralsight author. A Christian and a family man, Elijah blogs at and tweets about the things he learns.