Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.