Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevva/brightness
Change screen brightness
https://github.com/kevva/brightness
brightness brightness-level nodejs screen-brightness
Last synced: 18 days ago
JSON representation
Change screen brightness
- Host: GitHub
- URL: https://github.com/kevva/brightness
- Owner: kevva
- License: mit
- Created: 2015-05-22T18:13:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-22T22:02:49.000Z (over 7 years ago)
- Last Synced: 2024-10-12T01:06:37.618Z (about 1 month ago)
- Topics: brightness, brightness-level, nodejs, screen-brightness
- Language: JavaScript
- Size: 116 KB
- Stars: 192
- Watchers: 9
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
> Change the screen brightness
## Install
```
$ npm install brightness
```## Usage
```js
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
* [brightness-cli](https://github.com/kevva/brightness-cli) - CLI for this module
## License
MIT © [Kevin Mårtensson](https://github.com/kevva)