javascript Jam vs Bower,有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15603095/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jam vs Bower, what's the difference?
提问by Evan Carroll
回答by j12y
As others mentioned in comments already there are a few alternatives in this space beyond just Jam and Bower.
正如其他人在评论中提到的那样,除了 Jam 和 Bower 之外,这个领域还有一些替代方案。
- Component
- Ender
- Volo
- 零件
- 安德
- 沃洛
Both aim to provide a way to package up your assets and manage the dependencies between them for the client. Both Bower and Jam appear to have made their debut in 2012 -- Sept and May respectively.
两者都旨在提供一种方法来打包您的资产并为客户端管理它们之间的依赖关系。Bower 和 Jam 似乎都在 2012 年首次亮相——分别是 9 月和 5 月。
Both are available through node/npm and if all you want to do is resolve dependencies between public libraries like backbone, underscore, jquery, etc. for your application then either solution will work and allow you some basic options to control version, where to put it in your project, and checking for updates.
两者都可以通过 node/npm 获得,如果您只想为您的应用程序解决公共库(如主干、下划线、jquery 等)之间的依赖关系,那么任一解决方案都将起作用,并允许您使用一些基本选项来控制版本、放置位置它在您的项目中,并检查更新。
As for what's different -- Bower is a bit lower level than Jam which makes it more usable to a wider audience. You can create bower components for more than just JavaScript libraries. Jam focuses more solely on AMD style JavaScript libraries. With Jam, you can specify your dependencies in the package.json file you would use with npm components already whereas Bower has chosen component.json by convention. The limitation with Bower is that it only fetches your dependencies, you still need a build system if you want to use Require.js or other solutions which Jam has chosen so you get for free. Bower is getting support from Twitter and a few other projects (Ender, Yeoman).
至于有什么不同 - Bower 的级别比 Jam 低一点,这使得它更适合更广泛的受众。您不仅可以为 JavaScript 库创建 Bower 组件。Jam 更专注于 AMD 风格的 JavaScript 库。使用 Jam,您可以在 package.json 文件中指定您已经与 npm 组件一起使用的依赖项,而 Bower 按照惯例选择了 component.json。Bower 的局限性在于它只能获取您的依赖项,如果您想使用 Require.js 或 Jam 选择的其他解决方案,您仍然需要一个构建系统,以便您免费获得。Bower 得到了 Twitter 和其他一些项目(Ender、Yeoman)的支持。
Apologies if this is incorrect, but one additional limitation of Jam is that it does not allow you to create your own components for distribution in a private repository. This is something Bower allows you to configure as an endpoint in .bowerrc but I have as yet found a way to do that in Jam. Perhaps I haven't searched well enough but it appears there is at least one fork for private-jam.
抱歉,如果这是不正确的,但 Jam 的另一个限制是它不允许您创建自己的组件以在私有存储库中分发。这是 Bower 允许您在 .bowerrc 中配置为端点的东西,但我还没有在 Jam 中找到一种方法来做到这一点。也许我搜索得不够好,但似乎至少有一个用于 private-jam 的叉子。
A few other good reads:
其他一些不错的读物:
回答by antitoxic
Using the following breakdown of some of the popular package managers you can decide what you want to use in you development. It compares factos as
使用以下一些流行的包管理器的细分,您可以决定在开发中使用什么。它将事实比较为
- whether the manager uses
package.json
or other form of descriptor - what features does it support (scaffolding, compilation, having central registry)
- speed
- form of packages support (js only, js and css, js html and css)
- module types supported
- and of course some notes based on personal point of view
- 经理是否使用
package.json
或其他形式的描述符 - 它支持哪些功能(脚手架、编译、拥有中央注册表)
- 速度
- 包支持的形式(仅限 js,js 和 css,js html 和 css)
- 支持的模块类型
- 当然还有一些基于个人观点的笔记