Skip to content

kevva/brightness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


brightness


Change the screen brightness

Install

$ npm install 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 with 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