How to use node wrapper packages?

I want to add an irc client to my app with this package:

it wrapps this node-irc package

If I add the node example code:
var irc = require('irc'); var client = new irc.Client('', 'myNick', { channels: ['#channel'], });

I get the error ReferenceError: require is not defined.

I also tried the npm-container package to use require which results in either in
"Meteor.npmRequire is not a function" or
"Meteor.require is not a function"

Can anyone give me a hint on how to use this wrapper properly?

node-irc meteor wrapper export ‘irc’ global:

Then your code become:

//var irc = require('irc');
var client = new irc.Client('', 'myNick', { channels: ['#channel']});

Then I get “irc is not defined” and adding it to my controller providers results in “Error: [$injector:unpr] Unknown provider: ircProvider <- irc <- AppCtrl”

can you post a public github repository?

do you add package?

meteor add ahref:irc

Yes I’ve added it :smile:

This is my controller, maybe I’m missing something:

.controller(‘AppCtrl’, [’$scope’, ‘$timeout’, ‘$mdSidenav’, ‘$mdUtil’, ‘$log’, ‘$meteor’, ‘$stateParams’, ‘$state’, ‘$rootScope’, ‘$mdDialog’,
function ($scope, $timeout, $mdSidenav, $mdUtil, $log, $meteor, $stateParams, $state, $rootScope, $mdDialog) {

  var client = irc.Client('', 'myNick', {
    port: 6601,
    channels: ['#welcome']

  client.addListener('message', function (from, to, message) {
    console.log(from + ' => ' + to + ': ' + message);



Means I can only use irc on serverside… I am an idiot :smiley: Thanks anyway