npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webcheck

v2.0.0

Published

A module to analyse websites for SEO, validation and code-quality

Downloads

37

Readme

Introduction

Webcheck gives you an infrastructure to analyze web resources. It is build very generic for supporting a wide range of possible use cases. You are able to analyze a single page, a whole domain or even everything connected to one or more seed resources. You can analyze every content-type.

Version 1.0.0 is refactored completely. Webcheck uses streams. Because of the streams it uses plugins instead of middleware. There is a list of plugins in the github repository. Please send me the link to yours if you develop one. Otherwise you should look on npm for modules with prefix 'webcheck-'.

How to use

Installation

npm install webcheck

Use in node.js

var { Webcheck } = require('webcheck');
var AnyPlugin = require('webcheck-any-plugin');

var webcheck = new Webcheck();
var anyPlugin = new AnyPlugin({your: 'options'});
webcheck.addPlugin(anyPlugin);

anyPlugin.enable();

webcheck.crawl({
    url: 'http://some.website/url'
}, function (err) {
    if (err) {
        console.error('There was an error while crawling', err);
    }
    console.log('Crawling done...');
});

Concept of this module

Since version 1.0.0 webcheck uses streams instead of callbacks. It is not compatible to older versions!

Webcheck is small featured. You should extend your functionality with plugins. Take a look at the list of plugins.

Plugins

For further information about plugins in webcheck take a look at the plugin readme.

Webcheck Class

Methods of webcheck

webcheck.addPlugin(plugin)

Add a plugin to webcheck.

webcheck.crawl(settings, callback)

Request a resource

List of settings
  • url | {string} [mandatory]: URL to crawl
  • wait | {Number}: Time to wait till request (default: 0)
  • headers | {Object}: Default headers (default: {"User-Agent": "webcheck v1.0.0"})
  • request | {request}: The used request-module
  • immediately | {boolean}: Should the crawl push as next one to queue.
  • parameters | {Object}: A object to pass parameters to other plugins about this crawl

Properties of webcheck

webcheck.request

This is a instance of request. Webcheck use this as function to request a resource. If you want another request function, for example to request resources from TOR with torrequest, you are able to swap this property.

webcheck.middlewares

Array of used middleware.

Events of webcheck

All events emitted on the webcheck object.

var webcheck = new Webcheck();
webcheck.on(event, fn);

Webcheck emits the following events:

  • crawl (request-settings): Emitted directly after calling crawl method.
  • request (request-settings): Emitted before request is executed.
  • result ({url, request-settings, request, response}): Emitted after middleware are executed and document is fetched
  • drain: Emitted on draining of queue
  • queue (request-settings): Emitted before adding to queue
  • addPlugin (plugin): Emitted when a plugin is added
  • enablePlugin (plugin): Emitted when a added plugin gets enabled
  • disablePlugin (plugin): Emitted when a added plugin gets disabled

Changes on version 1.1.0 and 2.0.0

From now on Webcheck is a class within the module webcheck.

That means Webcheck must now required over:

import { Webcheck, Plugin } from 'webcheck';

or in the classical way:

var Webcheck = require('webcheck').Webcheck;

It is no longer possible to require Webcheck the old way! That could also cause incompatibilities with older Plugins.