Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pa11y-webservice-client-node

Package Overview
Dependencies
Maintainers
9
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pa11y-webservice-client-node

A Node.js client library for Pa11y Webservice

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
797
increased by6.69%
Maintainers
9
Weekly downloads
 
Created
Source

Pa11y Webservice Node.js Client

This is a Node.js client library for Pa11y Webservice.

Latest version published to npm Node.js version support Supports pa11y-webservice@4 API Build status LGPL-3.0 licensed

Installing

Add this client to your project with your preferred package manager. For example, to install it as a development dependency with npm:

npm install --save-dev pa11y-webservice-client-node

Usage

For information about Pa11y Webservice's endpoints and resource types, read the documentation.

const createClient = require('pa11y-webservice-client-node');

// Create client with the base URL of your instance of Pa11y Webservice
const client = createClient('http://localhost:3000/');

// Create a task
client.tasks.create({
    name: 'Nature Home Page',
    url: 'nature.com',
    standard: 'WCAG2AA'
}, function (error, task) {
    // task  =  object representing the new task, or null if an error occurred
});

// Get all tasks
client.tasks.get({}, function (error, tasks) {
    // tasks  =  array of objects representing tasks, or null if an error occurred
});

// Get all tasks with last results included for each
client.tasks.get({
    lastres: true
}, function (error, tasks) {
    // tasks  =  array of objects representing tasks, or null if an error occurred
});

// Get results for all tasks
client.tasks.results({}, function (error, results) {
    // results  =  array of objects representing results, or null if an error occurred
});

// Get results for all tasks within a date range
client.tasks.results({
    from: '2023-01-01',
    to: '2023-01-31'
}, function (error, results) {
    // results  =  array of objects representing results, or null if an error occurred
});

// Get results for all tasks with full details
client.tasks.results({
    full: true
}, function (error, results) {
    // results  =  array of objects representing results, or null if an error occurred
});

// Get a task by ID
client.task('5231c687bbdf0f94fa000007').get({}, function (error, task) {
    // task  =  object representing the requested task, or null if an error occurred
});

// Get a task by ID with last results included
client.task('5231c687bbdf0f94fa000007').get({
    lastres: true
}, function (error, task) {
    // task  =  object representing the requested task, or null if an error occurred
});

// Edit a task by ID
client.task('5231c687bbdf0f94fa000007').edit({
    name: 'New name'
}, function (error, task) {
    // task  =  object representing the newly updated task, or null if an error occurred
});

// Delete a task by ID
client.task('5231c687bbdf0f94fa000007').remove(function (error) {
    // err  =  null if task was deleted, or an Error object if something went wrong
});

// Run a task by ID
client.task('5231c687bbdf0f94fa000007').run(function (error) {
    // err  =  null if task is running, or an Error object if something went wrong
});

// Get results for a task
client.task('5231c687bbdf0f94fa000007').results({}, function (error, results) {
    // results  =  array of objects representing results, or null if an error occurred
});

// Get results for a task within a date range
client.task('5231c687bbdf0f94fa000007').results({
    from: '2023-01-01',
    to: '2023-01-31'
}, function (error, results) {
    // results  =  array of objects representing results, or null if an error occurred
});

// Get results for a task with full details
client.task('5231c687bbdf0f94fa000007').results({
    full: true
}, function (error, results) {
    // results  =  array of objects representing results, or null if an error occurred
});

// Get a result by ID
client.task('5231c687bbdf0f94fa000007').result('523c0ee0ca452f0000000009').get({}, function (error, result) {
    // task  =  object representing the requested result, or null if an error occurred
});

// Get a result by ID with full details
client.task('5231c687bbdf0f94fa000007').result('523c0ee0ca452f0000000009').get({
    full: true
}, function (error, result) {
    // task  =  object representing the requested result, or null if an error occurred
});

Contributing

There are many ways to contribute to Pa11y Webservice Node.js Client; we cover these in this repo's contributing guide.

If you'd like to contribute code, get started by cloning the repo and running npm install. Now you'll be able to run the following commands. Please use these build tools to avoid your contribution being delayed by a lint error or a failing test:

# Lint your contribution
npm run lint
# Test your contribution
npm test

Testing the GitHub Actions workflows

This project's GitHub Actions workflows can be tested locally using nektos/act, which can be installed with Homebrew:

brew install act

To validate the syntax of a workflow:

# Validate the publishing workflow, by triggering a 'release' event
act --dryrun release
# Validate the testing workflow
act --dryrun push

To run the testing workflow locally:

# Run the testing workflow, with Node.js 18 only
act push --matrix node-version:18

Add --verbose for more output.

Support and Migration

[!NOTE] We maintain a migration guide to help you migrate between major versions.

When we release a new major version we will continue to support the previous major version for 6 months. This support will be limited to fixes for critical bugs and security issues. If you're opening an issue related to this project, please mention the specific version that the issue affects.

The following table lists the major versions available and, for each previous major version, its end-of-support date, and its final minor version released.

Major versionFinal minor versionNode.js supportSupport end date
418, 20✅ Current major version
33.012, 14, 16September 2024
22.08, 102022-05-26
11.20.10, 0.12, 4, 62020-01-05

License

Licensed under the Lesser General Public License (LGPL-3.0-only).
Copyright © 2013-2024, Team Pa11y

Keywords

FAQs

Package last updated on 26 Mar 2024

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