我的Gulp任务中有一个对象,其中包含我的Yaml文件的数据。现在我想从其他JavaScript文件中访问该对象。
这就是我的Gulp Task的样子:
Gulpfile.js
try {
var mergedYaml = require('../../../../gulpfile.js').mergedYaml;
console.log(mergedYaml);
}
catch (e){
console.log(e);
}
这就是我尝试访问它的方式:
Test.js
Undefined
Console.log正在显示select t1.url,t1.title,t2.count from headlines t1
inner join(
select url,count(*) as count,max(created_at) as created_at
from headlines group by url ) t2 on t1.url=t2.url and t1.created_at=t2.created_at;
作为输出。