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

grunt-tenon

v0.0.9

Published

grunt tenon accesibility test plugin

Downloads

3

Readme

grunt-tenon

Accessibility testing tool

Grunt task interface to the Tenon.io automated accessibility testing service; learn more about Tenon.io here.

This plugin is currently in beta. Please file an issues as you come across. Contributors welcome.

Getting Started

This plugin requires Grunt ~0.4.4 and Node no later than 0.10.0*.

*Users with newer versions are experiencing issues with the node-curl plugin that is required to make request against the Tenon API.

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-tenon --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-tenon');

The "tenon" task

Overview

In your project's Gruntfile, add a section named tenon to the data object passed into grunt.initConfig().

grunt.initConfig({
    tenon: {
        options: {
            // Task-specific options go here.
        },
        your_target: {
            // Target-specific file lists and/or options go here.
        },
    }
});

Properties

urls

Type: Array

Default value: []

A list of publicly accessible URLs that can be tested against the tenon API. Items of array, can be String or Object. If an object, additional tenon params can be added to object literal.

grunt.initConfig({
    tenon: {
        your_target: {
            urls: [
                {
                    url: 'http://www2.foo.com/content/te-com/usa/en/solid-state-connectors/product-1-2106003-1.html',
                    apiOptions: {
                        projectID: "MY_SPECIAL_PROJECT_ID",
                        importance: 3
                    }
                },
                'http://www2.foo.com/content/te-dev/usa/en/index.html'
            ]
        }
    }
});

Options

options.apiKey

Type: String

Default: ''

Registered tenon API key.

options.apiOptions

Type: Object

Default: {}

An object literal of tenon api parameters.

options.contentPaths

Type: Array

Default: []

A list of explicit content paths that are concatenated with the httpBase to form a publicly accessible URL for the tenon API to crawl.

options.force

Type: Boolean

Default: false

Set force to true to report JSHint errors but not fail the task.

options.httpBase

Type: String

Default: ''

Base host for an internal list of URLs to crawl.

options.timeout

Type: Number

Default value: 3000

The number in miliseconds of the request timeout to the tenon API.

options.urlService

Type: String

Default value: ''

A custom service endpoint that must return JSON and has a urls property. This property is an array of object literals. An individual object literal has a property called, path, which is the path tto a page. The path can be fully qualified or relative to the httpBase.

{
    urls: [
        {
            path: "/content/te-dev/usa/en/sprint-7/video-details"
        },
        {
            path: "/content/te-dev/usa/en/sprint-4/pnp/demo-browse"
        },
        {
            path: "/content/te-dev/usa/en/sprint-6/pgp/demo-pgp"
        }
    ]
}

Usage Examples

Default Options

In this example, the default options are used to set the tenon API key and public URL is crawled by the service.

grunt.initConfig({
    tenon: {
        options: {
            apiKey: "z3x55cx71z6045466X28cdacc87x544z"
        },
        local: {
            urls: [
                "http://www.myawesomewebsite.com"
            ]
        }
    }
});

Custom Options

In this example, custom options are used to overwrite the default options.

grunt.initConfig({
    tenon: {
        options: {
            httpBase: "http://www2-qa.foo.com",
            apiKey: "z3x55cx71z6045466X28cdacc87x544z",
            timeout: 240000,
            urlService: "/content/te-dev/usa/en/admin/testaccessibility.json.html",
            apiOptions: {
                certainty: 80,
                level: 'A',
                priority: 40,
                projectID: "MY_PROJECT_ID"
            },
            force: true
        },
        teLocal: {
            options: {
                contentPaths: [
                    '/content/te-dev/usa/en/index.html'
                ]
            }
        },
        teProd: {
            options: {
                urlService: "http://www2.foo.com/content/te-dev/usa/en/admin/testaccessibility.json.html"
            },
            urls: [
                {
                    url: 'http://www2.foo.com/content/te-com/usa/en/solid-state-connectors/product-1-2106003-1.html',
                    apiOptions: {
                        projectID: "MY_SPECIAL_PROJECT_ID"
                    }
                }
            ]
        }
    }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

v0.0.1

v0.0.2

  • Updated Gruntfile.js

v0.0.3

  • Updated README.md

v0.0.4

  • Updated for NPM

v.0.0.5

  • Refactored node modules.
  • Added tenon api options as task options
  • Moved urls from options to dedicated property and made reverse compatible as options. This matches the usage examples now.
  • Edited custom service description.
  • Updated README.md

v.0.0.6

  • Updated README.md

v.0.0.7

  • Added all tenon options to default (bulk) url requests.
  • Added ability to pass all tenon request options to each test URL to override default options, while still retaining ability to pass individual url strings.
  • Temporaily deprecated the src param, URL testing available in future version
  • Updated README.md

v.0.0.8

  • Updated version of node-curl dependency

v.0.0.9

  • Updates to reporter and tenon API endpoint