Skip to content

Commit

Permalink
1.6.0 - Errors and Warnings suppressing
Browse files Browse the repository at this point in the history
  • Loading branch information
WezomDev committed Nov 16, 2019
1 parent 10b4eb4 commit 7f1df74
Showing 1 changed file with 44 additions and 27 deletions.
71 changes: 44 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
> Visit https://java.com for download Java if you not have it

---

## Table of Contents

1. [CLI](https://github.com/dutchenkoOleg/node-w3c-validator#cli)
- [Options](https://github.com/dutchenkoOleg/node-w3c-validator#options)
1. [Node.js API](https://github.com/dutchenkoOleg/node-w3c-validator#nodejs-api)
- [nodeW3CValidator()](https://github.com/dutchenkoOleg/node-w3c-validator#nodew3cvalidatorpathto-options-done)
- [nodeW3CValidator.writeFile()](https://github.com/dutchenkoOleg/node-w3c-validator#nodew3cvalidatorwritefilefilepath-outputdata-done)
- [Usage Example](https://github.com/dutchenkoOleg/node-w3c-validator#usage-example)
1. [Errors and Warnings suppressing](https://github.com/dutchenkoOleg/node-w3c-validator#errors-and-warnings-suppressing)
1. [Changelog](https://github.com/dutchenkoOleg/node-w3c-validator#changelog)
1. [Contributing](https://github.com/dutchenkoOleg/node-w3c-validator#contributing)
- [Contributors 💪](https://github.com/dutchenkoOleg/node-w3c-validator#contributors-)
1. [Code of Conduct](https://github.com/dutchenkoOleg/node-w3c-validator#code-of-conduct)

---

## CLI
Expand Down Expand Up @@ -229,8 +245,35 @@ Name | Data type | Argument | Description
`outputData` | `string / Buffer` | | file output content
`done` | `Function` | _optional_ | if exist - it will asynchronous writes output to the filePath. See [fs.writeFile(file, data, callback)](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback)

### Usage Example

```js
// imports
const nodeW3CValidator = require('node-w3c-validator');

// paths
const validatePath = './dist/*.html';
// or directly to the file - './dist/index.html'
// or a glob pattern - './dist/**/*.html'
const resultOutput = './reports/result.html';

// validate
nodeW3CValidator(validatePath, {
format: 'html',
skipNonHtml: true,
verbose: true
}, function (err, output) {
if (err === null) {
return;
}
nodeW3CValidator.writeFile(resultOutput, output);
});
```

---


### Errors and Warnings suppressing
## Errors and Warnings suppressing

You can ignore some errors or warnings by suppressing them.
_**Note!** This feature can be used only on `html`, `json` and `lint` formats._
Expand Down Expand Up @@ -261,32 +304,6 @@ Now you can suppress it
}
```


### Usage Example

```js
// imports
const nodeW3CValidator = require('node-w3c-validator');

// paths
const validatePath = './dist/*.html';
// or directly to the file - './dist/index.html'
// or a glob pattern - './dist/**/*.html'
const resultOutput = './reports/result.html';

// validate
nodeW3CValidator(validatePath, {
format: 'html',
skipNonHtml: true,
verbose: true
}, function (err, output) {
if (err === null) {
return;
}
nodeW3CValidator.writeFile(resultOutput, output);
});
```

---

## Changelog
Expand Down

0 comments on commit 7f1df74

Please sign in to comment.