Skip to content
Change screen brightness
JavaScript
Branch: master
Clone or download
Latest commit 5fea4d2 Jul 22, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
media
.editorconfig Meta tweaks Jul 22, 2017
.gitattributes Tweaks Sep 4, 2016
.gitignore
.npmrc Meta tweaks Jul 22, 2017
index.js Make use of promises and move `win-brightness` and `xdg-brightness` i… Jan 6, 2016
license Meta tweaks Jul 22, 2017
package.json Meta tweaks Jul 22, 2017
readme.md
test.js

readme.md


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

You can’t perform that action at this time.