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 six-step quick start guide to get you started with nut.js.

  1. Purchase a nut.js license to access prebuilt packages
  2. Create a new npm project
    mkdir my-new-project
    cd my-new-project
    npm init
    
  3. Install nut.js
    npm i @nut-tree/nut-js
    
  4. Create a new file index.mjs and add the following code
    import { mouse, left, right, up, down } from '@nut-tree/nut-js';
    
    await mouse.move(right(500));
    await mouse.move(down(500));
    await mouse.move(left(500));
    await mouse.move(up(500));
    
  5. Run your script
    node index.mjs
    
  6. 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.