https://github.com/parro-it/screen-info
Multiplatform screen & monitors info
https://github.com/parro-it/screen-info
Last synced: 9 months ago
JSON representation
Multiplatform screen & monitors info
- Host: GitHub
- URL: https://github.com/parro-it/screen-info
- Owner: parro-it
- License: mit
- Created: 2016-11-21T16:11:11.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T03:27:51.000Z (over 5 years ago)
- Last Synced: 2024-04-15T00:06:10.122Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 2.09 MB
- Stars: 31
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# screen-info
[](https://greenkeeper.io/)
[](http://travis-ci.org/parro-it/screen-info)
[](https://npmjs.org/package/screen-info)
[](https://ci.appveyor.com/project/parro-it/screen-info)
[](https://npmjs.org/package/screen-info)
> A native multiplatform module to query the system OS for displays info.
## Usage
Get current screen info & print it to console:
```js
import Screen from ".";
const mainScreen = Screen.main();
console.log(`
Current screen size is ${mainScreen}
${mainScreen.width} pixels width,
${mainScreen.height} pixels height,
${mainScreen.widthMM} mm width,
${mainScreen.heightMM} mm height,
${mainScreen.colorDepth} bits per pixels
`);
```
This will output
```
Current screen size is 1920x1080x24
1920 pixels width,
1080 pixels height,
360 mm width,
210 mm height,
24 bits per pixels
```
## API
```js
main: () => {width:number, height: number, colorDepth: number}
```
return the size and color depth of default system display
```js
all: () => [{ width: number, height: number, colorDepth: number }];
```
return the size and color depth of all system displays
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install screen-info
```
## See Also
* [`noffle/common-readme`](https://github.com/noffle/common-readme)
## License
MIT