var circle = require("circle.js"); +include("/utils.js"); puts("The area of a circle of radius 4 is " + circle.area(4));
From e972add0ea6cc27848decff2c761452d75e42d0b Mon Sep 17 00:00:00 2001
From: Ryan Dahl The contents of circle.js:var circle = require("circle.js");
+include("/utils.js");
puts("The area of a circle of radius 4 is " + circle.area(4));
The module path is relative to the file calling require(). That is, circle.js must be in the same directory as foo.js for require() to find it.
include("circle.js"); +include("/utils.js"); puts("The area of a cirlce of radius 4 is " + area(4));
When an absolute path is given to require() or include(), like @@ -2002,7 +2006,7 @@ init (Handle<Object> target)