Socket
Socket
Sign inDemoInstall

super-simple-crawler

Package Overview
Dependencies
39
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    super-simple-crawler

Super simple website crawler


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Install size
5.65 MB
Created
Weekly downloads
 

Readme

Source

Super Simple Crawler travisCI

A super simple crawler for crawling websites and reporting back stats.

Installation

npm install -S super-simple-crawler

Usage

import simpleCrawler from 'super-simple-crawler';

const crawler = simpleCrawler({ url: 'http://madole.xyz' });

crawler.on('response', {status, responseTime, body, size} => {
    console.log(status);
    console.log(responseTime);
    console.log(depthLimit);
    console.log(size);
});

crawler.on('done', () => {
    console.log('Finished crawling');
});

Parameters

simpleCrawler takes an object as a parameter.

  • url - string: the url to crawl
  • maxDepthLimit - number: the depth which to crawl, defaults to 2

Events

response
  • status - string: the response status (HTTP Code)
  • responseTime - number: the time taken for the server to respond to the request
  • depthLimit - number: the depth which the URL features in the site
  • size - number: the size, in bytes, of the response
  • path - string: the path of the url eg. '/glendalough-double-barrel'
  • url - string: the full url of eg. 'http://whiskeynerds.com/glendalough-double-barrel/'
  • response - object: the whole response object
done

The done event is fired when there are either no more urls to crawl, or the maximum depth limit has been reached.

FAQs

Last updated on 30 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc