Files
2025-01-03 20:07:29 -08:00
..
2025-01-03 20:07:29 -08:00
2025-01-03 20:07:29 -08:00
2025-01-03 20:07:29 -08:00
2024-02-15 21:03:17 +01:00

nut.js TypeScript sample

nut.js is written in TypeScript and thus fully supports TypeScript

Setup

Install TypeScript in your project.

npm i typescript ts-node

Afterwards, initialize a new TypeScript project:

npx tsc --init

Write your test

Let's create a simple demo test:

import { Region, screen } from "@mintplex-labs/nut-js";

(async () => {
	await screen.highlight(new Region(100, 200, 300, 400));
})();

Run

npx ts-node index.ts