September 2016
Beginner to intermediate
531 pages
12h 55m
English
Okay, let's get into the nitty-gritty right away and I'll explain what's going on. Add all of this into a new file called chapter6.js:
import express from 'express';
import bodyParser from 'body-parser';
import d3 from 'd3';
import {readFile} from 'fs';
import {nearestVoronoi} from './helpers';
let app = express();
app.use(bodyParser.urlencoded());Here we're just importing all of our libraries; nothing to see here... Oh wait — didn't I say we have to use CommonJS because we're in Nodeville? No — because we're using Babel and Webpack to transpile all of our code, we can still use the lovely ES2015 module loading syntax without issue — even for Node.js modules that aren't themselves in ES6!
Anyway, we essentially ...
Read now
Unlock full access