0

I think this is pretty basic but am having trouble finding a solution. I have found an NPM package LOG-WATCHER (example only) that monitors a specific log file on a clients local file system. LOG-WATCHER emits events 'START', 'ACTION', 'END'. Since this file is client only I am using browserify. In my packages.json I have added "LOG-WATCHER": "1.0"

In /client/lib app.browserify.js I have added logWatcher = require("LOG-WATCHER");

logWatcher should now be a global variable that I can use in my app. So my question is how can I access one of the events START/ACTION/END through the logWatcher? Very confused on how to put into place.

1 Answers1

0

npmRequire is a funciton who presume you are on a NodeJs env. So you can use it only on Server.

Using browserify you will be able to create an assert for client. Take a look to this two links : - https://react-in-meteor.readthedocs.org/en/latest/meteor-data/ - https://atmospherejs.com/cosmos/browserify

Arthur
  • 4,870
  • 3
  • 32
  • 57
  • Thanks for the browserify mention. Do you know how to access the NPM packages events now that example is clarified? – notaSRSbiz Dec 23 '15 at 23:17