From b858315d9f1fbad5f99d635319dac6591e4ddd9e Mon Sep 17 00:00:00 2001 From: Matteo Hertel Date: Tue, 24 Oct 2017 11:12:14 +0100 Subject: [PATCH] Fix node js example in the readme --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ca58c49..de32ac4 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,10 @@ npm install canvas The API under Node is the same as on the browser with one addition, a promise based `compareImage` convenience function that is used as follows: ``` js -const compareImage = require('resemblejs/compareImages'); +const compareImages = require('resemblejs/compareImages'); +const fs = require("fs"); +async function getDiff(){ // The parameters can be Node Buffers // data is the same as usual with an additional getBuffer() function const data = await compareImages( @@ -128,6 +130,11 @@ const data = await compareImages( ); fs.writeFileSync('./output.png', data.getBuffer()); + +} + +getDiff(); + ``` #### Tests