@tauubyebye/system-control

0.1.1 • Public • Published

system-control

Node.js module to configure basic system parameters (brightness and audio).

Installation

npm install system-control

# Based on the os, install corresponding peer dependencies

# For Windows users,
npm install win-audio
# For Unix users,
npm install loudness

Usage

const { audio } = require('system-control');

audio.volume().then(volume => console.log(volume)) // get system volume
audio.volume(80)
  .then(() => console.log('volume changed')) // set system volume
  .catch((err) => console.error(err));
import { audio } from 'system-control';

(async () => {
  const volume = await audio.volume() // get system volume
  try {
    await audio.volume(80) // set system volume
    console.log(`volume changed from ${volume} to 80`)
  } catch (e) {
    console.error(e);
  }
})()

API

systemControl.audio

volume

value: number | undefined

await audio.volume(10) // set volume
await audio.volume() // get volume

muted

value: boolean | undefined

await audio.muted(true) // set muted
await audio.muted() // get muted

systemControl.display

brightness

value: number | undefined

await display.brightness(10) // set brightness
await display.brightness() // get brightness

Readme

Keywords

none

Package Sidebar

Install

npm i @tauubyebye/system-control

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

3.69 kB

Total Files

5

Last publish

Collaborators

  • tauubyebye