Calculates how many pixels per inch a screen has
npm i pixel-density --save
Include this line in your HTML (preferably in the body; here's why) and you can obtain pixel-density via the jsDelivr CDN:
or the unpkg CDN:
or you can download the latest version of pixel-density here.
const pixelDensity = ;
Node.js environment + Browser environment
;//=> 91.7877987534291;//=> 534.038101838133
You can read the changelog here.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
See also the list of contributors who participated in this project.
This project is licensed under the GPL-3.0 License - see here for more details.