1.0.6 • Published 6 years ago

third-party-resources-checker v1.0.6

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

npm version License Build Status Coverage Status Dependency Status devDependency Status

Third Party Resources Checker

This PhantomJS-based tool loads a given URL and logs on the standard output any URL (one per line) the page requests while loading that is not a www.w3.org nor a whitelisted URL (as defined in the whitelisted_domains variable).

It is a component of the W3C automated publication workflow, orchestrated by Echidna.

Installation

Install the dependencies by running npm install.

Usage

Standalone

The checker can be run standalone via the command line:

  Usage: third-party-resources-checker [options] URI

  Options:

    -h, --help                  output usage information
    -V, --version               output the version number
    -w, --whitelist <filename>  optional JSON file containing URIs and domains that are deemed OK

  Examples:

    $ third-party-resources-checker http://page.to.be/checked
    $ third-party-resources-checker -w whitelist.json http://page.to.be/checked

As a module

The checker can also be run as a module. require('third-party-resources-checker') exposes a single check function:

check(uri, [whitelist]);

It returns a Promise of a tuple (as a JavaScript Array):

  • The first element is the exit code
  • The second element is an Array of String, each of them being an external resource

Whitelist format

When used standalone, the whitelist must be written in a JSON file. When used as a module, it must be given to the check() function as a JavaScript object literal. In both cases, its format is the following:

{
    "domains": [
        "www.foobar.org"
    ],
    "urls": [
        "http://example.org/image.jpg"
    ]
}
1.0.6

6 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago