@nut-tree/template-matcher

Kind: ImageFinder provider


Installation

1npm i @nut-tree/template-matcher

Attention: @nut-tree/template-matcher only supports node up to v16 and Electron up to v13.

In case you want to use image search in later versions of node/Electron, please consult the sponsoring profile for access to @nut-tree/nl-matcher.


Usage

Simply require / import the package to wire up the provider:

1const { screen, imageResource } = require("@nut-tree/nut-js");
2require("@nut-tree/template-matcher");
3
4(async () => {
5  const img = await screen.find(imageResource("..."));
6})();

Configuration

@nut-tree/template-matcher takes an optional configuration object passed to it via MatchRequest#providerData property.

1export interface TemplateMatcherProviderData {
2    searchMultipleScales: boolean; // default: true
3}
1const {screen, imageResource} = require("@nut-tree/nut-js");
2require("@nut-tree/template-matcher");
3
4(async () => {
5    const img = await screen.findAll(imageResource("..."), {
6        providerData: {
7            searchMultipleScales: false
8        }
9    });
10})();

© 2023