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.11
  • 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
    "aggregatedName": "websites.json", // The name to save the aggregated earl reports. default value = first url of the list
    "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-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-R1580f0bfaudio or video has no audio that plays automatically
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
QW-ACT-R23c5a4eavideo element visual content has accessible alternative
QW-ACT-R2473f2c2autocomplete attribute has valid value
QW-ACT-R255c01eaARIA state or property is permitted
QW-ACT-R26eac66bvideo element auditory content has accessible alternative
QW-ACT-R275f99a7This rule checks that each aria- attribute specified is defined in ARIA 1.1.
QW-ACT-R284e8ab6Element with role attribute has required states and properties
QW-ACT-R29e7aa44Audio element content has text alternative
QW-ACT-R302ee8b8Visible label is part of accessible name
QW-ACT-R31c3232fVideo element visual-only content has accessible alternative
QW-ACT-R321ec09bvideo element visual content has strict accessible alternative
QW-ACT-R33ff89c9ARIA required context role
QW-ACT-R346a7281ARIA state or property has valid value
QW-ACT-R35ffd0e9Heading has accessible name

License

ISC

Keywords

FAQs

Package last updated on 22 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