Install required NPM modules in the directory
npm install gulp jshint gulp-jshint jshint-stylish gulp-watch
Create your gulpfile.js
and paste in the following code
var gulp = require('gulp');
Install required NPM modules in the directory
npm install gulp jshint gulp-jshint jshint-stylish gulp-watch
Create your gulpfile.js
and paste in the following code
var gulp = require('gulp');
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<link rel="stylesheet" href=""> | |
</head> | |
<body> | |
<h3>A list of things</h3> |
console.log(Sandwich); | |
var sandwichCost = Sandwich.getSandwichPrice("cheese"); | |
var toppingCost = Sandwich.getToppingPrice("captainCrunch"); | |
var output = document.getElementById("sandwich"); | |
output.innerHTML = sandwichCost + toppingCost; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<link rel="stylesheet" href=""> | |
</head> | |
<body> | |
<h3>A list of things</h3> |
{ | |
"name": "hbs_browserify-grunt", | |
"version": "0.1.0", | |
"devDependencies": { | |
"browserify": "^13.0.0", | |
"grunt": "^0.4.5", | |
"grunt-browserify": "^5.0.0", | |
"grunt-contrib-handlebars": "^1.0.0", | |
"grunt-contrib-jshint": "^0.11.2", | |
"grunt-contrib-nodeunit": "~0.4.1", |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
// Change the b-fy task to add a transform task | |
browserify: { | |
js: { | |
src: ['./js/main.js'], | |
dest: 'dist/app.js' | |
}, | |
options: { |
// Performs an action, but caluculates/returns no value | |
// console.log(returnNothing()); | |
var returnNothing = function() { | |
console.log("I don't return anything"); | |
}; | |
// returnNothing(); | |
// Does a task and returns the result of that task | |
var result = addStuff(); |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Nashville Software School</title> | |
<link rel="stylesheet" type="text/css" href="events.css"> | |
</head> | |
<body> |
function Person(firstName, lastName, age, ssn) { | |
// Declaring this way by default will make your property | |
// readable, writable, and enumerable | |
this.firstName = firstName; | |
this.lastName = lastName; | |
// Let's make a getter-only method that returns the | |
// two values as a whole name | |
Object.defineProperty(this, 'fullName', { | |
get: function() { |
'use strict'; | |
const sqlite3 = require('sqlite3'); | |
const db = new sqlite3.Database('./acme.sqlite', (wat) => { | |
console.log("Is this connection open?", wat); | |
}); | |
const getCustomer = (custPhone) => { | |
return new Promise( (resolve, reject) => { | |
db.get(`SELECT first_name, last_name FROM customers WHERE phone = "${custPhone}"`, (err, customer) => { |