Skip to content

Commit cce03e1

Browse files
committed
update readme, close #137
1 parent 9b5c56a commit cce03e1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ pixelmatch image1.png image2.png output.png 0.1
6767
### Node.js
6868

6969
```js
70-
const fs = require('fs');
71-
const PNG = require('pngjs').PNG;
72-
const pixelmatch = require('pixelmatch');
70+
import fs from 'fs';
71+
import {PNG} from 'pngjs';
72+
import pixelmatch from 'pixelmatch';
7373

7474
const img1 = PNG.sync.read(fs.readFileSync('img1.png'));
7575
const img2 = PNG.sync.read(fs.readFileSync('img2.png'));
@@ -101,10 +101,11 @@ Install with NPM:
101101
npm install pixelmatch
102102
```
103103

104-
Use in the browser from a CDN:
104+
Or use in the browser from a CDN:
105105

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

0 commit comments

Comments
 (0)