File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff 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
7474const img1 = PNG .sync .read (fs .readFileSync (' img1.png' ));
7575const img2 = PNG .sync .read (fs .readFileSync (' img2.png' ));
@@ -101,10 +101,11 @@ Install with NPM:
101101npm 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)
You can’t perform that action at this time.
0 commit comments