Introduction

nut.js in a nutshell

A quickstart guide to get you started with nut.js.

Installation

Step-by-step guides to setting up your system and installing the library.

Plugins

Extend the library with third-party plugins or write your own.

API reference

Learn more about the API details of nut.js.


Quick start

Here's a five step quick start guide to get you started with nut.js.

  1. Create a new npm project
    mkdir my-new-project
    cd my-new-project
    npm init
    
  2. Install nut.js
    npm i @nut-tree/nut-js
    
  3. Create a new file index.js and add the following code
    const { mouse, left, right, up, down } = require('@nut-tree/nut-js');
    
    (async () => {
      await mouse.move(right(500));
      await mouse.move(down(500));
      await mouse.move(left(500));
      await mouse.move(up(500));
    })();
    
  4. Run your script
    node index.js
    
  5. Enjoy your first nut.js script by watching your mouse move in a square

Oh no, that didn't work for me!

nut.js is designed and built such that it runs out of the box on all major platforms (macOS, Windows, Linux). In case of errors when following the quick start, please continue going through the installation guide to make sure required prerequisites are met.