var circle = require("circle.js"); +include("/utils.js"); puts("The area of a circle of radius 4 is " + circle.area(4));
diff --git a/doc/api.html b/doc/api.html index 6ac33796ec..c9c0a45ef3 100644 --- a/doc/api.html +++ b/doc/api.html @@ -472,6 +472,7 @@ one-to-one correspondence. As an example, foo.js loads the module
var circle = require("circle.js"); +include("/utils.js"); puts("The area of a circle of radius 4 is " + circle.area(4));
The contents of circle.js:
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)