JavaScript on the Command Line & PRATIK PATEL CTO TripLingo Labs

Similar documents
MOdern Java(Script) Server Stack

npm install [<name> [<name>...]] [--save --save-dev --save-optional]

Tools. SWE 432, Fall Design and Implementation of Software for the Web

Grunt Cookbook. Effective Recipes To Master Grunt. Matt Goldspink. This book is for sale at

Automate with Grunt. Extracted from: The Build Tool for JavaScript. The Pragmatic Bookshelf

Chapter 1 - Development Setup of Angular

DrupalCon Barcelona Preston So September 22, 2015

Introduction to Using NPM scripts as a Build Tool. 1. 1

Catbook Workshop: Intro to NodeJS. Monde Duinkharjav

JavaScript Web Tools with Visual Studio 2015 and ASP.NET 5. April 2015.

Advanced Express Web Application Development

J, K, L. Node.js require() method, 403 package.json, 401 streams functionality, 401 task() method, 401 use strict statement, 403

Making Sling Grunt Or How to Integrate Modern Front-End Development with Sling. Philip Hornig (Publicis Pixelpark), Michael Sunaric (Netcentric)

Web Application Development

Best Practices: Testing Node.js for Stability and Project Success. Walter Scarborough SEA 2014

NODE.JS MOCK TEST NODE.JS MOCK TEST I

Backend Development. SWE 432, Fall Web Application Development

Web Development for Dinosaurs An Introduction to Modern Web Development

Node.js. Node.js Overview. CS144: Web Applications

Java vs JavaScript. For Enterprise Web Applications. Chris Bailey IBM Runtime Technologies IBM Corporation

Defining New Node-RED Nodes

Quick Desktop Application Development Using Electron

The course is supplemented by numerous hands-on labs that help attendees reinforce their theoretical knowledge of the learned material.

MEAN February. techdt.la

Lab 6: Testing. Software Studio DataLab, CS, NTHU

Node.js By Example. Learn to use Node.js by creating a fully functional social network. Krasimir Tsonev BIRMINGHAM - MUMBAI

Bitnami Node.js for Huawei Enterprise Cloud

Introduction to Express.js. CSC309 Feb. 6, 2015 Surya Nallu

..or a tale on how to build a rocket with a meteor

node.js A quick tour (v4)

NodeJS and JavaScripteverywhere

INF5750. Introduction to JavaScript and Node.js

Angular 2 Programming

Uninstall A Apps Windows 8 Programming Using Html5 Jump Start

CS193X: Web Programming Fundamentals

Webpack 2 The last bundler you would need in Vijay Dharap, Principal Architect, Infosys

Project Avatar: Server Side JavaScript on the JVM GeeCon - May David Software Evangelist - Oracle

Practical Node.js. Building Real-World Scalable Web Apps. Apress* Azat Mardan

Microservices with Node.js

Serverless in the Java ecosystem

Need to Node: Profiling Node.js Applications

END-TO-END JAVASCRIPT WEB APPS

Salvatore Rinzivillo VISUAL ANALYTICS

IN4MATX 133: User Interface Software

What is Node.js? Tim Davis Director, The Turtle Partnership Ltd

Lab 1 - Introduction to Angular

JS Event Loop, Promises, Async Await etc. Slava Kim

Step 1: Setup a Gitlab account

Webpack. What is Webpack? APPENDIX A. n n n

Module 6 Node.js and Socket.IO

RequireJS Javascript Modules for the Browser. By Ben Keith Quoin, Inc.

Topic 16: Validation. CITS3403 Agile Web Development. Express, Angular and Node, Chapter 11

Stencil: The Time for Vanilla Web Components has Arrived

A practical introduction

Human-Computer Interaction Design

JavaScript: the language of browser interactions. Claudia Hauff TI1506: Web and Database Technology

@EvanMHerman Introduction to Workflow Automation

mismatch between what is maybe possible today and what is going on in many of today's IDEs.

Getting Started With NodeJS Feature Flags

Server-Side JavaScript auf der JVM. Peter Doschkinow Senior Java Architect

Comprehensive AngularJS Programming (5 Days)

Node.js I Getting Started

Learning Node.js For Mobile Application Development By Stefan Buttigieg;Christopher Svanefalk

webpack bundle inner structure and optimization Alexey Ivanov, Evil Martians

Index. Elad Elrom 2016 E. Elrom, Pro MEAN Stack Development, DOI /

Don't Call Us, We'll Call You:

Enterprise Web Development

Modern frontend workflows in Liferay Portal and Liferay DXP. Iván Zaera Avellon, Liferay Chema Balsas, Liferay Pier Paolo Ramon, SMC

5th April Installation Manual. Department of Computing and Networking Software Development Degree

Getting started with Tabris.js Tutorial Ebook

We are assuming you have node installed!

Intro To Javascript. Intro to Web Development

Backend Development. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Java with Node.js Powering the Next Generation of Web Applications

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

