tenon-node
Version:
Node.js wrapper for the Tenon.io API
67 lines (39 loc) • 2.04 kB
Markdown
[](https://nodei.co/npm/tenon-node/)
[](http://travis-ci.org/poorgeek/tenon-node)  
Install the module with: `npm install tenon-node`
```js
var tenonNode = require('tenon-node');
// Create an instance with your API key
var tenonApi = new tenonNode({
key: 'YOUR_API_KEY_HERE',
endPoint: 'http://tenon.io' // 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);
}
});
```
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](https://tenon.io/documentation/understanding-request-parameters.php).
Tests a given url, code snippet or full HTML page for accessibility issues.
Tests a given URL for accessibility issues.
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.
Tests a fragment, block or snippet of code for accessibility issues.
See `example/tenon-node_example.js`
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](http://gruntjs.com).
Copyright (c) 2014 Justin Stockton
Licensed under the MIT license.