Find absolute base path of the project directory

后端 未结 7 1474
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 21:35

Until now we could get the absolute path of a file to open later as readStream with this code snippet:

var base = path.resolve(\'.\');
var file = base + \'/d         


        
7条回答
  •  一生所求
    2020-12-04 22:09

    Since version 1.3, the documented function

    Assets.absoluteFilePath(assetPath)

    seems to be the best way to get the project path reliably.

    Meteor Github

提交回复
热议问题