ostrio:meteor-root

v1.0.7Published 6 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Meteor.rootPath

Get current path on your server, where is Meteor application is running.

This package supports Windows. Thanks to @Konard.

Install:

meteor add ostrio:meteor-root

Usage:

1const pathToFile = Meteor.rootPath + '/folder/where/is/your/file.json';

Returns absolute path to programs/server folder of your compiled application, without trailing slash.

1const pathToFile = Meteor.absolutePath + '/.meteor/local/build/programs/server/folder/where/is/your/file.json';

Returns absolute path to .meteor folder of your compiled application, without trailing slash.

Note: Be aware of that the path, returned by Meteor.absolutePath returns the location from where your Meteor application is running from. This is not guaranteed to be the same as the path of your project. Running Meteor in test-mode, for example, will return a path from a temporary location it's running.