次の編集済みコードがあります。
module.exports = {
read: read,
write: write,
};
var read = function(parameters, config, next) {
/* <snip> */
};
var write = function(parameters, config, next) {
/* <snip> */
};
このファイルを別の場所に移動するrequire()
と、ノードがクラッシュし、必要なオブジェクトにメソッドread
またはwrite
. 変数の巻き上げは関数を の上に引っ張りませんmodules.export = { ... };
か?