Skip to content Skip to sidebar Skip to footer

I Want To Run D3 From A Cakefile

I'd like to execute some d3 code from the command line. Initially I just tried something like: task 'data', 'Build some data with d3', -> d3 = require('lib/d3.v2') c

Solution 1:

See D3's package.json. More specifically, the file you want to require when running inside Node or similar environments is index.js rather than d3.v2.js; this file contains some special patches that make D3 compatible with the require operator.

To try it out for yourself, cd to the d3 repository, run node to create an interactive shell, and then say

var d3 = require("./");

Or, if you're in your own project folder, if you've installed D3 into node_modules/d3 via npm (npm install d3), you can say:

var d3 = require("d3");

Post a Comment for "I Want To Run D3 From A Cakefile"