Reading files from a directory inside a meteor app

后端 未结 7 610
既然无缘
既然无缘 2021-01-04 08:28

How can i read the public directory in a meteor application inside my /server path.

I tried using the native \'fs\' package but i keep getting a file/di

7条回答
  •  花落未央
    2021-01-04 08:41

    This works for me in Meteor 1.0:

    var fs = Npm.require('fs')
    var xsd = fs.readFileSync(process.cwd().split('.meteor')[0] + 'server/company.xsd', 'utf8')
    

提交回复
热议问题