$ gnpm install parse-data-uri
parse a data uri into mime type and buffer
var parseDataUri = require('parse-data-uri')
var dataUri = 'data:image/jpeg;base64,23423423...'
var parsed = parseDataUri(dataUri)
console.log(parsed)
// {
// mimeType: 'image/jpeg',
// data: Buffer < 00 00 00 ... >
// }
###parseDataUri : ( dataUri: String ) => {mimeType: String, data: Buffer}
$ npm install parse-data-uri
From package root:
$ npm install
$ npm test
Special thanks to @tootallnate for writing data-uri-to-buffer
ISC. (c) MMXIV jden jason@denizac.org. See LICENSE.md
Copyright 2013 - present © cnpmjs.org | Home |