I am wanting to use momentjs with meteor. This is an npm package, so from what I understand, it cannot be used with meteor because meteor uses it’s own package system. So here are my questions:
- Does anyone know of a way to use momentjs with meteor?
- Is there a way to use npm packages with meteor?
2017 EDIT: As of Meteor 1.4+, npm package management allows for standard imports of npm modules and named imports of Atmosphere modules.
For stand-alone js libraries like moment.js, validate.js, underscore.string.js, etc. you can just drop the source file into your
libfolder. I useclient/libfor libraries which will be used only on the client (like validate.js), andlibfor libraries which could be used by both the client and the server (like moment.js).If you use meteorite, you can take advantage of the atmosphere packages. Some of what you are looking for for may be in there.
Using npm modules from meteor is something a lot of people ask about (for good reason). You can see some notes here, though I heard first hand that the way meteor talks to npm packages is about to change significantly.