Skip to content

Commit bae1e54

Browse files
committed
Updated readme
1 parent 8437da1 commit bae1e54

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

README.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010

1111
[![Downloads per month](https://img.shields.io/npm/dm/@nut-tree/nut-js)](https://www.npmjs.com/package/@nut-tree/nut-js)
1212

13+
<h1 style="text-align: center"><a href="https://nutjs.dev">nutjs.dev</a></h1>
14+
1315
<p style="text-align: center">
14-
Native UI testing / automation with node.js
16+
Native UI testing / automation with Node.js
1517
</p>
1618
<br/>
1719

@@ -42,6 +44,10 @@ Check out this demo video to get a first impression of what nut.js is capable of
4244

4345
[![nut.js demo video](https://img.youtube.com/vi/MpIyUJnU_Bk/1.jpg)](https://www.youtube.com/watch?v=MpIyUJnU_Bk)
4446

47+
# Tutorials
48+
49+
Please consult the project website at [nutjs.dev](https://nutjs.dev/docs/tutorial-first_steps/prerequisits) for in-depth tutorials
50+
4551
# Examples
4652

4753
[nut-tree/trailmix](https://github.com/nut-tree/trailmix) contains a set of ready to use examples which demo the usage ot nut.js.
@@ -50,10 +56,6 @@ Check out this demo video to get a first impression of what nut.js is capable of
5056

5157
nut.js provides [public API documentation](https://nut-tree.github.io/apidoc/) auto-generated by [TypeDoc](https://typedoc.org).
5258

53-
# Discussion
54-
55-
In [nut-tree/rfc](https://github.com/nut-tree/rfc) documents regarding larger design / implementation changes in nut.js are up for discussion.
56-
5759
# Community
5860

5961
Feel free to join our [Discord community](https://discord.gg/sJkN7789XR)
@@ -89,11 +91,11 @@ It's work in progress and will undergo constant modification.
8991

9092
## Screen
9193

92-
- [x] Find an image on screen
94+
- [x] Find an image on screen (requires an additional provider package like e.g. [nut-tree/template-matcher](https://www.npmjs.com/package/@nut-tree/template-matcher))
9395
- [x] Find all image occurrences on screen
94-
- [x] Wait for an image to appear on screen
96+
- [x] Wait for an image to appear on screen (requires an additional provider package like e.g. [nut-tree/template-matcher](https://www.npmjs.com/package/@nut-tree/template-matcher))
9597
- [x] Retrieve RGBA color information on screen
96-
- [x] Hooks to trigger actions based on images
98+
- [x] Hooks to trigger actions based on images (requires an additional provider package like e.g. [nut-tree/template-matcher](https://www.npmjs.com/package/@nut-tree/template-matcher))
9799
- [x] Highlighting screen regions
98100

99101
## Integration
@@ -103,12 +105,12 @@ It's work in progress and will undergo constant modification.
103105

104106
# Sample
105107

106-
The following snippet shows a valid `nut.js` example (on macOS)
108+
The following snippet shows a valid `nut.js` example:
107109

108110
```js
109111
"use strict";
110112

111-
const { keyboard, Key, mouse, left, right, up, down, screen } = require("@nut-tree/nut-js");
113+
const { mouse, left, right, up, down, straightTo, centerOf, Region} = require("@nut-tree/nut-js");
112114

113115
const square = async () => {
114116
await mouse.move(right(500));
@@ -117,30 +119,23 @@ const square = async () => {
117119
await mouse.move(up(500));
118120
};
119121

120-
const openSpotlight = async () => {
121-
await keyboard.pressKey(Key.LeftSuper);
122-
await keyboard.pressKey(Key.Space);
123-
await keyboard.releaseKey(Key.Space);
124-
await keyboard.releaseKey(Key.LeftSuper);
125-
};
126-
127122
(async () => {
128123
await square();
129-
await openSpotlight();
130-
await keyboard.type("calculator");
131-
await keyboard.type(Key.Return);
124+
await mouse.move(
125+
straightTo(
126+
centerOf(
127+
new Region(100, 100, 200, 300)
128+
)
129+
)
130+
);
132131
})();
133132
```
134133

135134
# Installation
136135

137-
`nut.js` comes with a pre-built version of OpenCV for your respective target platform.
138-
In order to use these pre-compiled bindings, certain runtime conditions have to be met.
139-
140136
## Prerequisites
141137

142138
This section lists runtime requirements for `nut.js` on the respective target platform.
143-
`nut.js` is built and tested against node 10 and later as well as Electron 4 and later, so in order to use `nut.js` please make sure to use one of these versions.
144139

145140
#### Windows
146141

0 commit comments

Comments
 (0)