from-srcset
v1.1.2
Published
Get calculated source from srcset
Downloads
20
Readme
from-srcset
Get calculated source from srcset
Installation
$ npm install from-srcset
Usage
var srcset = require('from-srcset');
srcset({
srcset: `
https://placekitten.com/800/400 1200w,
https://placekitten.com/500/200 800w
`,
src: 'https://placekitten.com/500/100', // default source
sizes: ''
}).then(function(src) {
console.log(src);
})
You can use srcset as well!
srcset(
[
{
url: 'https://placekitten.com/400/200',
density: 2,
}
]
)