sc
system-control
npm i system-control
sc

system-control

Node.js module to configure basic system parameters

by Afrish Khan S

0.1.1 (see all)License:MITTypeScript:Not Found
npm i system-control
Readme

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

Downloads/wk

101

GitHub Stars

14

LAST COMMIT

3yrs ago

MAINTAINERS

1

CONTRIBUTORS

4

OPEN ISSUES

0

OPEN PRs

4
VersionTagPublished
0.1.1
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial