npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@financial-times/n-pa11y-config

v2.1.0

Published

Configuration module for Pa11y CI

Downloads

8,415

Readme

n-pa11y-config CircleCI

This is a module to help creating a Pa11y CI configuration for your project.

Requirements

  • Node version defined by engines.node in package.json. Run command nvm use to switch your local Node version to the one specified in .nvmrc.
  • Pa11y CI

Development

git clone [email protected]:Financial-Times/n-pa11y-config.git
cd n-pa11y-config
npm install

Installation

Install from NPM

npm install --save-dev @financial-times/n-pa11y-config

Usage

Include this library on your .pa11yci.js file and export the result of the invocation of this library:

const nPa11yConfig = require('@financial-times/n-pa11y-config')
const tests = require('./tests/smoke-tests.js')

module.exports = nPa11yConfig({
  tests,
  host: 'http://localhost:3000',
  exceptions: ['__gtg'],
  viewports: [
    {
      width: 640,
      height: 960,
    },
  ],
  headers: {
    'FT-Next-Backend-Key': process.env.FT_NEXT_BACKEND_KEY,
  },
})

Configuration

The function expects an object with the following attributes:

| Name | Description | Type | Optional | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------- | | tests | Tests to be tested by Pa11y | Array | false | | host | Base URL to apply to all test routes | String | true | | exceptions | Routes returning 200 that should not be tested (routes that return something different than 200 will be automatically excluded) | Array | true | | wait | The time to wait before running tests in milliseconds | Number | true | | hide | CSS selector to hide elements from testing, selectors can be comma separated | Array | true | | viewports | Set viewports for puppeteer | Array | true | | headers | Headers to be added to every test route | Object | true | | screenCapturePath | Path where to store all the screenshots generated by Pa11y. By default it will store all screenshots in screenCaptures | String | true |

Headers

Headers can be set:

  • globally for all apps (in the headers attribute)
  • per test (configured in the tests array)

Headers objects will be merged, cookies and flags will be concatenated. No flags are allowed inside the cookie for easier merging: use the FT-Flags header instead.

Hide

Include in the hide attribute the elements that should not run pa11y (i.e. google ad iFrames) Use with caution. It may break the experience for users.