data-uri-utils
v1.0.8
Published
A set of functions for manipuliating data URIs
Downloads
63,361
Readme
data-uri-utils
A set of functions for manipuliating data URIs.
Install
$ npm install data-uri-utils --save
Usage
const dataUri = require('data-uri-utils')
const uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
dataUri.normalize(uri)
dataUri.toBuffer(uri).byteLength // => 89
dataUri.test(uri) // => true
dataUri.exec(uri)[2] // => 'image/png'
License
data-uri-utils © Kiko Beats, released under the MIT License. Authored and maintained by Kiko Beats with help from contributors.
kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats