npm

looks-same-plus
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

npm npm npm

looks-same-plus

looks-same with automatic url downloading, jpg->png conversion and promises

Easy to use

Module usage

  const lsp = require( 'looks-same-plus' )
  const opts = undefined // e.g. { tolerance: 5 }, see https://github.com/gemini-testing/looks-same docs.
  const callback = undefined // node style callback support
 
  const r = await lsp(
    'https://yt3.ggpht.com/a/AGF-l79FVckie4j9WT-4cEW6iu3gPd4GivQf_XNSWg=s176-c-k-c0x00ffffff-no-rj-mo',
    'https://yt3.ggpht.com/a/AATXAJzlZzr16izsGHBCHIkO3H7n-UiHyZPCJFEPiQ=s176-c-k-c0x00ffffff-no-rj-mo',
    opts,
    callback
  )
 
  // see https://github.com/gemini-testing/looks-same docs for return value information
  r.equal && console.log( 'they are similar' ) || console.log( 'not similar' )

About

Tiny wrapper around looks-same to for a simple common use-case.

Why

With plain looks-same we have to convert JPG to PNG and download url's to local disk before we can compare them. This module handles those steps for you. +Promise support

For who?

How

Using jimp we download and/or convert images to PNG so that looks-same can process and compare them for us.

Similar

looks-same

pixelmatch

Test

tests against internet and local images with and without promises ( node style callbacks ).

npm test

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.2679latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.2679
0.0.18

Package Sidebar

Install

npm i looks-same-plus

Weekly Downloads

687

Version

0.0.2

License

MIT

Unpacked Size

31.1 kB

Total Files

8

Last publish

Collaborators

  • talmobi