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
As of Meteor 1.2.1, this works for me:
var absoluteBasePath = path.resolve('../../../../../.');
The same result using split
:
var absoluteBasePath = path.resolve('.').split(path.sep + '.meteor')[0];
Using process.cwd()
:
var absoluteBasePath = path.resolve(process.cwd(), '../../../../../');
var absoluteBasePath = path.resolve(process.cwd()).split(path.sep + '.meteor')[0];