5 ms·
Can you run Node packages on Meteor yet? The decision to be incompatible with the vast number of Node/npm modules is what originally turned me off from Meteor,
by morgante 11y ago
Can you run Node packages on Meteor yet?
The decision to be incompatible with the vast number of Node/npm modules is what originally turned me off from Meteor, and I hope it's resolved.
- kentonv 11y agoYes, that was resolved two years ago.
- rory 11y agoI believe you still have to use a third-party package (https://github.com/meteorhacks/npm https://github.com/meteorhacks/npm), but it's quite easy to use and I've never had any problems with it.
- chrisquinnr 11y ago+1 If there's not a Meteor-specific package you're comfortable with then this is the option. Case in point, I prefer using stripe and twilio via meteorhacks:npm.
- morgante 11y agoI've tried using it before, but the requirement to wrap all async methods in synchronous helpers is pretty annoying. I just don't understand why Meteor decided to be incompatible with the vast majority of server-side JavaScript in the wild.
- kentonv 11y agoYou don't have to wrap your async methods if you don't want to. Meteor prefers to use fibers since a lot of people find them easier to work with, but if you write async code it will generally work fine. The one thing is that when you want to call back into Meteor code, you need to do it in a fiber, so you'll probably want to write a little helper for that. Here's my version: https://github.com/sandstorm-io/sandstorm/blob/master/shell/server/proxy.js#L59 https://github.com/sandstorm-io/sandstorm/blob/master/shell/...
- kentonv 11y agoYou don't have to use that. Meteor has had built-in support for npm since something like v0.6 (~two years ago). You need to declare your npm dependencies in your package.js but then you can go ahead and use `Npm.require`. As someone who has been building on Meteor for a while and using many npm modules, I've never actually heard of "meteorhacks:npm", and to be honest I'm confused what it's for...
- primigenus 11y agoIt allows you to skip having to specify npm dependencies in package.js.
- mizzao 11y agoHas been resolved since over 2 years ago: https://github.com/meteor/meteor/blob/devel/History.md#v060-2013-apr-04 https://github.com/meteor/meteor/blob/devel/History.md#v060-...