Get the mediatype of a data-uri.
$ npm install --save data-uri-type
const dataUriType = require('data-uri-type');
dataUriType('data:image/png;base64,iVBORw0KGgo')
.then(console.log) // 'image/png'
.catch(console.error);
Type: string
A data-URI
MIT © Hemanth.HM