New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@qualweb/core

Package Overview
Dependencies
Maintainers
3
Versions
269
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qualweb/core

QualWeb evaluator core engine

  • 0.3.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
293
decreased by-0.68%
Maintainers
3
Weekly downloads
 
Created
Source

QualWeb core

How to install

  $ npm i @qualweb/core --save

How to run

  'use strict';

  const { evaluate, generateEarlReport } = require('@qualweb/core');

  (async () => {
    // QualWeb evaluation report
    const options = { 
      url: 'https://act-rules.github.io/pages/about/' 
    };

    const reports = await evaluate(options);

    console.log(reports);

    const earlOptions = {
      // Check the options in the section below
    }

    // if you want an EARL report
    const earlReports = await generateEarlReport(earlOptions);

    console.log(earlReport);
  })();

Options

The available options fot the evaluate() function are:

  {
    "url": "https://act-rules.github.io/pages/about/", // url to evaluate
    "urls": ["https://act-rules.github.io/pages/about/", "https://act-rules.github.io/rules/"], // Array of urls
    "file": "/path/to/file/with/urls", // urls must be separacted by a newline (\n)
    "crawl": "https://act-rules.github.io", // Experimental feature - domain to crawl and obtain the urls
    "viewport": {
      "mobile": false, // default value = false
      "landscape": true, // default value = viewPort.width > viewPort.height
      "userAgent": "custom user agent", // default value for desktop = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0', default value for mobile = 'Mozilla/5.0 (Linux; U; Android 2.2; en-us; DROID2 GLOBAL Build/S273) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'
      "resolution": {
        "width": 1920, // default value for desktop = 1366, default valuet for mobile = 1080
        "height": 1080 // default value for desktop = 768, default valuet for mobile = 1920
      }
    },
    "maxParallelEvaluations": "5", // Experimental feature - performs several urls evaluations at the same time - the higher the number given, more resources will be used
    "execute": { // choose which modules to execute
      "wappalyzer": false, // wappalyzer module (https://github.com/qualweb/wappalyzer) - default value = false
      "act": true, // act-rules module (https://github.com/qualweb/act-rules) - default value = true
      "html": true, // html-techniques module (https://github.com/qualweb/html-techniques) - default value = true
      "css": false, // css-rules module (https://github.com/qualweb/css-techniques) - default value = true
      "bp": false // best-practices module (https://github.com/qualweb/best-practices) - default value = true
    },
    "act-rules": { // More information about this options at https://github.com/qualweb/act-rules
      "rules": ["QW-ACT-R1", "b5c3f8"], // Array of rules to execute, can be passed the QualWeb Rule ID or the ACT Rule ID
      "levels": ["A", "AA", "AAA"], // Conformance levels to execute, 
      "principles": ["Perceivable", "Operable", "Understandable", "Robust"] // Principles to execute
    },
    "html-techniques": { // More information about this options at https://github.com/qualweb/html-techniques
      "rules": ["QW-HTML-T1", "H39"], // Array of techniques to execute, can be passed the QualWeb Technique ID or the WCAG 2.1 Technique Code
      "levels": ["A", "AA", "AAA"], // Conformance levels to execute, 
      "principles": ["Perceivable", "Operable", "Understandable", "Robust"] // Principles to execute
    },
    "css-techniques": { // More information about this options at https://github.com/qualweb/css-techniques
      "rules": ["QW-CSS-RT", "C19"], // Array of techniques to execute, can be passed the QualWeb Technique ID or the WCAG 2.1 Technique Code
      "levels": ["A", "AA", "AAA"], // Conformance levels to execute, 
      "principles": ["Perceivable", "Operable", "Understandable", "Robust"] // Principles to execute
    },
    "best-practices": { // More information about this options at https://github.com/qualweb/best-practices
      "bestPractices": ["QW-BP1", "QW-BP2"] // Array of best practices to execute
    }
  }

The available options fot the generateEarlReport() function are:

  {
    "aggregated": true, // default value = false
    "modules": { // Choose which modules to convert the report to earl, by default all modules are converted if they were executed
      "act": true, // default value = true
      "html": false, // default value = true
      "css": false, // default value = true
      "best-practices": false // default value = true
    } // If the "modules" value is given, any missing module value missing it's automatically set to false  
  }

Implemente ACT Rules

QualWeb Rule IDACT Rule IDACT Rule Name
QW-ACT-R12779a5HTML Page has a title
QW-ACT-R2b5c3f8HTML has lang attribute
QW-ACT-R35b7ae0HTML lang and xml:lang match
QW-ACT-R4bc659aMeta-refresh no delay
QW-ACT-R5bf051aValidity of HTML Lang attribute
QW-ACT-R659796fImage button has accessible name
QW-ACT-R7b33effOrientation of the page is not restricted using CSS transform property
QW-ACT-R89eb3f6Image filename is accessible name for image
QW-ACT-R9b20e66Links with identical accessible names have equivalent purpose
QW-ACT-R104b1c6ciframe elements with identical accessible names have equivalent purpose
QW-ACT-R1197a4e1Button has accessible name
QW-ACT-R12c487aeLink has accessible name
QW-ACT-R136cfa84Element with aria-hidden has no focusable content
QW-ACT-R14b4f0c3meta viewport does not prevent zoom
QW-ACT-R16e086e5Form control has accessible name
QW-ACT-R1723a2a8Image has accessible name
QW-ACT-R183ea0c8id attribute value is unique
QW-ACT-R19cae760iframe element has accessible name
QW-ACT-R20674b10role attribute has valid value
QW-ACT-R217d6734svg element with explicit role has accessible name
QW-ACT-R22de46e4Element within body has valid lang attribute

License

ISC

Keywords

FAQs

Package last updated on 13 Jan 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc