Basic D3 browserify project
{
"name": "d3-workshop",
"version": "1.0.0",
"description": "examples and excercises",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "node ./node_modules/srvlr/index.js",
"build": "node ./node_modules/watchify/bin/cmd.js --debug ./main.js -o ./bundle.js",
"start": "npm run build & npm run serve"
},
"author": "",
"license": "ISC",
"dependencies": {
"browserify": "^11.0.1",
"d3": "^3.5.6",
"srvlr": "^0.4.0",
"watchify": "^3.3.1"
}
}
var d3 = require('d3');
console.log('d3 version: ', d3.version);
<html>
<head>
<title>Hello</title>
<script type="text/javascript" src="bundle.js"></script>
</head>
<body>
</body>
</html>