Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot read property '.js' of undefined #1

Open
dimanchee opened this issue Mar 13, 2015 · 1 comment
Open

Cannot read property '.js' of undefined #1

dimanchee opened this issue Mar 13, 2015 · 1 comment

Comments

@dimanchee
Copy link

Hi,

I am trying to hook a function in node module, but I got error as mentioned in the title, below is my code:

var hook = require('node-hook');
function Request(method, url) {
alert(url);
}
hook.hook('.js', Request);
require('./node_modules/module_name/index');

Is it possible on the way I am trying to archive?

@bahmutov
Copy link
Owner

Could you return the source after printing the filename? See the same example working in https://github.com/bahmutov/node-hook/blob/master/test/use-case.js

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants