Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
access-sniff
Advanced tools
Readme
A CLI and Phantom.js library for HTML_CodeSniffer
Install this plugin with npm install access-sniff --save
var AccessSniff = require('access-sniff');
AccessSniff
.default(['**/*.html'], options)
.then(function(report) {
AccessSniff.report(report, reportOptions);
});
import AccessSniff, { reports as AccessReports } from 'access-sniff';
AccessSniff(['**/*.html'], options)
.then(report => AccessReports(report, reportOptions));
npm install access-sniff -g
sniff test/**/*.html -r json -l reports
AccessSniff can test both locally hosted files and websites.
sniff http://statamic.com/ -r json -l reports
You can pass the following options
accessibilityLevel
is a string
options: {
accessibilityLevel: 'WCAG2A'
}
Levels are WCAG2A
, WCAG2AA
, WCAG2AAA
, and Section508
accessibilityrc
is a boolean
options: {
accessibilityrc: true
}
Set to true to access a .accessibilityrc file in your project which should be layed out as:
{
"ignore": [
"WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1.NoTitleEl",
"WCAG2A.Principle3.Guideline3_1.3_1_1.H57.2"
]
}
ignore
is an array
You can ignore rules by placing them in an array outlined below
options: {
ignore: [
'WCAG2A.Principle2.Guideline2_4.2_4_2.H25.1.NoTitleEl'
'WCAG2A.Principle3.Guideline3_1.3_1_1.H57.2'
]
}
verbose
is a boolean
options: {
verbose: false
}
Output messages to console, set to true by default
domElement
is a boolean
options: {
domElement: false
}
Include reference (tag name, class names & id) to reported elements. Optional for both output formats.
force
is a boolean, defaults to false
options: {
force: true
}
Continue running in the event of failures. You can catch failures from the promise as below:
AccessSniff(['**/*.html'], options)
.then(report => AccessReports(report, reportOptions));
.catch(error => console.error(error))
maxBuffer
is a number, defaults to 500*1024
In certain situations you might have to increase the memory allocated to render a page.
options: {
maxBuffer: 500*1024
}
You can pass the following options to the report generator
You can use the inbuilt system or create your own
AccessSniff.report(report, reportOptions)
reportType
is a string
options: {
reportType: 'json'
}
Text, CSV or JSON format output
txt
will output text filesjson
will output .json filescsv
will output csvreportLocation
is a string
options: {
reportLocation: 'reports'
}
Set the value to where you want reports created
reportLevels
is an object
options: {
reportLevels: {
notice: true,
warning: true,
error: true
}
}
Set a value to false
to limit output
You can use the CLI component by installing it globally with npm install -g access-sniff
sniff test/**/*.html -r json -l reports
sniff test/**/*.html -r csv -l reports
sniff test/**/*.html -r txt -l reports
-r
or -reportType
txt, csv, json.
-r
or -reportLocation
-q
or -quiet
FAQs
A node/iojs library & CLI for HTML_Codesniffer
The npm package access-sniff receives a total of 1,317 weekly downloads. As such, access-sniff popularity was classified as popular.
We found that access-sniff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.