2.4.2 • Published 4 years ago

electron-tools v2.4.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Electron Tools

Tools to make your life easier while making an electron application, There is also features that electron can't do by default, such as moving the mouse, or locking the computer. For a full list of functions, scroll to the bottom of the readme.

Note: Currently, this module is for Windows only. And has only been tested on the latest version of Windows 10.

npm NPM GitHub repo size GitHub issues Platforms

Docs

This section is the documentation for Electron Tools

To get started, you're gonna need the package. To get it, you need NPM. If you're looking at this page, we expect that you're somewhat expirenced with Electron.

Install

To install Electron Tools type npm i electron-tools into your terminal.

If Electron isn't already installed in your project, NPM will install it for you before installing Electron Tools.

Make sure you already have your project initialized with npm init

Setup

To get Electron Tools setup in your project, like any other Node Module, all you have to do is require it in the renderer process.

const et = require("electron-tools");

That's all there is to getting it in your project.

Functions and calling them

As of writing this, electron tools is on version 2.0.0. So some things may change.

To call a function you must use that name of the constant you used earlier. We used et.

Use that name and then .whatEverFunction();

Example:

et.openLink("https://github.com/77Z/electron-tools");

You can also add a dot at the end of the require to only require one function, like so:

const openLink = require("electron-tools").openLink;

Then you just call openLink like so:

openLink("https://github.com/77Z/electron-tools");

Functions:

FunctionDescriptionArguments/Params
openLinkOpens a link in the default browserstring link
openExplorerOpens a directory in File Explorerstring dir
getPrimaryDisplaySizeGets the size of the primary display in pixelsnone
moveMouseMoves the mouse cursor to the set locationint x, int y
openNotepadOpens the notepad appnone
openRegistryOpens the system registrynone
openTerminalOpens the command promptnone
runCommandRuns a command in the terminalstring commandToRun
simulateKeypressPresses a key on the users keyboard. Spacebar should now be workingstring keys
screenshot(not done)Takes a screenshotnone
click (beta)Not enough testing has been done. Makes the user click on a specific pixelmousebtn(only left supported right now) string(left or right), int x, int y
lockWorkstationLocks the current user profilenone
2.4.2

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.1

4 years ago

2.0.1

4 years ago

1.0.2

4 years ago

2.0.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago