brightness

Change the screen brightness

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
brightness
3.0.07 years ago7 years agoMinified + gzip package size for brightness in KB

Readme

<br>
<img width="360" src="https://rawgit.com/kevva/brightness/master/media/logo.svg" alt="brightness">
<br>
<br>
<br>

Change the screen brightness

Install

$ npm install --save brightness

Usage

const brightness = require('brightness');

brightness.get().then(level => {
	console.log(level);
	//=> 0.5
});

brightness.set(0.8).then(() => {
	console.log('Changed brightness to 80%');
});

API

.get()

Returns a promise for the current brightness level.

.set(level)

Set brightness level.

level

Required
Type: number
A number between 0 and 1.

Related

License

MIT © Kevin Mårtensson