dojo/node

Summary

This AMD plugin module allows native Node.js modules to be loaded by AMD modules using the Dojo loader. Note that this plugin will not work with AMD loaders other than the Dojo loader.

See the dojo/node reference documentation for more information.

Examples

Example 1

require(["dojo/node!fs"], function(fs){
    var fileData = fs.readFileSync("foo.txt", "utf-8");
});

Methods

load(id,require,load)

Defined by dojo/node

Standard AMD plugin interface. See https://github.com/amdjs/amdjs-api/wiki/Loader-Plugins for information.

Parameter Type Description
id string
require Function
load Function

normalize(id,normalize)

Defined by dojo/node

Produces a normalized id to be used by node. Relative ids are resolved relative to the requesting module's location in the file system and will return an id with path separators appropriate for the local file system.

Parameter Type Description
id string
normalize Function

Returns: undefined

© 2005–2017 JS Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/node.html