sciter-utils

1.0.8 • Public • Published

sciter utils

Useful functions for sciter.js.

demo

  • git clone the repository
  • install packages npm install
  • install latest sciter sdk npm run install-sdk
  • start the demo npm run scapp

demo requirements

  • A recent version of Node.js node (tested with 16 LTS) and its package manager npm.

add to your project

using npm

  • install package npm install sciter-utils
  • add to <script type="module">

copy source

  • add the src dir to your project
  • add to <script type="module">
import Utils from "node_modules/sciter-utils/src/utils.js";

document.on("ready", function() {
    // add support for F5 reload
    Utils.addReloadWindow();

    // center window on screen
    Utils.centerWindow();

    // center window around position
    Utils.centerWindowXY(100, 100);
});

functions

dpi

  • devicePixels()
  • dipPpx()
  • ppxDip()
  • mmPpx()

screen and window

  • monitorsCount()
  • logMonitors()
  • screenDimensions()
  • windowRect()
  • windowDimensions()
  • setWindowDimensions()
  • centerWindow()
  • centerWindowXY()
  • addReloadWindow()
  • minimizeWindowShortcut()
  • closeWindowOnEscape()
  • bringToFrontWindow()
  • focusWindow()

keyboard

  • keyLogger()
  • addKeyboardShortcut()
  • keyStr()

files

  • fileExists()
  • dirExists()
  • getSeparator()
  • splitPath()

json

  • loadJson()
  • saveJson()

misc.

Readme

Keywords

none

Package Sidebar

Install

npm i sciter-utils

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

21.3 kB

Total Files

4

Last publish

Collaborators

  • 8ctopus