1.0.0-0 • Published 2 years ago

tenon-node-2 v1.0.0-0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Node.js wrapper for the Tenon.io API

comment: <> ([NPM(https://nodei.co/npm/tenon-node.png)](https://nodei.co/npm/tenon-node/))

comment: <> ([Build Status(https://secure.travis-ci.org/poorgeek/tenon-node.png?branch=master)](http://travis-ci.org/poorgeek/tenon-node); Dependencies(https://david-dm.org/poorgeek/tenon-node.svg); Dev Dependencies(https://david-dm.org/poorgeek/tenon-node/dev-status.svg))

This is a new project that is based on previous work done by Justin Stockton. The code is moved to new repo and all new development should be performed in this repository

Getting Started

Install the module with: npm install tenon-node-2

var tenonNode = require('tenon-node-2');

// Create an instance with your API key
var tenonApi = new tenonNode({
    key: 'YOUR_API_KEY_HERE',
    endPoint: 'http://tenon.io/api/index.php' // or your private tenon instance
});

tenonApi.analyze('http://www.example.com', function(err, result) {
    if (err) {
        console.error(err);
    } else {
        console.log('Tenon.checkUrl', result);
    }
});

Documentation

Each of the following methods takes an optional options object that can be More information about available options can be found in the Tenon API documentation.

analyze(string, [options,] callback)

Tests a given url, code snippet or full HTML page for accessibility issues.

checkUrl(url, [options,] callback)

Tests a given URL for accessibility issues.

checkSrc(src, [options,] callback)

Tests a complete HTML document for accessibility issues.

Note: if you want to test a fragment, block or snippet of code against Tenon, then use checkFragment() or specify fragment: '1' in your options.

checkFragment(src, [options,] callback)

Tests a fragment, block or snippet of code for accessibility issues.

Examples

See example/tenon-node_example.js

Contributing

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

License

Copyright (c) 2021 Tenon LLC. Licensed under the MIT license.

1.0.0-1

2 years ago

1.0.0-0

2 years ago