
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@sa11y/common
Advanced tools
@sa11y/common
Common utilities, constants, error messages, and helper functions for @sa11y
packages.
This package provides shared functionality used across all @sa11y
packages. It includes utilities for environment detection, custom rule management, file processing, and result handling.
import { log, isFakeTimerUsed } from '@sa11y/common';
// Debug logging (only outputs when SA11Y_DEBUG is set)
log('Debug message');
// Check if fake timers are being used
if (isFakeTimerUsed()) {
// Handle fake timer scenario
}
import { useCustomRules, registerCustomRules } from '@sa11y/common';
// Load custom rules from environment
const customRules = useCustomRules();
// Register custom axe rules
registerCustomRules(changesData, rulesData, checkData);
import { processFiles, writeHtmlFileInPath } from '@sa11y/common';
// Process files in a directory
const results = [];
processFiles('/path/to/directory', results, '.json', JSON.parse);
// Write HTML file for debugging
writeHtmlFileInPath('/output/path', 'test.html', '<html>...</html>');
import { getViolations, getIncomplete } from '@sa11y/common';
// Get violations using a custom checker function
const violations = await getViolations(async () => {
const results = await axe.run();
return results.violations;
});
// Get incomplete results
const incomplete = await getIncomplete(async () => {
const results = await axe.run();
return results.incomplete;
});
SA11Y_DEBUG
: Enable debug loggingSA11Y_CUSTOM_RULES
: Path to custom rules JSON fileSA11Y_AUTO_FILTER_LIST_PACKAGE_NAME
: Package name for auto-filter listSA11Y_AUTO_FILTER_LIST_PACKAGE_REQUIREMENT
: Package requirement for auto-filterFAQs
Common utilities, constants, error messages for @sa11y
The npm package @sa11y/common receives a total of 14,294 weekly downloads. As such, @sa11y/common popularity was classified as popular.
We found that @sa11y/common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.