Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nodegui/os-utils
A helper module for NodeGui which contains OS specific native features.
https://github.com/nodegui/os-utils
Last synced: 3 months ago
JSON representation
A helper module for NodeGui which contains OS specific native features.
- Host: GitHub
- URL: https://github.com/nodegui/os-utils
- Owner: nodegui
- Created: 2019-10-25T23:11:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T06:50:00.000Z (about 2 years ago)
- Last Synced: 2024-09-21T13:57:39.016Z (4 months ago)
- Language: C++
- Homepage:
- Size: 250 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-nodegui - @nodegui/os-utils - A helper module for NodeGui which contains OS specific native features. (Plugins / Samples and Experiments)
README
# os-utils
[![npm version](https://img.shields.io/npm/v/@nodegui/os-utils.svg)](https://www.npmjs.com/package/@nodegui/os-utils)
A helper module which contains OS specific native features.
## Installation
```
npm install @nodegui/os-utils
```## Usage
```js
import { Dock } from "@nodegui/os-utils";console.log("Showing the Dock icon on macOS");
Dock.show();
console.log("Hiding the Dock icon on macOS");
Dock.hide();
``````js
import { AboutPanel } from "@nodegui/os-utils";console.log("Open the about panel on macOS");
AboutPanel.open();
console.log("Open the about panel on macOS with modified defaults");
AboutPanel.open({ name: "Custom name", version: "2.3.5" });
``````js
import { Info } from "@nodegui/os-utils";console.log("isDarkMode: " + Info.isDarkMode());
```## Supported APIs
### macOS
- Dock
- `show()` - static method - Shows the Dock icon on macOS. Does nothing on other platforms.
- `hide()` - static method - Hides the Dock icon on macOS. Does nothing on other platforms.- AboutPanel
- `open(options?: object)` - static method - Opens the about panel on macOS. Does nothing on other platforms. `options` is optional and can contain the following strings: `name`, `version`, `applicationVersion`, and `copyright`. The default values are derived from `Info.plist`.
- Info
- `isDarkMode` - static method - Checks if the OS theme is dark mode in macOS. Does nothing on other platforms and returns false. Returns a boolean.## License
MIT