npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

electron-tools

v2.4.2

Published

Tools to make your life easier while making an electron application

Downloads

25

Readme

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:

| Function | Description | Arguments/Params | |:-------------|:-------------------------------------------------|--------------------:| | openLink | Opens a link in the default browser | string link | | openExplorer | Opens a directory in File Explorer | string dir | | getPrimaryDisplaySize | Gets the size of the primary display in pixels | none | | moveMouse | Moves the mouse cursor to the set location | int x, int y | | openNotepad | Opens the notepad app | none | | openRegistry | Opens the system registry | none | | openTerminal | Opens the command prompt | none | | runCommand | Runs a command in the terminal | string commandToRun | | simulateKeypress | Presses a key on the users keyboard. Spacebar should now be working| string keys | | screenshot(not done) | Takes a screenshot | none | | click (beta) | Not enough testing has been done. Makes the user click on a specific pixel | mousebtn(only left supported right now) string(left or right), int x, int y | | lockWorkstation | Locks the current user profile | none |