Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
pa11y-webservice-client-node
Advanced tools
pa11y-webservice-client-node is a Node.js client library for pa11y-webservice
pa11y-webservice-client-node is a Node.js client library for pa11y-webservice.
Current Version: 1.1.0
Build Status:
Node Version Support: 0.10
Install pa11y-webservice-client-node with npm:
$ npm install pa11y-webservice-client-node
For more information on the actual web-service endpoints and resource types, read the documentation.
var createClient = require('pa11y-webservice-client-node');
// Create client with the base URL of the web-service
var client = createClient('http://localhost:3000/');
// Create a task
client.tasks.create({
url: 'nature.com',
standard: 'WCAG2AA'
}, function (err, task) {
// task = object representing the new task, or null if an error occurred
});
// Get all tasks
client.tasks.get({}, function (err, 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 (err, tasks) {
// tasks = array of objects representing tasks, or null if an error occurred
});
// Get results for all tasks
client.tasks.results({}, function (err, 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: '2013-01-01',
to: '2013-01-31'
}, function (err, 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 (err, results) {
// results = array of objects representing results, or null if an error occurred
});
// Get a task by ID
client.task('5231c687bbdf0f94fa000007').get({}, function (err, 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 (err, task) {
// task = object representing the requested task, or null if an error occurred
});
// Delete a task by ID
client.task('5231c687bbdf0f94fa000007').remove(function (err) {
// err = null if task was deleted, or an Error object if something went wrong
});
// Run a task by ID
client.task('5231c687bbdf0f94fa000007').run(function (err) {
// err = null if task is running, or an Error object if something went wrong
});
// Get results for a task
client.task('5231c687bbdf0f94fa000007').results({}, function (err, 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: '2013-01-01',
to: '2013-01-31'
}, function (err, 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 (err, 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 (err, 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 (err, result) {
// task = object representing the requested result, or null if an error occurred
});
To develop pa11y-webservice-client-node, you'll need to clone the repo locally and run npm install
. You'll also need Grunt to be installed globally in order to run tests, you can do this with npm install -g grunt-cli
.
Now you'll be able to run the following commands:
$ grunt # Run the lint and test tasks together
$ grunt lint # Run JSHint with the correct config
$ grunt test # Run unit tests
Code with lint errors or failing tests will not be accepted, please use the build tools outlined above.
For users with push-access, don't commit to the master branch. Code should be in develop
until it's ready to be released.
Copyright 2013 Nature Publishing Group.
pa11y-webservice is licensed under the GNU General Public License 3.0.
FAQs
A Node.js client library for Pa11y Webservice
We found that pa11y-webservice-client-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.