Node & Express as Workflow Tools

21
Building Custom Development Tools With Node.js Commander.js Topher Bullock Software Engineer - Pivotal @topherbullock .. and other tools to help along the way.

description

Node & Express as Workflow Tools “Enterprise” and “Node.js” are generally two terms which are rarely seen together, but developing on an (what are considered) “enterprise level” stack doesn’t mean you can’t sneak some Node.js into your workflow. This talk will cover using Node.js, Express, Grunt/Gulp, Commander to build custom workflow tools, mock APIs, and test suites to allow you to maintain sanity while working with more traditional environments. We will cover a simple use case for using Node and Express to smooth Front-end development workflow, and how to package your custom tool as an NPM module for others to install. Presented live at FITC's Spotlight: MEAN Stacks event held on March 28th, 2014 More info at FITC.ca

Transcript of Node & Express as Workflow Tools

Page 1: Node & Express as Workflow Tools

Building Custom Development Tools With Node.js

Commander.js

Topher BullockSoftware Engineer - Pivotal

@topherbullock

.. and other tools to help along the way.

Page 2: Node & Express as Workflow Tools

About● Topher Bullock● Software Engineer - Pivotal;

working on Cloud Foundry Services.

● Full-stack JavaScript

@topherbullock pivotal-topher-bullock

Page 3: Node & Express as Workflow Tools

● Faster / Easier Development● Rapid Prototyping● Task Automation● Test Driven Development● Build Systems● Debugging

Page 4: Node & Express as Workflow Tools

Case Study : Tomcat Woes

● Large scale JS MVC app ● leveraging APIs served by Spring*● eventually need to deploy everything

together in one big happy .war file● working on everything together meant being

tied to an IDE to deploy web app changes to Tomcat ~> slow development.

* Disclaimer : Spring is totally cool and is a solid framework for Java projects. They are making strides for improving workflows; e.g Spring Boot

Page 5: Node & Express as Workflow Tools

Observability

Browser

Tomcat

File System(Workspace)

IDE

Page 6: Node & Express as Workflow Tools

Using a traditional stack in production doesn’t mean you can’t

use Node.js for development.

Enterprises will resist deploying Node.js in favor of other

technologies.

Page 7: Node & Express as Workflow Tools
Page 8: Node & Express as Workflow Tools

Commander.js

Page 9: Node & Express as Workflow Tools

JIFASNIFJavaScript is Fun And

So Node.js is Fun“ ”

Page 11: Node & Express as Workflow Tools

● CLI tool written in Node.js● Task Automation / Build Tool (mvn-ish)● Simple Config / Pre Built tasks

Grunt

Page 12: Node & Express as Workflow Tools

Extending Grunt● Roll your own Grunt tasks● Programmatically run tasks and listen for

events

Page 13: Node & Express as Workflow Tools
Page 14: Node & Express as Workflow Tools

● The E in MEAN :3● Great for quickly spinning up a mock API

server● Good plumbing to serve front-end app for

development

Express

Page 16: Node & Express as Workflow Tools

Awesome colored output for console.

Progress bars, because they’re awesome.

Useful CLI Tools

General purpose CLI lib

Useful command prompt tools; works well alongside CommanderJSCommand.prompt() removed in 2.0.0

Page 17: Node & Express as Workflow Tools
Page 18: Node & Express as Workflow Tools

Contrary to the belief of many, ‘npm’ is not in fact an abbreviation for ‘Node Package Manager.’ It is a recursive bacronymic

abbreviation for ‘npm is not an acronym.’ (If it was ‘ninaa’, then it would be an acronym, and

thus incorrectly named.)

“”

Page 19: Node & Express as Workflow Tools

● Not "Node Package Manager.".. but it is the Package Manager for Node. -_-

● Great for distributing your tools● $ npm link is your friend

NPM

Page 20: Node & Express as Workflow Tools