node

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–2015 The Dojo Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/node.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部