{"action":"created","issue":{"url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/147","labels_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/147/comments","events_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/147/events","html_url":"https://github.com/cgiffard/node-simplecrawler/issues/147","id":87241872,"number":147,"title":"Crawler.stop() is undefined","user":{"login":"iamso","id":3675849,"avatar_url":"https://avatars.githubusercontent.com/u/3675849?v=3","gravatar_id":"","url":"https://api.github.com/users/iamso","html_url":"https://github.com/iamso","followers_url":"https://api.github.com/users/iamso/followers","following_url":"https://api.github.com/users/iamso/following{/other_user}","gists_url":"https://api.github.com/users/iamso/gists{/gist_id}","starred_url":"https://api.github.com/users/iamso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamso/subscriptions","organizations_url":"https://api.github.com/users/iamso/orgs","repos_url":"https://api.github.com/users/iamso/repos","events_url":"https://api.github.com/users/iamso/events{/privacy}","received_events_url":"https://api.github.com/users/iamso/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-11T07:21:39Z","updated_at":"2015-06-11T13:46:22Z","closed_at":"2015-06-11T07:42:55Z","body":"Hi \r\nI use the simplecrawler in Simple Mode. I can start it by calling Crawler.crawl(url).on(...\r\nOn fetchcomplete I push the processed results to a client app through a websocket.\r\nNow if someone starts crawling a really large site and decides to abort it, I want to be able to stop the crawling process, but when I call Crawler.stop(), I get `TypeError: undefined is not a function`.\r\n\r\nHow can I stop the crawler completely?\r\n\r\nHere is the code I use (it's Coffeescript)\r\n```coffeescript\r\nCrawler = require \"simplecrawler\"\r\n\r\nCrawler.crawl url\r\n  .on \"fetchcomplete\", (item) ->\r\n    # do something\r\n    \r\n  .on \"complete\", ->\r\n    # do something else\r\n\r\n# to test it I called Crawler.stop() after a timeout, but it seems to be undefined\r\nsetTimeout ( ->\r\n  Crawler.stop()\r\n  console.log 'stopped'\r\n), 4000\r\n```\r\n\r\nThanks in advance\r\nSteve"},"comment":{"url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/comments/111140628","html_url":"https://github.com/cgiffard/node-simplecrawler/issues/147#issuecomment-111140628","issue_url":"https://api.github.com/repos/cgiffard/node-simplecrawler/issues/147","id":111140628,"user":{"login":"iamso","id":3675849,"avatar_url":"https://avatars.githubusercontent.com/u/3675849?v=3","gravatar_id":"","url":"https://api.github.com/users/iamso","html_url":"https://github.com/iamso","followers_url":"https://api.github.com/users/iamso/followers","following_url":"https://api.github.com/users/iamso/following{/other_user}","gists_url":"https://api.github.com/users/iamso/gists{/gist_id}","starred_url":"https://api.github.com/users/iamso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamso/subscriptions","organizations_url":"https://api.github.com/users/iamso/orgs","repos_url":"https://api.github.com/users/iamso/repos","events_url":"https://api.github.com/users/iamso/events{/privacy}","received_events_url":"https://api.github.com/users/iamso/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T13:46:22Z","updated_at":"2015-06-11T13:46:22Z","body":"Perfect. Thanks."}}