2013流星NPM套餐 [英] 2013 Meteor NPM Packages

查看:32
本文介绍了2013流星NPM套餐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新 此解决方案介绍了如何在Meteor中有效使用新的Npm系统.

Update this solution describes how to effectively use the new Npm system in Meteor.

在Meteor中使用NPM软件包的当前方法是什么?

截至2013年3月22日,尚无官方文档.

对此有几个问题,特别是

There are several questions about this, notably this one, however the solution seems outdated: the engine branch no longer exists, and I haven't been able to find anything on Npm.require in Meteor.

另一种解决方案在此发布,指示将其安装到.meteor/构建文件夹中.在我安装到Heroku时,这似乎不是有效的解决方案,因为buildpack在运行程序之前会使用meteor bundle捆绑该程序.因此,临时构建文件夹似乎不是有效的选择.

Another solution, posted here, instructs to install into the .meteor/ build folders. As I am installing to Heroku, this doesn't seem like a valid solution, as the buildpack uses meteor bundle to bundle the program before running it. Thus, the temporary build folders don't seem like a valid option.

Npm流星发生了什么?使用Npm软件包的最新方法是什么?

What has happened to Npm in meteor? What's the latest way of using Npm packages?

在相关说明中,我正在尝试使用Amazon SDK(用于s3)-最好将其打包为Meteorite软件包吗?

推荐答案

Arunoda已创建了一个NPM Atmosphere程序包,该程序包您可以像以前一样使用任何NPM模块.非常简单.

Arunoda has created an NPM Atmosphere package that allows you to use any NPM module like you're used to. It's very simple.

首先,mrt add npm.

您还可以使用npm install -g meteor-npm中的meteor-npm命令来安装软件包.

You can also install the package by using meteor-npm command from npm install -g meteor-npm.

接下来,在根项目目录中创建一个packages.json文件,其中包含软件包名称和版本:

Next, make a packages.json file in your root project directory, with the package names and versions:

{
    "foobar": "0.3.5",
    "loremipsum": "2.1.4"
}

最后,将它们与Meteor.require一起使用,如下所示:var FooBar = Meteor.require('foobar');

Finally, use them with Meteor.require, like this: var FooBar = Meteor.require('foobar');

这篇关于2013流星NPM套餐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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