retinable

1.1.0 • Public • Published

retinable

checks if device have retina display

npm install retinable --save

to require module use

var retinable = require('retinable');
 
if (retinable()) {
    console.log("Your device have retina display");
}

Browser

<script src="dist/retinable.min.js"></script>
<script>
    if (retinable()) {
        console.log("Your device have retina display");
    }
</script>

Or use an AMD loader (such as RequireJS):

require(['dist/retinable.min.js'], function (Immutable) {
    if (retinable()) {
        console.log("Your device have retina display");
    }
});

retinable.suffix()

return @2x if device have retina display

var imgSrc = "/img/logo" + retinable.suffix() + '.png';

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    3
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i retinable

Weekly Downloads

3

Version

1.1.0

License

MIT

Last publish

Collaborators

  • gorangajic