Putting A Spark in Web Apps

Chris Bailey Bailey. Emerging Web Application Architectures With Java and Node.js

Adventures with BaseX and web applications. Andy Feb 2013

WEBASSETS & DUKPY FREE YOURSELF FROM NODEJS. Alessandro amol

Mastering Grunt. Master this powerful build automation tool to streamline your application development. Daniel Li BIRMINGHAM - MUMBAI

Tuesday, January 13, Backend III: Node.js with Databases

Advance Mobile& Web Application development using Angular and Native Script

a Very Short Introduction to AngularJS

EventRacer: Finding Concurrency Errors in Event-Driven Applications. Pavol Bielik

Learn Gulp. Jonathan Birkholz. This book is for sale at This version was published on

From the Beginning: Your First Node.js Web Service

NODE.JS SERVER SIDE JAVASCRIPT. Introduc)on Node.js

Modern Web Application Development. Sam Hogarth

Express.JS. Prof. Cesare Pautasso Modularity

Lab 4: create a Facebook Messenger bot and connect it to the Watson Conversation service

Coding for OCS. Derek Endres Software Developer Research #OSIsoftUC #PIWorld 2018 OSIsoft, LLC

this presentation code is on

IDWedgeKB Serial Port and NodeJS

Developing with Blaast

Full Stack Web Framework with BBG

JavaScript Fundamentals_

Getting Started with IBM Bluemix Hands-On Workshop. Module 6a: Services

Evolution of the "Web

Homework #7 Amazon Elastic Compute Cloud Web Services

Node.js 8 the Right Way

Transcription:

JavaScript on the Command Line & Server @prpatel TripLingo Labs PRATIK@mypatelspace.com

Topics Modern JavaScript Why? Ecosystem Node Grunt

Yesterday s JavaScript

Today s JavaScript is cool

What s changed?

No Change JavaScript is essentially the same language as it was when invented 20 years ago

We ve changed JavaScript developers today understand: - Best Practices - Tooling - JavaScript Runtimes today are awesome

What hasn t changed JavaScript still has bad parts Async, event-driven programming model

How it run outside the browser?

V8 Super duper fast JavaScript runtime from Google Runs in the browser

Node.js uses V8

What about the JVM? Built into the JVM for years Rhino (current) Nashorn (next gen)

Why JavaScript on the server?

Why JS Single language for the browser & server Fast Scalable

ISOMORPHIC APPS

Isomorphic Apps Code can run either on the browser or server

Traditional Webapp

Isomorphic

Why Isomorphic? Flexibility Performance

Frameworks

Ecosystem

JavaScript Ecosystem Node NPM - node packaged modules Express - web framework Grunt - task runner / automation

Node.js JavaScript runtime based on V8

NPM Module / Package manager for node

Express Basic server-side web framework for Node

Grunt Task runner Automation build scripts

Node.js

Node.js Install from nodej.org Install using brew on Mac OSX

Node.js Command-line centric

Running Node Script $ node test3.js Hello Bangalore - test3.js: console.log('hello Bangalore')

Package.json // describes this node project, place in base folder { "name": "hello-world", "description": "hello world test app", "version": "0.0.1", "private": true, "dependencies": { "express": "3.x" } }

NPM

NPM Installed with Node.js https://www.npmjs.org/ Basic package management

Running NPM $ npm ls $ npm install lodash -g

Express

Express Very basic server-side Web Framework Lots of other options: - Sails.js - CompoundJS - Geddy

Express Implements event-loop model that is basis of Nodejs Async Event-driven Super-scalable

Express App $ cat hello-world/package.json { "name": "hello-world", "description": "hello world test app", "version": "0.0.1", "private": true, "dependencies": { "express": "3.x" } } $ npm install $ npm app Express server listening on port 3000

Quick Express Code Walkthrough

Grunt

Grunt Task based command-line build tool

What uses? Unit test running JavaScript linting Minification (both for browser and node.js) CI

package.json "devdependencies": { "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.6.3", "grunt-contrib-nodeunit": "~0.2.0", "grunt-contrib-uglify": "~0.2.2" }

Gruntfile module.exports = function (grunt) { grunt.initconfig({ jshint: { all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js', 'public/**/*.js', 'routes/*.js', 'routes/**/*.js', 'app.js'] } }); grunt.loadnpmtasks('grunt-contrib-jshint'); grunt.registertask('default', ['jshint']); };

Run Grunt $ grunt Running "jshint:all" (jshint) task Linting app.js...error [L12:C20] W033: Missing semicolon. var app = express() Warning: Task "jshint:all" failed. Use --force to continue. Aborted due to warnings.

OH NO

Fix & re-run Grunt $ grunt Running "jshint:all" (jshint) task >> 4 files lint free. Done, without errors.

Closing thoughts Node is not for every kind of app Must consider carefully where to use it Callback hell because Async

Bye Follow me on twitter: @PRPATEL