Skip to content

Commit

Permalink
fix: update README example to avoid using experimental fs.promises (#43)
Browse files Browse the repository at this point in the history
If you use the README's usage sample as-is in Node LTS, you'll get a warning about use of an experimental node API. This change updates the example to avoid the warning.
  • Loading branch information
dbjorge authored May 20, 2019
1 parent 46a8542 commit 23518ff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ Before using axe-sarif-converter, you will need to run an [axe](https://github.c
axe-sarif-converter exports a single function, named `convertAxeToSarif`. Use it like this:

```ts
import * as Axe from 'axe';
import * as AxePuppeteer from 'axe-puppeteer';
import * as fs from 'fs';
import * as Puppeteer from 'puppeteer'
import * as util from 'util';

import { convertAxeToSarif, SarifLog } from 'axe-sarif-converter';

test('my accessibility test', async () => {
Expand All @@ -33,7 +39,7 @@ test('my accessibility test', async () => {
const sarifResults: SarifLog = convertAxeToSarif(axeResults);

// Output a SARIF file, perhaps for use with a Sarif Viewer tool
await fs.promises.writeFile(
await util.promisify(fs.writeFile)(
'./test-results/my-accessibility-test.sarif',
JSON.stringify(sarifResults),
{ encoding: 'utf8' });
Expand Down

0 comments on commit 23518ff

Please sign in to comment.