Getting Error when trying the API #227
Unanswered
cyfyrifilefe
asked this question in
Q&A
Replies: 1 comment
-
Unfortunately, the API docs don't seem up-to-date ;-/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello @stevenvachon,
could you provide a simple working sample code?
When I try the provided code
`const {SiteChecker} = require('broken-link-checker');
const siteChecker = new SiteChecker(options)
.on('error', (error) => {})
.on('robots', (robots, customData) => {})
.on('html', (tree, robots, response, pageURL, customData) => {})
.on('queue', () => {})
.on('junk', (result, customData) => {})
.on('link', (result, customData) => {})
.on('page', (error, pageURL, customData) => {})
.on('site', (error, siteURL, customData) => {})
.on('end', () => {});
siteChecker.enqueue(siteURL, customData);`
I always get the following error:
` .on('error', (error) => {})
^
TypeError: (intermediate value).on is not a function
at Object. (/home/blc/test.js:6:4)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
`
Since I am a Node-Newbie it is possible that I miss something ;-)
Thanks,
Cyrille
Beta Was this translation helpful? Give feedback.
All reactions