Skip to content

Instantly share code, notes, and snippets.

@josephfinlayson
Created July 29, 2014 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephfinlayson/a8ffcfe9719b8a562c04 to your computer and use it in GitHub Desktop.
Save josephfinlayson/a8ffcfe9719b8a562c04 to your computer and use it in GitHub Desktop.
How to use NPM module in meteor app
Package.describe({
summary: "Meteor version of footballbot"
});
Npm.depends({'footballbot':"1.2.0"});
Package.on_use(function (api, where) {
api.add_files('server/fbot.js', ['server']);
});
this.FootballBot = Npm.require('footballbot')
//THIS is they keyword!
// this.exports = FootballBot
console.log("Footballbot");
if (typeof this.FootballBot !== 'undefined') {
console.log(FootballBot);
a = new FootballBot('/dev/rfcomm0')
console.log(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment