Skip to content

Commit

Permalink
update readme, close #137
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Jun 27, 2024
1 parent 9b5c56a commit cce03e1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ pixelmatch image1.png image2.png output.png 0.1
### Node.js

```js
const fs = require('fs');
const PNG = require('pngjs').PNG;
const pixelmatch = require('pixelmatch');
import fs from 'fs';
import {PNG} from 'pngjs';
import pixelmatch from 'pixelmatch';

const img1 = PNG.sync.read(fs.readFileSync('img1.png'));
const img2 = PNG.sync.read(fs.readFileSync('img2.png'));
Expand Down Expand Up @@ -101,10 +101,11 @@ Install with NPM:
npm install pixelmatch
```

Use in the browser from a CDN:
Or use in the browser from a CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script type="module">
import pixelmatch from 'https://esm.run/pixelmatch';
```
## [Changelog](https://github.com/mapbox/pixelmatch/releases)

0 comments on commit cce03e1

Please sign in to comment.