来自智能包的流星项目路径 [英] Meteor project path from a smartpackage

查看:35
本文介绍了来自智能包的流星项目路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种从智能包中查找meteor 项目路径的方法(例如:获取.meteor 文件夹所在目录的路径...).我无法使用节点的 __dirname 和 __filename 来做到这一点,因为不知何故在流星中它们不可用.有什么提示吗?

I was looking for a way to look up the meteor project path from a smart package (e.g.: obtain the path of the directory where the .meteor folder is ...). I was not able to do it using node's __dirname and __filename because somehow in meteor they are not avaiable. Any tips ?

推荐答案

从 Meteor 0.6.0 开始,这将是:

As of Meteor 0.6.0 this would be:

var path = Npm.require('path');
var basepath = path.resolve('.');

这篇关于来自智能包的流星项目路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